Skip to content

Commit

Permalink
Updated website links to https.
Browse files Browse the repository at this point in the history
Updated alert CSS.
Stopped punctuation appearing in search lookahead.
Fixed change conflict when data out of sync.
Fixed issue with browser action icon sometimes not updating correctly.
  • Loading branch information
nero120 committed Sep 22, 2016
1 parent e1fb05b commit 15ef34e
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 105 deletions.
6 changes: 2 additions & 4 deletions css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,11 @@ body {

.alert {
width: 100%;
position: absolute;
z-index: 90;
border: none;
border-radius: 0;
padding: 10px 10px 15px;
margin-bottom: 5px;
background-color: rgba(234,56,105,0.9);
margin-bottom: 0;
background-color: $colour-danger;
border: none;
color: $colour-text1;

Expand Down
2 changes: 1 addition & 1 deletion issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Thanks for reporting a bug for xBrowserSync!
This is the bug tracker for the xBrowserSync client apps. If you are running an xBrowserSync service and need to report a bug for it, please do so at https://github.com/xBrowserSync/API/issues/.
Alternatively, if you are a user and need to report an issue with a particular xBrowserSync service, please go to http://xbrowsersync.org/contact/.
Alternatively, if you are a user and need to report an issue with a particular xBrowserSync service, please go to https://www.xbrowsersync.org/contact/.
Otherwise, to make it possible for us to help you please fill out the information below:
-->
Expand Down
71 changes: 38 additions & 33 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ xBrowserSync.App.Controller = function($scope, $q, $timeout, complexify, platfor
switch(view) {
case vm.view.views.search:
$timeout(function() {
platform.Interface.Refresh();
document.querySelector('input[name=txtSearch]').select();
});
break;
case vm.view.views.bookmark:
$timeout(function() {
// Focus on title field
document.querySelector('input[name="bookmarkTitle"]').select();
});
break;
Expand Down Expand Up @@ -650,6 +650,11 @@ xBrowserSync.App.Controller = function($scope, $q, $timeout, complexify, platfor
else {
errMessage = utility.GetErrorMessageFromException(response.error);
vm.alert.display(errMessage.title, errMessage.message, 'danger');

// If data out of sync, refresh sync
if (!!response.error && !!response.error.code && response.error.code === global.ErrorCodes.DataOutOfSync) {
platform.Sync(vm.sync.asyncChannel, { type: global.SyncType.Pull });
}
}

vm.working = false;
Expand Down Expand Up @@ -691,38 +696,6 @@ xBrowserSync.App.Controller = function($scope, $q, $timeout, complexify, platfor
break;
}
};

var syncBookmarksToolbar_Click = function() {
// If sync not enabled or user just clicked to disable toolbar sync, return
if (!global.SyncEnabled.Get() || !global.SyncBookmarksToolbar.Get()) {
return;
}

// Otherwise, display sync confirmation
vm.settings.service.displaySyncBookmarksToolbarConfirmation = true;
$timeout(function() {
document.querySelector('#btnSyncBookmarksToolbar_Confirm').focus();
});
};

var syncBookmarksToolbar_Confirm = function() {
// If sync not enabled, return
if (!global.SyncEnabled.Get()) {
return;
}

var syncData = {};
syncData.type = (!global.Id.Get()) ? global.SyncType.Push : global.SyncType.Pull;

// Hide sync confirmation
vm.settings.service.displaySyncBookmarksToolbarConfirmation = false;

// Show loading animation
vm.working = true;

// Start sync with no callback action
platform.Sync(vm.sync.asyncChannel, syncData, global.Commands.NoCallback);
};

var init = function() {
// Display intro animation if required
Expand Down Expand Up @@ -1130,6 +1103,38 @@ xBrowserSync.App.Controller = function($scope, $q, $timeout, complexify, platfor
vm.working = true;
queueSync();
};

var syncBookmarksToolbar_Click = function() {
// If sync not enabled or user just clicked to disable toolbar sync, return
if (!global.SyncEnabled.Get() || !global.SyncBookmarksToolbar.Get()) {
return;
}

// Otherwise, display sync confirmation
vm.settings.service.displaySyncBookmarksToolbarConfirmation = true;
$timeout(function() {
document.querySelector('#btnSyncBookmarksToolbar_Confirm').focus();
});
};

var syncBookmarksToolbar_Confirm = function() {
// If sync not enabled, return
if (!global.SyncEnabled.Get()) {
return;
}

var syncData = {};
syncData.type = (!global.Id.Get()) ? global.SyncType.Push : global.SyncType.Pull;

// Hide sync confirmation
vm.settings.service.displaySyncBookmarksToolbarConfirmation = false;

// Show loading animation
vm.working = true;

// Start sync with no callback action
platform.Sync(vm.sync.asyncChannel, syncData, global.Commands.NoCallback);
};

var syncForm_CancelSyncConfirmation_Click = function() {
// TODO: Ensure any sync messaging or process is cancelled also
Expand Down
26 changes: 25 additions & 1 deletion js/bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ xBrowserSync.App.Bookmarks = function($q, platform, global, api, utility) {

if (!tagsOnly) {
// Add all words from title
bookmarkWords = bookmarkWords.concat(_.compact(bookmark.title.replace("'", '').toLowerCase().split(/\s/)));
bookmarkWords = bookmarkWords.concat(_.compact(bookmark.title.replace("'", '').toLowerCase().split(/[\W_]/)));

// Split tags into individual words
if (!!bookmark.tags) {
Expand Down Expand Up @@ -514,6 +514,12 @@ xBrowserSync.App.Bookmarks = function($q, platform, global, api, utility) {
if (!data || !data.lastUpdated) {
return $q.reject({ code: global.ErrorCodes.NoDataFound });
}

// Check if data is out of sync
var lastUpdated = new Date(data.lastUpdated);
if (global.LastUpdated.Get().getTime() !== lastUpdated.getTime()) {
return $q.reject({ code: global.ErrorCodes.DataOutOfSync });
}

var bookmarksToUpdate;

Expand Down Expand Up @@ -541,6 +547,12 @@ xBrowserSync.App.Bookmarks = function($q, platform, global, api, utility) {
if (!data || !data.lastUpdated) {
return $q.reject({ code: global.ErrorCodes.NoDataFound });
}

// Check if data is out of sync
var lastUpdated = new Date(data.lastUpdated);
if (global.LastUpdated.Get().getTime() !== lastUpdated.getTime()) {
return $q.reject({ code: global.ErrorCodes.DataOutOfSync });
}

var bookmarksToUpdate;

Expand Down Expand Up @@ -570,6 +582,12 @@ xBrowserSync.App.Bookmarks = function($q, platform, global, api, utility) {
if (!data || !data.lastUpdated) {
return $q.reject({ code: global.ErrorCodes.NoDataFound });
}

// Check if data is out of sync
var lastUpdated = new Date(data.lastUpdated);
if (global.LastUpdated.Get().getTime() !== lastUpdated.getTime()) {
return $q.reject({ code: global.ErrorCodes.DataOutOfSync });
}

var bookmarksToUpdate;

Expand Down Expand Up @@ -698,6 +716,12 @@ xBrowserSync.App.Bookmarks = function($q, platform, global, api, utility) {
if (!data || !data.lastUpdated) {
return $q.reject({ code: global.ErrorCodes.NoDataFound });
}

// Check if data is out of sync
var lastUpdated = new Date(data.lastUpdated);
if (global.LastUpdated.Get().getTime() !== lastUpdated.getTime()) {
return $q.reject({ code: global.ErrorCodes.DataOutOfSync });
}

// Decrypt bookmarks
try {
Expand Down
5 changes: 4 additions & 1 deletion js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ xBrowserSync.App.Global = function(platform) {
Error_InvalidData_Message: 'error_InvalidData_Message',
Error_LastChangeNotSynced_Title: 'error_LastChangeNotSynced_Title',
Error_LastChangeNotSynced_Message: 'error_LastChangeNotSynced_Message',
Error_OutOfSync_Title: 'error_OutOfSync_Title',
Error_BookmarkNotFound_Title: 'error_BookmarkNotFound_Title',
Error_BookmarkNotFound_Message: 'error_BookmarkNotFound_Message',
Error_OutOfSync_Title: 'error_OutOfSync_Title',
Error_OutOfSync_Message: 'error_OutOfSync_Message',
Error_ContainerChanged_Title: 'error_ContainerChanged_Title',
Error_ContainerChanged_Message: 'error_ContainerChanged_Message',
Expand Down Expand Up @@ -269,6 +271,7 @@ xBrowserSync.App.Global = function(platform) {
UpdatedBookmarkNotFound: 10107,
XBookmarkNotFound: 10108,
ContainerChanged: 10109,
DataOutOfSync: 10110,
NoStatus: 10200,
FailedGetPageMetadata: 10300,
NotImplemented: 10400
Expand Down
8 changes: 6 additions & 2 deletions js/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,17 @@ xBrowserSync.App.Utility = function($q, platform, global) {
errorMessage.message = platform.Constants.Get(global.Constants.Error_LastChangeNotSynced_Message);
break;
case global.ErrorCodes.XBookmarkNotFound:
errorMessage.title = platform.Constants.Get(global.Constants.Error_OutOfSync_Title);
errorMessage.message = platform.Constants.Get(global.Constants.Error_OutOfSync_Message);
errorMessage.title = platform.Constants.Get(global.Constants.Error_BookmarkNotFound_Title);
errorMessage.message = platform.Constants.Get(global.Constants.Wrror_BookmarkNotFound_Message);
break;
case global.ErrorCodes.ContainerChanged:
errorMessage.title = platform.Constants.Get(global.Constants.Error_ContainerChanged_Title);
errorMessage.message = platform.Constants.Get(global.Constants.Error_ContainerChanged_Message);
break;
case global.ErrorCodes.DataOutOfSync:
errorMessage.title = platform.Constants.Get(global.Constants.Error_OutOfSync_Title);
errorMessage.message = platform.Constants.Get(global.Constants.Error_OutOfSync_Message);
break;
case global.ErrorCodes.NotImplemented:
errorMessage.title = platform.Constants.Get(global.Constants.Error_NotImplemented_Title);
errorMessage.message = platform.Constants.Get(global.Constants.Error_NotImplemented_Message);
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xbrowsersync-app",
"description": "The xBrowserSync client app.",
"version": "1.1.0",
"version": "1.1.1",
"author": "xBrowserSync",
"license": "MIT",
"repository": {
Expand All @@ -19,7 +19,6 @@
"bootstrap": "3.3.x",
"crypto-js": "3.1.x",
"font-awesome": "4.6.x",
"minify": "2.0.11",
"underscore": "1.8.x"
},
"devDependencies": {
Expand Down
14 changes: 10 additions & 4 deletions platform/chrome/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"message": "Previous"
},
"introPanel1_Message": {
"message": "<h4>Welcome</h4><p>Thanks for installing xBrowserSync!</p><p>Have a read through the following pages to help you get started. Should you require futher help, check out the <a href='http://xbrowsersync.org/#faqs' class='new-tab'>FAQs</a>.</p>"
"message": "<h4>Welcome</h4><p>Thanks for installing xBrowserSync!</p><p>Have a read through the following pages to help you get started. Should you require futher help, check out the <a href='https://www.xbrowsersync.org/#faqs' class='new-tab'>FAQs</a>.</p>"
},
"introPanel2_Message": {
"message": "<h4>Your secret word</h4><p>To begin, enter a secret word or phrase that will be used to encrypt and decrypt your browser data.</p><p>Make it strong to protect your data but also memorable, if you forget it we can't remind you and you won't be able to decrypt your data without it.</p>"
Expand Down Expand Up @@ -135,7 +135,7 @@
"message": "Change Service"
},
"updateServiceUrlForm_Message" : {
"message": "Enter the URL of an alternative xBrowserSync service. You can check the list of public xBrowserSync services <a href='http://xbrowsersync.org/#status' class='new-tab'>here</a>."
"message": "Enter the URL of an alternative xBrowserSync service. You can check the list of public xBrowserSync services <a href='https://www.xbrowsersync.org/#status' class='new-tab'>here</a>."
},
"updateServiceUrlForm_Placeholder" : {
"message": "xBrowserSync service URL"
Expand Down Expand Up @@ -332,11 +332,17 @@
"error_LastChangeNotSynced_Message" : {
"message": "The last change was not synced due to a bookmarks conflict. It would be a good idea to disable and re-enable sync before continuing."
},
"error_BookmarkNotFound_Title" : {
"message": "Bookmark not found"
},
"error_BookmarkNotFound_Message" : {
"message": "It looks like your bookmarks are out of sync. It would be a good idea to disable and re-enable sync before continuing."
},
"error_OutOfSync_Title" : {
"message": "Bookmarks out of sync"
"message": "Data out of sync"
},
"error_OutOfSync_Message" : {
"message": "The last change was not synced due to a bookmarks conflict. It would be a good idea to disable and re-enable sync before continuing."
"message": "Local data was out of sync but has now been refreshed. However, your last change was not synced so you will need to redo this change."
},
"error_ContainerChanged_Title" : {
"message": "xBrowserSync folder changed"
Expand Down
Loading

0 comments on commit 15ef34e

Please sign in to comment.