Skip to content

TagSpaces is an offline, open source, document manager with tagging support

cleaning core.api.js from ui code

Ilian8cb91f41e6e0
diff --git a/data/js/core.api.js b/data/js/core.api.js
index 69d5caa09..c1b00f328 100644
--- a/data/js/core.api.js
+++ b/data/js/core.api.js
@@ -40,12 +40,7 @@ define(function(require, exports, module) {
var startTime = undefined;
function initApp() {
- console.log("Init application");
-
- tsCoreUI.initUI();
- tsTagsUI.initUI();
- tsDirectoriesUI.initUI();
- tsFileOpener.initUI();
+ console.log("Init application");
tsSettings.loadSettingsLocalStorage();
@@ -64,38 +59,25 @@ define(function(require, exports, module) {
}
tsSettings.upgradeSettings();
-
- // Init views
+
+ // Init UI components
+ tsCoreUI.initUI();
+ tsTagsUI.initUI();
+ tsTagsUI.generateTagGroups();
+ tsDirectoriesUI.initUI();
+ tsDirectoriesUI.initConnections();
+ tsFileOpener.initUI();
tsPersManager.initPerspectives();
- $("#appVersion").text(tsSettings.DefaultSettings["appVersion"]+"beta");
- $("#appVersion").attr("title","["+tsSettings.DefaultSettings["appVersion"]+"."+tsSettings.DefaultSettings["appBuild"]+"]");
-
- tsDirectoriesUI.initConnections();
-
- tsTagsUI.generateTagGroups();
-
hideLoadingAnimation();
$(document).ready(function() {
- //$( "#container" ).show();
- //$( "#helpers" ).show();
initLayout();
initI18N();
initKeyBindings();
$( "#loading" ).hide();
console.log("Layout initialized");
-
- // Show start hint
- if(tsSettings.Settings.tagspacesList.length < 1 ) {
- $( "#createNewLocation" ).attr("title", "Start using TagSpaces by creating a new location.");
- $( "#createNewLocation" ).addClass("createFirstLocation");
- $( "#createNewLocation" ).tooltip( { placement: "bottom" } );
- $( "#createNewLocation" ).tooltip( "show" );
- $( "#locationName" ).prop('disabled', true);
- $( "#selectLocation" ).prop('disabled', true);
- }
});
checkForNewVersion();
@@ -421,7 +403,7 @@ define(function(require, exports, module) {
function switchIOAPI(type) {
if(type=="dropbox") {
tsIOApiDropbox.init();
- exports.IO = tsIOApiDropbox
+ exports.IO = tsIOApiDropbox;
} else {
exports.IO = tsIOApi;
}
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index 67774f686..f1b3f8225 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -19,9 +19,9 @@ define(function(require, exports, module) {
var alertModal = $('#alertDialog');
alertModal.find('h4').text(title);
- alertModal.find('.modal-body').append(message);
+ alertModal.find('.modal-body').text(message);
alertModal.find('#okButton').click(function(event) {
- alertModal.modal('hide');
+ alertModal.modal('hide');
});
alertModal.modal('show');
@@ -82,6 +82,19 @@ define(function(require, exports, module) {
};
var initUI = function() {
+ $("#appVersion").text(TSCORE.Config.DefaultSettings["appVersion"]+"beta");
+ $("#appVersion").attr("title","["+TSCORE.Config.DefaultSettings["appVersion"]+"."+TSCORE.Config.DefaultSettings["appBuild"]+"]");
+
+ // Show start hint
+ if(TSCORE.Config.Settings.tagspacesList.length < 1 ) {
+ $( "#createNewLocation" ).attr("title", "Start using TagSpaces by creating a new location.");
+ $( "#createNewLocation" ).addClass("createFirstLocation");
+ $( "#createNewLocation" ).tooltip( { placement: "bottom" } );
+ $( "#createNewLocation" ).tooltip( "show" );
+ $( "#locationName" ).prop('disabled', true);
+ $( "#selectLocation" ).prop('disabled', true);
+ }
+
platformTuning();
$( "#toggleLeftPanel" ).click(function() {
@@ -310,17 +323,24 @@ define(function(require, exports, module) {
$('#tagGroupsContent').hide();
// Search UI
+
+ $("#closeSearchOptionButton")
+ .click(function(e) {
+ $("#searchOptions").hide();
+ });
$("#searchBox")
- /*.focus(function(e) {
- $(this).removeClass("input-medium");
- $(this).addClass("input-large");
- })*/
+ .focus(function(e) {
+ //$(this).removeClass("input-medium");
+ //$(this).addClass("input-large");
+ $("#searchOptions").show();
+ })
.keyup(function(e) {
// On enter fire the search
if (e.keyCode == 13) {
$( "#clearFilterButton").addClass("filterOn");
TSCORE.PerspectiveManager.redrawCurrentPerspective();
+ $("#searchOptions").hide();
} else {
TSCORE.Search.nextQuery = this.value;
}
@@ -341,12 +361,14 @@ define(function(require, exports, module) {
$("#searchButton").click(function(evt) {
evt.preventDefault();
$( "#clearFilterButton").addClass("filterOn");
+ $("#searchOptions").hide();
TSCORE.PerspectiveManager.redrawCurrentPerspective();
});
$("#clearFilterButton")
.click(function(evt) {
evt.preventDefault();
+ $("#searchOptions").hide();
$("#clearFilterButton").removeClass("filterOn");
$("#searchBox").val("");
//$("#"+self.extensionID+"FilterBox").val("").addClass("input-medium");