From 498ec93a8c761d073e1bf7c47ac8a5f9c0694a6c Mon Sep 17 00:00:00 2001 From: benweet Date: Mon, 13 Jan 2014 01:39:28 +0000 Subject: [PATCH] Prepare release --- public/index.html | 2 +- public/res/core.js | 3 +++ public/res/extensions/documentManager.js | 28 +++++++++++++++------ public/res/extensions/documentTitle.js | 2 +- public/res/extensions/scrollLink.js | 15 ++++++----- public/res/extensions/welcomeTour.js | 2 +- public/res/libs/ace_mode_highlight_rules.js | 4 ++- public/res/settings.js | 8 ++---- public/res/storage.js | 10 ++++++++ public/res/styles/base.less | 24 +++++++++--------- 10 files changed, 62 insertions(+), 36 deletions(-) diff --git a/public/index.html b/public/index.html index 49221e33..b613cc92 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ - StackEdit — *smart* markdown editor + StackEdit – *smart* markdown editor diff --git a/public/res/core.js b/public/res/core.js index 46362773..9f42f89b 100644 --- a/public/res/core.js +++ b/public/res/core.js @@ -967,6 +967,9 @@ define([ $(".action-default-settings").click(function() { storage.removeItem("settings"); storage.removeItem("theme"); + if(!settings.dropboxFullAccess) { + storage.removeItem('dropbox.lastChangeId'); + } window.location.reload(); }); diff --git a/public/res/extensions/documentManager.js b/public/res/extensions/documentManager.js index 15ffd415..0c21056e 100644 --- a/public/res/extensions/documentManager.js +++ b/public/res/extensions/documentManager.js @@ -282,19 +282,24 @@ define([ // Set checkbox event listeners $(documentListElt.querySelectorAll('[type=checkbox]')).change(doActiveButtons); - // Open root folder by default - $(documentListElt.querySelectorAll('.root-folder')).click(); }, 50); - + documentManager.onFileCreated = refreshManager; documentManager.onFileDeleted = refreshManager; - documentManager.onTitleChanged = refreshManager; documentManager.onSyncExportSuccess = refreshManager; documentManager.onSyncRemoved = refreshManager; documentManager.onNewPublishSuccess = refreshManager; documentManager.onPublishRemoved = refreshManager; documentManager.onFoldersChanged = refreshManager; + documentManager.onTitleChanged = function(fileDesc) { + if(isVisible === false) { + return; + } + $(documentListElt).find('[data-file-index="' + fileDesc.fileIndex + '"] .name').html(fileDesc.composeTitle()).removeClass('hide'); + $(documentListElt.querySelectorAll('.input-rename')).addClass('hide'); + }; + documentManager.onReady = function() { modalElt = document.querySelector('.modal-document-manager'); documentListElt = modalElt.querySelector('.list-group.document-list'); @@ -307,8 +312,13 @@ define([ $(modalElt).on('show.bs.modal', function() { isVisible = true; refreshManager(); + // Open root folder + setTimeout(function() { + $(documentListElt.querySelectorAll('.root-folder')).click(); + }, 250); }).on('hide.bs.modal', function() { isVisible = false; + documentListElt.innerHTML = ''; }); // Create folder action @@ -329,16 +339,18 @@ define([ eventMgr.onFoldersChanged(); // Edit the name when folder has just been created - var renameButtonElt = $(modalElt.querySelector('[data-folder-index="' + folderIndex + '"] .button-rename')).click(); - modalElt.scrollTop += renameButtonElt.offset().top - 50; + setTimeout(function() { + var renameButtonElt = $(modalElt.querySelector('[data-folder-index="' + folderIndex + '"] .button-rename')).click(); + modalElt.scrollTop += renameButtonElt.offset().top - 50; + }, 60); }); // Selection dropdown menu actions $(modalElt.querySelectorAll('.action-select-all')).click(function() { - $(documentListElt.querySelectorAll('input[type="checkbox"]')).prop('checked', true); + $(documentListElt.querySelectorAll('input[type="checkbox"]')).prop('checked', true).change(); }); $(modalElt.querySelectorAll('.action-unselect-all')).click(function() { - $(documentListElt.querySelectorAll('input[type="checkbox"]')).prop('checked', false); + $(documentListElt.querySelectorAll('input[type="checkbox"]')).prop('checked', false).change(); }); // Delete selection actions diff --git a/public/res/extensions/documentTitle.js b/public/res/extensions/documentTitle.js index 00ef291d..c58e5513 100644 --- a/public/res/extensions/documentTitle.js +++ b/public/res/extensions/documentTitle.js @@ -19,7 +19,7 @@ define([ } var title = fileDesc.title; - document.title = "StackEdit — " + title; + document.title = "StackEdit – " + title; $fileTitleNavbar.html(fileDesc.composeTitle()); $(".file-title").text(title); $(".input-file-title").val(title); diff --git a/public/res/extensions/scrollLink.js b/public/res/extensions/scrollLink.js index edfe2f56..32bc39b3 100644 --- a/public/res/extensions/scrollLink.js +++ b/public/res/extensions/scrollLink.js @@ -183,11 +183,12 @@ define([ lastPreviewScrollTop = previewScrollTop; return; } - $previewElt.stop(true).animate({ + $previewElt.stop('scrollLinkFx', true).animate({ scrollTop: destScrollTop }, { easing: 'easeOutSine', duration: 200, + queue: 'scrollLinkFx', step: function(now) { isPreviewMoving = true; lastPreviewScrollTop = previewScrollTop + now; @@ -197,7 +198,7 @@ define([ isPreviewMoving = false; }); }, - }); + }).dequeue('scrollLinkFx'); } else if(isScrollPreview === true) { if(Math.abs(previewScrollTop - lastPreviewScrollTop) <= 9) { @@ -227,11 +228,12 @@ define([ return; } if(window.lightMode) { - $textareaElt.stop(true).animate({ + $textareaElt.stop('scrollLinkFx', true).animate({ scrollTop: destScrollTop }, { easing: 'easeOutSine', duration: 200, + queue: 'scrollLinkFx', step: function(now) { isEditorMoving = true; lastEditorScrollTop = editorScrollTop + now; @@ -241,14 +243,15 @@ define([ isEditorMoving = false; }); }, - }); + }).dequeue('scrollLinkFx'); } else { - scrollingHelper.stop(true).css('value', 0).animate({ + scrollingHelper.stop('scrollLinkFx', true).css('value', 0).animate({ value: destScrollTop - editorScrollTop }, { easing: 'easeOutSine', duration: 200, + queue: 'scrollLinkFx', step: function(now) { isEditorMoving = true; lastEditorScrollTop = editorScrollTop + now; @@ -259,7 +262,7 @@ define([ isEditorMoving = false; }); }, - }); + }).dequeue('scrollLinkFx'); } } }, 100); diff --git a/public/res/extensions/welcomeTour.js b/public/res/extensions/welcomeTour.js index 7b5a360f..5c32e912 100644 --- a/public/res/extensions/welcomeTour.js +++ b/public/res/extensions/welcomeTour.js @@ -33,7 +33,7 @@ define([ }); setTimeout(function() { tooltip.tooltip('hide').removeClass('info-tooltip'); - }, 30000); + }, 15000); }, template: [ '
', diff --git a/public/res/libs/ace_mode_highlight_rules.js b/public/res/libs/ace_mode_highlight_rules.js index 1dbd3882..ff35cc1e 100644 --- a/public/res/libs/ace_mode_highlight_rules.js +++ b/public/res/libs/ace_mode_highlight_rules.js @@ -51,7 +51,9 @@ var MarkdownHighlightRules = function() { token: "markup.heading.multi.2", regex: "^\\-+(?=\\s*$)" }, { - token : "constant.language.escape", + token : function(value) { + return "markup.heading." + value.length; + }, regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, next : "header" }, diff --git a/public/res/settings.js b/public/res/settings.js index 4f681b47..beca3d36 100644 --- a/public/res/settings.js +++ b/public/res/settings.js @@ -38,15 +38,11 @@ define([ '\n', '\n', '<%= documentTitle %>\n', - '\n', + '\n', '\n', - '\n', + '\n', '\n', '<%= documentHTML %>\n', '' diff --git a/public/res/storage.js b/public/res/storage.js index 68514031..8a6c9a6f 100644 --- a/public/res/storage.js +++ b/public/res/storage.js @@ -250,6 +250,16 @@ define([ version = "v16"; } + // Upgrade from v16 to v17 + if(version == "v16") { + if(_.has(localStorage, 'settings')) { + settings = JSON.parse(localStorage.settings); + settings.pdfTemplate && (settings.pdfTemplate = settings.pdfTemplate.replace(/https:\/\/stackedit.io/g, 'file:///app/stackedit/public')); + localStorage.settings = JSON.stringify(settings); + } + version = "v17"; + } + localStorage.version = version; return localStorage; }); \ No newline at end of file diff --git a/public/res/styles/base.less b/public/res/styles/base.less index 9bfe112f..2b7b1f7e 100644 --- a/public/res/styles/base.less +++ b/public/res/styles/base.less @@ -18,44 +18,44 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 300; - src: local('Open Sans Light'), local('OpenSans-Light'), url("../font/opensans-light-webfont.woff") format('woff'); + src: local('Open Sans Light'), local('OpenSans-Light'), url("../font/OpenSans-Light-webfont.woff") format('woff'); } @font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 400; - src: local('Open Sans'), local('OpenSans'), url("../font/opensans-regular-webfont.woff") format('woff'); + src: local('Open Sans'), local('OpenSans'), url("../font/OpenSans-Regular-webfont.woff") format('woff'); } @font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 700; - src: local('Open Sans Bold'), local('OpenSans-Bold'), url("../font/opensans-bold-webfont.woff") format('woff'); + src: local('Open Sans Bold'), local('OpenSans-Bold'), url("../font/OpenSans-Bold-webfont.woff") format('woff'); } @font-face { font-family: 'Open Sans'; font-style: italic; font-weight: 300; - src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url("../font/opensans-lightitalic-webfont.woff") format('woff'); + src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url("../font/OpenSans-LightItalic-webfont.woff") format('woff'); } @font-face { font-family: 'Open Sans'; font-style: italic; font-weight: 400; - src: local('Open Sans Italic'), local('OpenSans-Italic'), url("../font/opensans-italic-webfont.woff") format('woff'); + src: local('Open Sans Italic'), local('OpenSans-Italic'), url("../font/OpenSans-Italic-webfont.woff") format('woff'); } @font-face { font-family: 'Open Sans'; font-style: italic; font-weight: 700; - src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url("../font/opensans-bolditalic-webfont.woff") format('woff'); + src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url("../font/OpenSans-BoldItalic-webfont.woff") format('woff'); } @media screen and (-webkit-min-device-pixel-ratio:0) { @font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 300; - src: local('Open Sans Light'), local('OpenSans-Light'), url('../font/opensans-light-webfont.svg') format('svg'); + src: local('Open Sans Light'), local('OpenSans-Light'), url('../font/OpenSans-Light-webfont.svg') format('svg'); } } @media screen and (-webkit-min-device-pixel-ratio:0) { @@ -63,7 +63,7 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 400; - src: local('Open Sans'), local('OpenSans'), url('../font/opensans-regular-webfont.svg') format('svg'); + src: local('Open Sans'), local('OpenSans'), url('../font/OpenSans-Regular-webfont.svg') format('svg'); } } @media screen and (-webkit-min-device-pixel-ratio:0) { @@ -71,7 +71,7 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 700; - src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../font/opensans-bold-webfont.svg') format('svg'); + src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../font/OpenSans-Bold-webfont.svg') format('svg'); } } @media screen and (-webkit-min-device-pixel-ratio:0) { @@ -79,7 +79,7 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 300; - src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url('../font/opensans-lightitalic-webfont.svg') format('svg'); + src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url('../font/OpenSans-LightItalic-webfont.svg') format('svg'); } } @media screen and (-webkit-min-device-pixel-ratio:0) { @@ -87,7 +87,7 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 400; - src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../font/opensans-italic-webfont.svg') format('svg'); + src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../font/OpenSans-Italic-webfont.svg') format('svg'); } } @media screen and (-webkit-min-device-pixel-ratio:0) { @@ -95,7 +95,7 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 700; - src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url('../font/opensans-bolditalic-webfont.svg') format('svg'); + src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url('../font/OpenSans-BoldItalic-webfont.svg') format('svg'); } }