Skip to content

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

About box scrolling iframe on reopening

kristiyandd862be1efb441
diff --git a/data/index.html b/data/index.html
index d6bd1d82d..f4ba53614 100644
--- a/data/index.html
+++ b/data/index.html
@@ -349,7 +349,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
- <a type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></a>
+ <a type="button" id="closeDialog" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></a>
<h4 class="modal-title" id="myModalLabel1" data-i18n="ns.dialogs:aboutTitle"></h4>
</div>
<div class="modal-body">
@@ -357,7 +357,7 @@
</div>
<div class="modal-footer">
<button class="btn pull-left" id="aboutDialogBack" title="Go Back"><i class="fa fa-arrow-left fa-lg"></i></button>
- <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"><i class="fa fa-check fa-lg"></i></button>
+ <button class="btn btn-primary" id="confirmButtonDialog" data-dismiss="modal" aria-hidden="true"><i class="fa fa-check fa-lg"></i></button>
</div>
</div>
</div>
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index 0d4879164..90e117985 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -17,10 +17,10 @@ define(function(require, exports, module) {
var addFileInputName;
var fileDropTemplate = Handlebars.compile(
- '<div id="fileDropArea">' +
- '<div id="fileDropExplanation"><i class="fa fa-2x fa-mail-forward"></i><br>' +
- '<span>Drop files here in order to be copied or moved in the current folder</span></div>' +
- '</div>'
+ '<div id="fileDropArea">' +
+ '<div id="fileDropExplanation"><i class="fa fa-2x fa-mail-forward"></i><br>' +
+ '<span>Drop files here in order to be copied or moved in the current folder</span></div>' +
+ '</div>'
);
function initUI() {
@@ -71,7 +71,7 @@ define(function(require, exports, module) {
var reader = new FileReader();
reader.onload = onFileReadComplete;
if (isCordova) {
- reader.readAsDataURL(file);
+ reader.readAsDataURL(file);
} else {
reader.readAsArrayBuffer(file);
}
@@ -183,12 +183,22 @@ define(function(require, exports, module) {
}
});
- $('#aboutDialogBack').click(function() {
+ function eulaVersion() {
if (TSCORE.PRO) {
$('#aboutIframe').attr('src', 'pro/about.html');
} else {
$('#aboutIframe').attr('src', 'about.html');
}
+ }
+
+ $('#aboutDialogBack').click(function() {
+ eulaVersion();
+ });
+ $('#confirmButtonDialog').click(function() {
+ eulaVersion();
+ });
+ $('#closeDialog').click(function() {
+ eulaVersion();
});
// Open About Dialog
@@ -241,7 +251,8 @@ define(function(require, exports, module) {
TSCORE.showFileDeleteDialog(TSCORE.selectedFiles[0]);
});
- $('#fileOpenProperties').click(function() {});
+ $('#fileOpenProperties').click(function() {
+ });
// End File Menu
$('#showLocations').click(function() {
@@ -444,21 +455,21 @@ define(function(require, exports, module) {
closeWith: ['button', 'click'],
});
/*var alertModal = $('#alertDialog');
- alertModal.find('h4').text(title);
- alertModal.find('.modal-body').empty();
- alertModal.find('.modal-body').text(message);
- alertModal.find('#okButton').off('click').click(function() {
- alertModal.modal('hide');
- });
- // Focusing the ok button by default
- alertModal.off('shown.bs.modal');
- alertModal.on('shown.bs.modal', function() {
- alertModal.find('#okButton').focus();
- });
- alertModal.modal({
- backdrop: 'static',
- show: true
- });*/
+ alertModal.find('h4').text(title);
+ alertModal.find('.modal-body').empty();
+ alertModal.find('.modal-body').text(message);
+ alertModal.find('#okButton').off('click').click(function() {
+ alertModal.modal('hide');
+ });
+ // Focusing the ok button by default
+ alertModal.off('shown.bs.modal');
+ alertModal.on('shown.bs.modal', function() {
+ alertModal.find('#okButton').focus();
+ });
+ alertModal.modal({
+ backdrop: 'static',
+ show: true
+ });*/
}
function showConfirmDialog(title, message, okCallback, cancelCallback, confirmShowNextTime) {
@@ -579,13 +590,13 @@ define(function(require, exports, module) {
filePath: filePath
}), function() {
TSCORE.IO.deleteFilePromise(filePath).then(function() {
- TSPOSTIO.deleteElement(filePath);
- },
- function(error) {
- TSCORE.hideLoadingAnimation();
- TSCORE.showAlertDialog("Deleting file " + filePath + " failed.");
- console.error("Deleting file " + filePath + " failed " + error);
- }
+ TSPOSTIO.deleteElement(filePath);
+ },
+ function(error) {
+ TSCORE.hideLoadingAnimation();
+ TSCORE.showAlertDialog("Deleting file " + filePath + " failed.");
+ console.error("Deleting file " + filePath + " failed " + error);
+ }
);
});
}
@@ -606,14 +617,14 @@ define(function(require, exports, module) {
}
TSCORE.showConfirmDialog(
- $.i18n.t('ns.dialogs:fileDeleteTitleConfirm'),
- $.i18n.t(dlgConfirmMsgId, {selectedFiles: selFiles}),
- function() {
- if (TSCORE.IO.stopWatchingDirectories) {
- TSCORE.IO.stopWatchingDirectories();
- }
- TSCORE.IOUtils.deleteFiles(TSCORE.Utils.getUniqueSelectedFiles());
- }
+ $.i18n.t('ns.dialogs:fileDeleteTitleConfirm'),
+ $.i18n.t(dlgConfirmMsgId, {selectedFiles: selFiles}),
+ function() {
+ if (TSCORE.IO.stopWatchingDirectories) {
+ TSCORE.IO.stopWatchingDirectories();
+ }
+ TSCORE.IOUtils.deleteFiles(TSCORE.Utils.getUniqueSelectedFiles());
+ }
);
}
@@ -644,6 +655,37 @@ define(function(require, exports, module) {
});
}
+ function showRenameFileDialog() {
+ if (TSCORE.selectedFiles[0]) {
+ $('#renamedFileName').val(TSCORE.selectedFiles[0]);
+ $('#formFileRename').validator();
+ $('#formFileRename').submit(function(e) {
+ e.preventDefault();
+ if ($('#renameFileButton').prop('disabled') === false) {
+ $('#renameFileButton').click();
+ }
+ });
+ $('#formFileRename').on('invalid.bs.validator', function() {
+ $('#renameFileButton').prop('disabled', true);
+ });
+ $('#formFileRename').on('valid.bs.validator', function() {
+ $('#renameFileButton').prop('disabled', false);
+ });
+ $('#dialogFileRename').on('shown.bs.modal', function() {
+ $('#renamedFileName').focus();
+ });
+ $('#dialogFileRename').modal({
+ backdrop: 'static',
+ show: true
+ });
+ $('#dialogFileRename').draggable({
+ handle: ".modal-header"
+ });
+ } else {
+ TSCORE.showAlertDialog("Renaming file failed. Please select a file.");
+ }
+ }
+
function showDirectoryBrowserDialog(path) {
require([
'text!templates/DirectoryBrowserDialog.html',
@@ -676,7 +718,9 @@ define(function(require, exports, module) {
});
}
- function showWelcomeDialog() { startGettingStartedTour(); }
+ function showWelcomeDialog() {
+ startGettingStartedTour();
+ }
function startGettingStartedTour() {
var tsGettingStarted = require('tsgettingstarted');
@@ -943,6 +987,7 @@ define(function(require, exports, module) {
exports.showSuccessDialog = showSuccessDialog;
exports.showConfirmDialog = showConfirmDialog;
exports.showFileRenameDialog = showFileRenameDialog;
+ exports.showRenameFileDialog = showRenameFileDialog;
exports.showFileCreateDialog = showFileCreateDialog;
exports.showFileDeleteDialog = showFileDeleteDialog;
exports.showDeleteFilesDialog = showDeleteFilesDialog;