diff --git a/css/jgrowl.css b/css/jgrowl.css index f4502435..380aff79 100644 --- a/css/jgrowl.css +++ b/css/jgrowl.css @@ -1,6 +1,6 @@ div.jGrowl { - z-index: 1050; + z-index: 1040; color: #fff; } @@ -48,7 +48,7 @@ div.center div.jGrowl-notification, div.center div.jGrowl-closer { div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer { background-color: #777; zoom: 1; - width: 280px; + width: 260px; padding: 15px 20px; margin-top: 5px; margin-bottom: 5px; diff --git a/js/core.js b/js/core.js index 6866d755..2d5e8a85 100644 --- a/js/core.js +++ b/js/core.js @@ -195,6 +195,7 @@ define([ slidable: false, livePaneResizing: true, enableCursorHotkey: false, + resizerDblClickToggle: false, north__spacing_open: 6, north__spacing_closed: 6, spacing_open: 35, @@ -266,6 +267,7 @@ define([ var editor = undefined; var fileDesc = undefined; var documentContent = undefined; + var $editorElt = undefined; core.initEditor = function(fileDescParam) { if(fileDesc !== undefined) { eventMgr.onFileClosed(fileDesc); @@ -273,8 +275,7 @@ define([ fileDesc = fileDescParam; documentContent = undefined; var initDocumentContent = fileDesc.content; - var editorElt = $("#wmd-input"); - editorElt.val(initDocumentContent); + $editorElt.val(initDocumentContent); if(editor !== undefined) { // If the editor is already created editor.undoManager.reinit(initDocumentContent, fileDesc.editorStart, fileDesc.editorEnd, fileDesc.editorScrollTop); @@ -285,13 +286,13 @@ define([ var previewContainerElt = $(".preview-container"); // Store editor scrollTop on scroll event - editorElt.scroll(function() { + $editorElt.scroll(function() { if(documentContent !== undefined) { fileDesc.editorScrollTop = $(this).scrollTop(); } }); // Store editor selection on change - editorElt.bind("keyup mouseup", function() { + $editorElt.bind("keyup mouseup", function() { if(documentContent !== undefined) { fileDesc.editorStart = this.selectionStart; fileDesc.editorEnd = this.selectionEnd; @@ -347,7 +348,7 @@ define([ }); function checkDocumentChanges() { - var newDocumentContent = editorElt.val(); + var newDocumentContent = $editorElt.val(); if(documentContent !== undefined && documentContent != newDocumentContent) { fileDesc.content = newDocumentContent; eventMgr.onContentChanged(fileDesc); @@ -361,7 +362,7 @@ define([ return function() { if(documentContent === undefined) { makePreview(); - editorElt.scrollTop(fileDesc.editorScrollTop); + $editorElt.scrollTop(fileDesc.editorScrollTop); previewContainerElt.scrollTop(fileDesc.previewScrollTop); } else { @@ -416,7 +417,7 @@ define([ var uiLocked = false; core.lockUI = function(param) { uiLocked = param; - $("#wmd-input").prop("disabled", uiLocked); + $editorElt.prop("disabled", uiLocked); $(".navbar-inner .btn").toggleClass("blocked", uiLocked); if(uiLocked) { $(".lock-ui").removeClass("hide"); @@ -430,7 +431,6 @@ define([ var isDocumentPanelShown = false; var isMenuPanelShown = false; core.onReady = function() { - if(viewerMode === true) { $('body').html(bodyViewerHTML); } @@ -509,6 +509,7 @@ define([ // UI layout createLayout(); + $editorElt = $("#wmd-input"); // Editor's textarea $("#wmd-input, #md-section-helper").css({ @@ -519,15 +520,11 @@ define([ }); // Handle tab key - $("#wmd-input").keydown(function(e) { + $editorElt.keydown(function(e) { if(e.keyCode === 9) { - var value = $(this).val(); + var value = $editorElt.val(); var start = this.selectionStart; var end = this.selectionEnd; - // IE8 does not support selection attributes - if(start === undefined || end === undefined) { - return; - } $(this).val(value.substring(0, start) + "\t" + value.substring(end)); this.selectionStart = this.selectionEnd = start + 1; e.preventDefault(); @@ -570,7 +567,7 @@ define([ }).on('hidden.bs.modal', function() { // Focus on the editor when modal is gone isModalShown = false; - $("#wmd-input").focus(); + $editorElt.focus(); }).keyup(function(e) { // Handle enter key in modals if(e.which == 13 && !$(e.target).is("textarea")) { diff --git a/js/extensions/documentPanel.js b/js/extensions/documentPanel.js index c3b65968..fa9c9c71 100644 --- a/js/extensions/documentPanel.js +++ b/js/extensions/documentPanel.js @@ -173,7 +173,7 @@ define([ filterFiles(''); // Scroll to the active file - panelContentElt.scrollTop += documentListElt.querySelector('.file.active').getBoundingClientRect().top - 100; + panelContentElt.scrollTop += documentListElt.querySelector('.file.active').getBoundingClientRect().top - 120; } }); diff --git a/js/extensions/documentSelector.js b/js/extensions/documentSelector.js index 490835be..de11cfe8 100644 --- a/js/extensions/documentSelector.js +++ b/js/extensions/documentSelector.js @@ -1,12 +1,13 @@ define([ "jquery", "underscore", + "crel", "utils", "classes/Extension", "mousetrap", "fileSystem", "text!html/documentSelectorSettingsBlock.html", -], function($, _, utils, Extension, mousetrap, fileSystem, documentSelectorSettingsBlockHTML) { +], function($, _, crel, utils, Extension, mousetrap, fileSystem, documentSelectorSettingsBlockHTML) { var documentSelector = new Extension("documentSelector", 'Document Selector'); documentSelector.settingsBlock = documentSelectorSettingsBlockHTML; @@ -33,33 +34,45 @@ define([ fileMgr = fileMgrParameter; }; + var liEltTmpl = [ + '