TagSpaces is an offline, open source, document manager with tagging support
File properties dialog added
Ilian03ea464f8384
diff --git a/data/js/fileopener.js b/data/js/fileopener.jsindex 934387a98..3008f0bed 100644--- a/data/js/fileopener.js+++ b/data/js/fileopener.js@@ -10,6 +10,8 @@ define(function(require, exports, module) {var _openedFilePath = undefined;+ var _openedFileProperties = undefined;+var _isFileOpened = false;var _tsEditor = undefined;@@ -113,7 +115,12 @@ define(function(require, exports, module) {else if (docElm.webkitRequestFullScreen) {docElm.webkitRequestFullScreen();}- });+ });++ $( "#openProperties" )+ .click( function() {+ showFilePropertiesDialog();+ });}function isFileEdited() {@@ -219,7 +226,6 @@ define(function(require, exports, module) {updateUI();initTagSuggestionMenu(filePath);-// Clearing file selection on file load and adding the current file path to the selectionTSCORE.PerspectiveManager.clearSelectedFiles();@@ -229,6 +235,10 @@ define(function(require, exports, module) {TSCORE.openFileViewer();}+ function setFileProperties(fileProperties) {+ _openedFileProperties = fileProperties;+ }+function updateEditorContent(fileContent) {console.log("Updating editor"); // with data: "+fileContent);_tsEditor.setContent(fileContent);@@ -380,6 +390,24 @@ define(function(require, exports, module) {}};}++ function showFilePropertiesDialog() {+ require([+ "text!templates/FilePropertiesDialog.html",+ ], function(uiTPL) {+ if($("#dialogFileProperties").length < 1) {+ var uiTemplate = Handlebars.compile( uiTPL );+ $('body').append(uiTemplate());+ $('#filePathProperty').attr("readonly", true);+ $('#fileSizeProperty').attr("readonly", true);+ $('#fileLMDTProperty').attr("readonly", true);+ }+ $("#filePathProperty").val(_openedFileProperties.path);+ $("#fileSizeProperty").val(_openedFileProperties.size);+ $("#fileLMDTProperty").val(new Date(_openedFileProperties.lmdt));+ $('#dialogFileProperties').modal({show: true});+ });+ }// Public API definitionexports.initUI = initUI;@@ -388,5 +416,7 @@ define(function(require, exports, module) {exports.isFileEdited = isFileEdited;exports.setFileOpened = setFileOpened;exports.getOpenedFilePath = getOpenedFilePath;- exports.updateEditorContent = updateEditorContent;+ exports.updateEditorContent = updateEditorContent;+ exports.setFileProperties = setFileProperties;+});\ No newline at end of filediff --git a/data/js/postioapi.js b/data/js/postioapi.jsindex d2db0c630..69f43b2d1 100644--- a/data/js/postioapi.js+++ b/data/js/postioapi.js@@ -111,6 +111,7 @@ define(function(require, exports, module) {exports.getFileProperties = function(fileProperties) {console.log("File properties: "+JSON.stringify(fileProperties));+ TSCORE.FileOpener.setFileProperties(fileProperties);};});\ No newline at end of filediff --git a/data/templates/FilePropertiesDialog.html b/data/templates/FilePropertiesDialog.htmlnew file mode 100644index 000000000..f1e84f4ae--- /dev/null+++ b/data/templates/FilePropertiesDialog.html@@ -0,0 +1,31 @@+<div id="dialogFileProperties" class="modal" tabindex="-1" role="dialog" aria-hidden="true">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">+ ×+ </button>+ <h4>File Properties</h4>+ </div>+ <div class="modal-body form">+ <div class="form-group">+ <label class="control-label" for="filePathProperty">File Path</label>+ <input class="form-control uneditable-input" type="text" name="filePathProperty" id="filePathProperty" />+ </div>+ <div class="form-group">+ <label class="control-label" for="fileSizeProperty">File Size in Bytes</label>+ <input class="form-control uneditable-input" type="text" name="fileSizeProperty" id="fileSizeProperty" />+ </div>+ <div class="form-group">+ <label class="control-label" for="fileLMDTProperty">File Last Modified Datetime</label>+ <input class="form-control uneditable-input" type="text" name="fileLMDTProperty" id="fileLMDTProperty" />+ </div>+ </div>+ <div class="modal-footer">+ <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">+ Ok+ </button>+ </div>+ </div><!-- /.modal-content -->+ </div><!-- /.modal-dialog -->+</div><!-- /.modal -->\ No newline at end of file