Skip to content

Commit

Permalink
v1.8.1 RC1
Browse files Browse the repository at this point in the history
• Fixes issue #48 - common.js' openDb method now uses the background page's window.db var for all tabs.
• Slightly increased Address Box result padding.
• Added info when prompting to add an Address Box result keyword.
• Updated suggested keyboard shortcuts.
• Removed unused pages and icons.
• Improved build flow.
  • Loading branch information
ChrisNZL committed Jun 13, 2019
1 parent 425f742 commit 683827d
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 122 deletions.
8 changes: 4 additions & 4 deletions Fauxbar/css/fauxbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ button { padding:3px 12px; }

/* More Address Box results and Search Box suggestions/queries */
/* .arrowed is for hovered/highlighted/selected results */
.result, .resultpreview { border-bottom:1px solid rgba(0,0,0,.11); padding: 4px 5px 5px 5px; display:block; }
.result, .resultpreview { border-bottom:1px solid rgba(0,0,0,.11); padding: 5px 5px 6px 7px; display:block; }
.arrowed, .rightClickedResult { background-color:#3399ff; color:#fff; }
.result_url, #options .result_url { padding-left:21px; white-space:nowrap; font-size:12px; overflow:hidden; display:inline-block; }
.result_title, #options .result_title { font-size:14px; line-height:140%; white-space:nowrap; overflow:hidden; display:inline-block; }
Expand All @@ -89,8 +89,8 @@ button { padding:3px 12px; }
/* Highlight matching words within results. Added in 1.6.0. */
.highlight { background-color:#f8ffbf; border-radius:2px; }

/* Bookmark icon */
.favstar { float:right; margin-top:2px; margin-right:-1px; }
/* Bookmark icon. fauxbar-1.js overrides margins: `var favstarMarginTop` and `var favstarMarginLeft` */
.favstar { float:right; }

/* "Truncated" dotting for Address Box result titles and URLs */
.dotdotdot { position:relative; float:right; }
Expand Down Expand Up @@ -217,7 +217,7 @@ progress { width:100%; margin-top:6px; }
input::-webkit-input-placeholder { color:rgba(0,0,0,.5); font-style:italic; }
input:focus::-webkit-input-placeholder { color:transparent; }

.resultTag { padding:2px 5px 0 8px; text-decoration:none; }
.resultTag { padding:0px 4px 0 8px; text-decoration:none; }

#addressbaricon { margin-top:1px; height:16px; width:16px; }

Expand Down
32 changes: 0 additions & 32 deletions Fauxbar/html/loadpaypal.html

This file was deleted.

6 changes: 3 additions & 3 deletions Fauxbar/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,9 @@ <h1>
<td>
<table id="defaultKeyboardShortcuts">
<tr><td>Activate the extension: <span style="opacity:.5; cursor:help"
title="This is the equivalent of clicking Fauxbar's toolbar icon (located beside Chrome's Omnibox).">(?)</span></td><td>&nbsp;Not set</td></tr>
title="This is the equivalent of clicking Fauxbar's toolbar icon (located beside Chrome's Omnibox).">(?)</span></td><td><kbd>Ctrl</kbd>+<kbd>T</kbd></td></tr>
<tr><td>Open <span class="extensionName">Fauxbar</span>'s Address Box in the current tab:</td><td><kbd>Alt</kbd>+<kbd>D</kbd></td></tr>
<tr><td>Open <span class="extensionName">Fauxbar</span>'s Address Box in a new tab:</td><td><kbd>Ctrl</kbd>+<kbd>T</kbd></td></tr>
<tr><td>Open <span class="extensionName">Fauxbar</span>'s Address Box in a new tab:</td><td>&nbsp;Not set</td></tr>
<tr><td>Open <span class="extensionName">Fauxbar</span>'s Search Box in the current tab:</td><td><kbd>Ctrl</kbd>+<kbd>K</kbd></td></tr>
<tr><td>Open <span class="extensionName">Fauxbar</span>'s Search Box in a new tab:</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>K</kbd></td></tr>
</table>
Expand Down Expand Up @@ -916,7 +916,7 @@ <h1>
<img src="/img/fauxbar48.png" style="height:28px; width:28px; vertical-align:middle; position:relative; top:-2px; padding-right:2px;" />
Management
</h1>
<span class="extensionName">Fauxbar</span> version 1.8.0 &nbsp;<span style="opacity:.5">(23 May, 2019)</span>
<span class="extensionName">Fauxbar</span> version 1.8.1 &nbsp;<span style="opacity:.5">(14 June 2019)</span>
<table>
<tr><td colspan="2" class="tdhr"><div></div></td></tr>
<tr>
Expand Down
Binary file removed Fauxbar/img/donate.gif
Binary file not shown.
Binary file removed Fauxbar/img/icon-code.png
Binary file not shown.
Binary file removed Fauxbar/img/icon-facebook.png
Binary file not shown.
Binary file removed Fauxbar/img/icon-gplus.png
Binary file not shown.
Binary file removed Fauxbar/img/icon-mail.png
Binary file not shown.
Binary file removed Fauxbar/img/icon-paypal.png
Binary file not shown.
Binary file removed Fauxbar/img/icon-reddit.png
Binary file not shown.
Binary file removed Fauxbar/img/icon-twitter.png
Binary file not shown.
Binary file removed Fauxbar/img/paypal_logo.png
Binary file not shown.
75 changes: 10 additions & 65 deletions Fauxbar/js/background-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,22 +1087,19 @@ $(document).ready(function(){
}

if (openDb()) {

window.db.transaction(function(tx){
tx.executeSql('ALTER TABLE opensearches ADD COLUMN encoding TEXT DEFAULT ""');
});

window.db.transaction(function(tx){
tx.executeSql('VACUUM');
});
}

localStorage.currentVersion = "1.8.0";
localStorage.currentVersion = chrome.runtime.getManifest().version;
});

chrome.runtime.onInstalled.addListener(function(details){
var currentVersion = "1.8.0";

var currentVersion = chrome.runtime.getManifest().version;
switch (details.reason) {

case 'install':
Expand Down Expand Up @@ -1131,7 +1128,6 @@ chrome.runtime.onInstalled.addListener(function(details){
chrome.tabs.create({url:url, active:true});
}*/


if (localStorage.justRetrievedFromCloud && localStorage.justRetrievedFromCloud == 1) {
delete localStorage.justRetrievedFromCloud;
chrome.tabs.create({url:chrome.runtime.getURL('/html/fauxbar.html#options=1')});
Expand Down Expand Up @@ -1198,6 +1194,12 @@ chrome.runtime.onInstalled.addListener(function(details){
}
}*/

// If updating to v1.8.1, force reindex in case database got wonky with Issue #48
if (localStorage.indexedbefore == 1 && localStorage.completedMaintenanceForIssue48 != 1) {
localStorage.reindexForMaintenance = 1;
localStorage.indexComplete = 0;
}

// New options for v1.8.0
if (!localStorage.option_trimPastedText) {
localStorage.option_trimPastedText = 1;
Expand Down Expand Up @@ -1468,7 +1470,6 @@ chrome.runtime.onInstalled.addListener(function(details){
break;

case 'chrome_update':

break;
}
});
Expand Down Expand Up @@ -2207,6 +2208,7 @@ function index() {
var secs = parseFloat(date("U"))-parseFloat(startTime);
window.reindexing = false;
localStorage.indexComplete = 1;
localStorage.completedMaintenanceForIssue48 = 1;
localStorage.issue47 = 0;
localStorage.almostdone = 1;
localStorage.needToReindex = 0;
Expand Down Expand Up @@ -2286,61 +2288,4 @@ chrome.idle.onStateChanged.addListener(function(newState){
}
break;
}
});*/


/*
chrome.notifications.create("updated",
{
type: 'list',
iconUrl: '/img/fauxbar128.png',
title: 'Fauxbar has been updated',
message: 'Yay!',
buttons: [
{ title: 'View full changelog' }
],
items: [
{ title:'Title 1', message:'Message' },
{ title:'Title 2', message:'Message' },
{ title:'Title 3', message:'Message' }
]
},
function(){}
);
*/

// Options sync, added in v1.4.0

// Send local options to Google's server
/*function pushOptions () {
var localKeyNames = new Array();
var keyName;
for (keyName in localStorage) {
if (substr(keyName, 0, 7) == 'option_' && keyName != 'option_bgimg') {
localKeyNames.push(keyName);
}
}
console.log('localKeyNames:',localKeyNames);
chrome.storage.sync.get(localKeyNames, function(items){
console.log('existing items:', items);
var optionsToPush = {};
for (var i in localKeyNames) {
keyName = localKeyNames[i];
if (!items[keyName] || items[keyName] != localStorage[keyName]) {
optionsToPush[keyName] = localStorage[keyName];
}
}
console.log('Wanting to push ' + Object.keys(optionsToPush).length + ' options to Google!');
console.log('optionsToPush:', optionsToPush);
if (Object.keys(optionsToPush).length > 0) {
//console.log('Wanting to push ' + Object.keys(optionsToPush).length + ' options to Google!');
chrome.storage.sync.set(optionsToPush, function(){
if (chrome.runtime.lastError) {
console.warn('Failed to push options because: ' + chrome.runtime.lastError.message);
} else {
console.log('Options have been pushed successfully.');
}
});
}
});
}*/
});*/
14 changes: 6 additions & 8 deletions Fauxbar/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,18 @@ function urldecode (str) {

// Initialize/create the database
function openDb(force) {
// Hopefully prevent issue #47 from happening... don't try to load the database if the page isn't ready
// Don't load database if page isn't ready
if (!$(document).ready()) {
return false;
}
if (!window.db) {
window.db = openDatabase('fauxbar', '1.0', 'Fauxbar data', 100 * 1024 * 1024);
var backgroundWindow = chrome.extension.getBackgroundPage();
if (!backgroundWindow.db) {
backgroundWindow.db = openDatabase('fauxbar', '1.0', 'Fauxbar data', 100 * 1024 * 1024);
}

window.db = backgroundWindow.db;
if (window.db) {
if (localStorage.indexComplete == 1 || force == true) {
return true;
} else {
return false;
}
return localStorage.indexComplete == 1 || force == true;
}
else {
alert("Fauxbar error: Unable to create or open Fauxbar's SQLite database.");
Expand Down
19 changes: 11 additions & 8 deletions Fauxbar/js/fauxbar-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,6 @@ function showContextMenu(e) {

if (usingSuperTriangle || $("#awesomeinput:focus").length) {
$("#super_triangle .triangle").addClass("glow");
// += ' <div class="menuOption" style="background-image:url(chrome://favicon/null); background-repeat:no-repeat; background-position:'+(window.OS == "Mac" ? "4px 1px" : "4px 2px")+';">History &amp; Bookmarks</div>';
html += ' <div class="menuOption" style="background-image:url(/img/null.png); background-repeat:no-repeat; background-position:'+(window.OS == "Mac" ? "4px 3px" : "4px 2px")+';">History &amp; Bookmarks</div>';
html += ' <div class="menuHr"></div>';
}
Expand Down Expand Up @@ -933,7 +932,7 @@ $("#contextMenu .menuOption").live("mousedown", function(){

case "Add Keyword...":
$("#contextMenu").css("opacity",0);
var keyword = prompt('Add a keyword for '+$(window.rightClickedResult).attr("url"));
var keyword = prompt('Add a keyword for '+$(window.rightClickedResult).attr("url")+'\n\nTyping the keyword will ensure the result appears first when using the Address Box.');
if (keyword) {
keyword = str_replace('"', '', keyword.trim());
if (keyword.length && openDb()) {
Expand Down Expand Up @@ -1954,18 +1953,21 @@ if (localStorage.indexComplete != 1) {
$("#apps").remove();
if (localStorage.reindexForMaintenance == 1) {
$("#indexinginfo b").html(localStorage.extensionName+" needs to reindex for maintenance");
$("#indexinginfo span#indexingInfo2").html(localStorage.extensionName+" needs to reindex your Chrome data to correct a bookmark-naming issue that was present in the previous version of "+localStorage.extensionName+".");
$("#indexinginfo span#indexingInfo2").html(localStorage.extensionName+" needs to reindex Chrome's data to correct a database issue that was present in the previous version of "+localStorage.extensionName+".");
$("#currentstatus").html("Click <b>Start Indexing</b> to begin.");
} else if (localStorage.needToReindex && localStorage.needToReindex == 1) {
}
else if (localStorage.needToReindex && localStorage.needToReindex == 1) {
$("#indexinginfo b").html(localStorage.extensionName+" needs to reindex your Chrome data");
$("#indexinginfo span#indexingInfo2").html(localStorage.extensionName+"'s database structure has been modified, so "+localStorage.extensionName+" needs to reindex your Chrome data. On the plus side, indexing is now approximately 70% faster than&nbsp;before.");
$("#currentstatus").html("Click <b>Start Indexing</b> to begin.");
} else if (localStorage.indexedbefore == 1) {
}
else if (localStorage.indexedbefore == 1) {
$("#indexinginfo b").html(localStorage.extensionName+" is reindexing");
$("#indexinginfo span#indexingInfo2").html(localStorage.extensionName+" is reindexing your history items and bookmarks.");
$("#currentstatus").html("Reindexing...");
$("button").last().prop('disabled',true).html('Please Wait...').blur();
} else if (localStorage.issue47 == 1) {
}
else if (localStorage.issue47 == 1) {
$("#indexinginfo b").html(localStorage.extensionName+" is rebuilding");
$("#indexinginfo span#indexingInfo2").html(localStorage.extensionName+" is rebuilding its database, and reindexing your history items and bookmarks. Any custom keywords and search engines you had will also be restored shortly after.");
$("#currentstatus").html("Rebuilding...");
Expand Down Expand Up @@ -3070,8 +3072,9 @@ function getResults(noQuery) {

var scrollbarWidth = window.resultsAreScrollable ? getScrollBarWidth() : 0;

var favstarMarginTop = window.OS == "Mac" ? "-1px" : "2px";
$("#results .favstar").attr("src", $("#fauxstar").attr("src")).css("margin-left",($("#results").innerWidth()-25-scrollbarWidth)+"px").css("margin-top",favstarMarginTop);
var favstarMarginTop = window.OS == "Mac" ? "-1px" : "0px";
var favstarMarginLeft = ($("#results").innerWidth()-26-scrollbarWidth)+"px";
$("#results .favstar").attr("src", $("#fauxstar").attr("src")).css("margin-top",favstarMarginTop).css("margin-left",favstarMarginLeft);
$(".resultTag").each(function(){
$(this).css("left", $("#results").offset().left + $("#results").outerWidth() - $(this).outerWidth() - $(this).offset().left - ($(this).prev(".favstar").length*16) - scrollbarWidth);
});
Expand Down
3 changes: 1 addition & 2 deletions Fauxbar/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//// Comments in this file must be prefixed with "////" and must be removed when packaging for Chrome Web Store

//// Remember to update:
//// background-new.js: var currentVersion = "1.x.x";
//// options.html: version 1.x.x and date

//// When packaging Fauxbar Lite, change:
Expand All @@ -18,7 +17,7 @@

"name": "Fauxbar", //// Rename for Fauxbar Lite

"version": "1.8.0",
"version": "1.8.1",
"description": "An alternative to Chrome's Omnibox. Replaces the New Tab page.", //// Remove last sentence for Fauxbar Lite

"minimum_chrome_version": "49",
Expand Down

0 comments on commit 683827d

Please sign in to comment.