Prepare deployment

This commit is contained in:
benweet 2013-05-30 00:04:52 +01:00
parent 510f42f2d0
commit 452e3ae27f
19 changed files with 467 additions and 432 deletions

View File

@ -1,4 +0,0 @@
<?xml version="1.0"?>
<users>
<user>5E47EE6F67B069C17E3CDD418351A612</user>
</users>

View File

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
# Fri May 24 00:37:11 GMT 2013 # Thu May 30 00:04:52 GMT 2013
CACHE: CACHE:
index.html index.html

34
css/main-min.css vendored
View File

@ -5500,6 +5500,27 @@ input[readonly], select[readonly], textarea[readonly] {
.btn-group { .btn-group {
margin-right: 10px; margin-right: 10px;
} }
#extension-buttons {
margin-right: 15px;
}
#extension-buttons > .btn-group {
margin: 5px 0 0;
}
#extension-buttons > .btn-group > .btn {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
#extension-buttons > .btn-group:first-child > .btn {
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
#extension-buttons > .btn-group:last-child > .btn {
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
.btn-group > .btn + .dropdown-toggle { .btn-group > .btn + .dropdown-toggle {
padding-right: 12px; padding-right: 12px;
padding-left: 12px; padding-left: 12px;
@ -5602,17 +5623,20 @@ hr {
} }
div.dropdown-menu { div.dropdown-menu {
padding: 5px 20px; padding: 5px 20px;
white-space: normal;
} }
div.dropdown-menu p, div.dropdown-menu p,
div.dropdown-menu blockquote { div.dropdown-menu blockquote {
margin: 10px 0; margin: 10px 0;
} }
div.dropdown-menu .stat {
margin-bottom: 10px;
}
div.dropdown-menu i { div.dropdown-menu i {
margin-right: 0; margin-right: 0;
} }
#link-container { #link-container {
min-width: 210px; min-width: 210px;
white-space: normal;
} }
#link-container .link-list { #link-container .link-list {
margin-top: 10px; margin-top: 10px;
@ -5624,6 +5648,9 @@ div.dropdown-menu i {
width: 15px; width: 15px;
background-position: -384px -168px; background-position: -384px -168px;
} }
.icon-stat {
background-position: -1px -168px;
}
.icon-numbered-list { .icon-numbered-list {
background-position: -408px -168px; background-position: -408px -168px;
} }
@ -5687,7 +5714,7 @@ div.dropdown-menu i {
width: 43px; width: 43px;
height: 11px; height: 11px;
background-position: 0 0; background-position: 0 0;
margin: 14px 15px 0; margin: 16px 16px 0;
} }
.working-indicator.show { .working-indicator.show {
background-image: url(../img/ajax-loader.gif) !important; background-image: url(../img/ajax-loader.gif) !important;
@ -5755,6 +5782,9 @@ div.dropdown-menu i {
#modal-settings .accordion-inner .form-horizontal .control-label { #modal-settings .accordion-inner .form-horizontal .control-label {
text-align: left; text-align: left;
} }
#modal-settings .accordion-inner .form-inline .label-text {
margin: 0 10px;
}
.accordion-toggle { .accordion-toggle {
cursor: help; cursor: help;
} }

View File

@ -1 +0,0 @@
google-site-verification: google4971b5a4d775691a.html

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -11,9 +11,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="msvalidate.01" content="5E47EE6F67B069C17E3CDD418351A612" /> <meta name="msvalidate.01" content="5E47EE6F67B069C17E3CDD418351A612" />
<script> <script>
// Use http://.../?debug to serve original CSS/JavaScript files for debugging instead of minified // Use http://.../?debug to serve original CSS/JavaScript files instead of minified
var suffix = ""; var suffix = "";
if (location.search.indexOf("debug") === -1) { if (!location.search.match(/(\?|&)debug/)) {
suffix = "-min"; suffix = "-min";
} }
document.write('<link href="css/main' + suffix + '.css" rel="stylesheet">'); document.write('<link href="css/main' + suffix + '.css" rel="stylesheet">');
@ -604,7 +604,7 @@
<div class="tab-pane" id="tabpane-settings-extensions"> <div class="tab-pane" id="tabpane-settings-extensions">
<div class="accordion" id="accordion-extensions"></div> <div class="accordion" id="accordion-extensions"></div>
<span class="help-block pull-right"><a target="_blank" <span class="help-block pull-right"><a target="_blank"
href="https://github.com/benweet/stackedit/blob/master/doc/theming.md#stackedit-theming-guide">Create href="https://github.com/benweet/stackedit/blob/master/doc/developer-guide.md#architecture">Create
your own extension...</a></span> your own extension...</a></span>
</div> </div>
<div class="tab-pane" id="tabpane-settings-utils"> <div class="tab-pane" id="tabpane-settings-utils">

View File

@ -61,7 +61,9 @@ define([
fileMgr.selectFile(fileDesc); fileMgr.selectFile(fileDesc);
fileDescList.push(fileDesc); fileDescList.push(fileDesc);
}); });
if(fileDescList.length !== 0) {
extensionMgr.onSyncImportSuccess(fileDescList, dropboxProvider); extensionMgr.onSyncImportSuccess(fileDescList, dropboxProvider);
}
}); });
}); });
} }
@ -76,7 +78,7 @@ define([
var syncIndex = createSyncIndex(path); var syncIndex = createSyncIndex(path);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex); var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) { if(fileDesc !== undefined) {
extensionMgr.onError('"' + fileDesc.title + '" was already imported'); extensionMgr.onError('"' + fileDesc.title + '" was already imported.');
return; return;
} }
importPaths.push(path); importPaths.push(path);
@ -96,7 +98,7 @@ define([
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex); var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) { if(fileDesc !== undefined) {
var existingTitle = fileDesc.title; var existingTitle = fileDesc.title;
extensionMgr.onError('File path is already synchronized with "' + existingTitle + '"'); extensionMgr.onError('File path is already synchronized with "' + existingTitle + '".');
callback(true); callback(true);
return; return;
} }

View File

@ -54,6 +54,11 @@ define([
buildSelector(); buildSelector();
} }
$("#file-selector li:not(.stick)").removeClass("disabled"); $("#file-selector li:not(.stick)").removeClass("disabled");
var li = liMap[fileDesc.fileIndex];
if(li === undefined) {
// It means that we are showing a temporary file (not in the selector)
return;
}
liMap[fileDesc.fileIndex].addClass("disabled"); liMap[fileDesc.fileIndex].addClass("disabled");
}; };

View File

@ -9,7 +9,7 @@ define([
extensionId: "notifications", extensionId: "notifications",
extensionName: "Notifications", extensionName: "Notifications",
defaultConfig: { defaultConfig: {
timeout: 5000 timeout: 8000
}, },
settingsBloc: [ settingsBloc: [
'<p>Shows notification messages in the bottom-right corner of the screen.</p>', '<p>Shows notification messages in the bottom-right corner of the screen.</p>',
@ -41,24 +41,24 @@ define([
jGrowl.defaults.position = 'bottom-right'; jGrowl.defaults.position = 'bottom-right';
}; };
function showMessage(msg, iconClass, options) { function showMessage(message, iconClass, options) {
if(!msg) { logger.log(message);
if(!message) {
return; return;
} }
var endOfMsg = msg.indexOf("|"); var endOfMsg = message.indexOf("|");
if(endOfMsg !== -1) { if(endOfMsg !== -1) {
msg = msg.substring(0, endOfMsg); message = message.substring(0, endOfMsg);
if(!msg) { if(!message) {
return; return;
} }
} }
options = options || {}; options = options || {};
iconClass = iconClass || "icon-info-sign"; iconClass = iconClass || "icon-info-sign";
jGrowl("<i class='icon-white " + iconClass + "'></i> " + _.escape(msg), options); jGrowl("<i class='icon-white " + iconClass + "'></i> " + _.escape(message), options);
} }
notifications.onMessage = function(message) { notifications.onMessage = function(message) {
logger.log(message);
showMessage(message); showMessage(message);
}; };
@ -87,9 +87,6 @@ define([
}; };
notifications.onSyncImportSuccess = function(fileDescList, provider) { notifications.onSyncImportSuccess = function(fileDescList, provider) {
if(!fileDescList) {
return;
}
var titles = _.map(fileDescList, function(fileDesc) { var titles = _.map(fileDescList, function(fileDesc) {
return fileDesc.title; return fileDesc.title;
}).join(", "); }).join(", ");
@ -108,7 +105,7 @@ define([
showMessage('"' + fileDesc.title + '" successfully published.'); showMessage('"' + fileDesc.title + '" successfully published.');
}; };
notifications.onNewPublishSuccess = function(fileDesc, publishIndex, publishAttributes) { notifications.onNewPublishSuccess = function(fileDesc, publishAttributes) {
showMessage('"' + fileDesc.title + '" is now published on ' + publishAttributes.provider.providerName + '.'); showMessage('"' + fileDesc.title + '" is now published on ' + publishAttributes.provider.providerName + '.');
}; };

View File

@ -94,15 +94,15 @@ define([
}); });
// apply Scroll Link // apply Scroll Link
lastEditorScrollTop = -9; lastEditorScrollTop = -10;
skipScrollLink = false; skipScrollLink = false;
isScrollPreview = false; isScrollPreview = false;
runScrollLink(); runScrollLink();
}, 500); }, 500);
// -9 is less than -5 // -10 to be sure the gap is > 9
var lastEditorScrollTop = -9; var lastEditorScrollTop = -10;
var lastPreviewScrollTop = -9; var lastPreviewScrollTop = -10;
var skipScrollLink = false; var skipScrollLink = false;
var isScrollPreview = false; var isScrollPreview = false;
var runScrollLink = _.debounce(function() { var runScrollLink = _.debounce(function() {
@ -122,7 +122,7 @@ define([
}); });
if(srcSection === undefined) { if(srcSection === undefined) {
// Something wrong in the algorithm... // Something wrong in the algorithm...
return -9; return -10;
} }
var posInSection = (srcScrollTop - srcSection.startOffset) / srcSection.height; var posInSection = (srcScrollTop - srcSection.startOffset) / srcSection.height;
var destSection = destSectionList[sectionIndex]; var destSection = destSectionList[sectionIndex];
@ -131,7 +131,7 @@ define([
destScrollTop, destScrollTop,
destElt.prop('scrollHeight') - destElt.outerHeight() destElt.prop('scrollHeight') - destElt.outerHeight()
]); ]);
if(Math.abs(destScrollTop - lastDestScrollTop) < 5) { if(Math.abs(destScrollTop - lastDestScrollTop) < 9) {
// Skip the animation in case it's not necessary // Skip the animation in case it's not necessary
return; return;
} }
@ -141,15 +141,15 @@ define([
callback(destScrollTop); callback(destScrollTop);
}); });
} }
// Perform the animation if diff > 5px // Perform the animation if diff > 9px
if(isScrollPreview === false && Math.abs(editorScrollTop - lastEditorScrollTop) > 5) { if(isScrollPreview === false && Math.abs(editorScrollTop - lastEditorScrollTop) > 9) {
// Animate the preview // Animate the preview
lastEditorScrollTop = editorScrollTop; lastEditorScrollTop = editorScrollTop;
animate(editorScrollTop, mdSectionList, previewElt, htmlSectionList, lastPreviewScrollTop, function(destScrollTop) { animate(editorScrollTop, mdSectionList, previewElt, htmlSectionList, lastPreviewScrollTop, function(destScrollTop) {
lastPreviewScrollTop = destScrollTop; lastPreviewScrollTop = destScrollTop;
}); });
} }
else if(Math.abs(previewScrollTop - lastPreviewScrollTop) > 5) { else if(Math.abs(previewScrollTop - lastPreviewScrollTop) > 9) {
// Animate the editor // Animate the editor
lastPreviewScrollTop = previewScrollTop; lastPreviewScrollTop = previewScrollTop;
animate(previewScrollTop, htmlSectionList, editorElt, mdSectionList, lastEditorScrollTop, function(destScrollTop) { animate(previewScrollTop, htmlSectionList, editorElt, mdSectionList, lastEditorScrollTop, function(destScrollTop) {
@ -188,11 +188,11 @@ define([
} }
_.defer(function() { _.defer(function() {
// Modify scroll position of the preview not the editor // Modify scroll position of the preview not the editor
lastEditorScrollTop = -9; lastEditorScrollTop = -10;
buildSections(); buildSections();
// Preview may change if images are loading // Preview may change if images are loading
$("#wmd-preview img").load(function() { $("#wmd-preview img").load(function() {
lastEditorScrollTop = -9; lastEditorScrollTop = -10;
buildSections(); buildSections();
}); });
}); });

View File

@ -146,6 +146,11 @@ define([
fileMgr.deleteFile = function(fileDesc) { fileMgr.deleteFile = function(fileDesc) {
fileDesc = fileDesc || fileMgr.getCurrentFile(); fileDesc = fileDesc || fileMgr.getCurrentFile();
// Remove the index from the file list
localStorage["file.list"] = localStorage["file.list"].replace(";" + fileDesc.fileIndex + ";", ";");
delete fileSystem[fileDesc.fileIndex];
if(fileMgr.isCurrentFile(fileDesc) === true) { if(fileMgr.isCurrentFile(fileDesc) === true) {
// Unset the current fileDesc // Unset the current fileDesc
fileMgr.setCurrentFile(); fileMgr.setCurrentFile();
@ -163,16 +168,11 @@ define([
fileMgr.removePublish(publishAttributes, true); fileMgr.removePublish(publishAttributes, true);
}); });
// Remove the index from the file list localStorage.removeItem(fileDesc.fileIndex + ".title");
var fileIndex = fileDesc.fileIndex; localStorage.removeItem(fileDesc.fileIndex + ".content");
localStorage["file.list"] = localStorage["file.list"].replace(";" + fileIndex + ";", ";"); localStorage.removeItem(fileDesc.fileIndex + ".sync");
localStorage.removeItem(fileDesc.fileIndex + ".publish");
localStorage.removeItem(fileIndex + ".title");
localStorage.removeItem(fileIndex + ".content");
localStorage.removeItem(fileIndex + ".sync");
localStorage.removeItem(fileIndex + ".publish");
fileSystem.removeItem(fileIndex);
extensionMgr.onFileDeleted(fileDesc); extensionMgr.onFileDeleted(fileDesc);
}; };
@ -198,7 +198,7 @@ define([
} }
// Remove sync attributes // Remove sync attributes
localStorage.removeItem(syncAttributes.syncIndex); localStorage.removeItem(syncAttributes.syncIndex);
fileDesc.syncLocations.removeItem(syncAttributes.syncIndex); delete fileDesc.syncLocations[syncAttributes.syncIndex];
if(!skipExtensions) { if(!skipExtensions) {
extensionMgr.onSyncRemoved(fileDesc, syncAttributes); extensionMgr.onSyncRemoved(fileDesc, syncAttributes);
} }
@ -241,7 +241,7 @@ define([
} }
// Remove publish attributes // Remove publish attributes
localStorage.removeItem(publishAttributes.publishIndex); localStorage.removeItem(publishAttributes.publishIndex);
fileDesc.publishLocations.removeItem(publishAttributes.publishIndex); delete fileDesc.publishLocations[publishAttributes.publishIndex];
if(!skipExtensions) { if(!skipExtensions) {
extensionMgr.onPublishRemoved(fileDesc, publishAttributes); extensionMgr.onPublishRemoved(fileDesc, publishAttributes);
} }

View File

@ -52,7 +52,9 @@ define([
fileMgr.selectFile(fileDesc); fileMgr.selectFile(fileDesc);
fileDescList.push(fileDesc); fileDescList.push(fileDesc);
}); });
if(fileDescList.length !== 0) {
extensionMgr.onSyncImportSuccess(fileDescList, gdriveProvider); extensionMgr.onSyncImportSuccess(fileDescList, gdriveProvider);
}
}); });
}); });
} }
@ -68,7 +70,7 @@ define([
var syncIndex = createSyncIndex(id); var syncIndex = createSyncIndex(id);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex); var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) { if(fileDesc !== undefined) {
extensionMgr.onError('"' + fileDesc.title + '" was already imported'); extensionMgr.onError('"' + fileDesc.title + '" was already imported.');
return; return;
} }
importIds.push(id); importIds.push(id);
@ -98,7 +100,7 @@ define([
var syncIndex = createSyncIndex(id); var syncIndex = createSyncIndex(id);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex); var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) { if(fileDesc !== undefined) {
extensionMgr.onError('File ID is already synchronized with "' + fileDesc.title + '"'); extensionMgr.onError('File ID is already synchronized with "' + fileDesc.title + '".');
callback(true); callback(true);
return; return;
} }

2
js/main-min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@ var logger = {
error: function() {} error: function() {}
}; };
// Use http://.../?console to print logs in the console // Use http://.../?console to print logs in the console
if (location.search.indexOf("console") !== -1) { if (location.search.match(/(\?|&)console/)) {
logger = console; logger = console;
} }

View File

@ -178,7 +178,7 @@ define([
var content = getPublishContent(publishAttributes); var content = getPublishContent(publishAttributes);
provider.publish(publishAttributes, title, content, function(error) { provider.publish(publishAttributes, title, content, function(error) {
if(error === undefined) { if(error === undefined) {
publishAttributes.provider = provider.providerId; publishAttributes.provider = provider;
sharing.createLink(publishAttributes, function() { sharing.createLink(publishAttributes, function() {
createPublishIndex(fileDesc, publishAttributes); createPublishIndex(fileDesc, publishAttributes);
}); });

View File

@ -4,7 +4,6 @@ define([
"core", "core",
"utils", "utils",
"extension-manager", "extension-manager",
"file-system",
"file-manager", "file-manager",
"async-runner", "async-runner",
"download-provider", "download-provider",

View File

@ -7,7 +7,7 @@ input[disabled],
select[disabled], select[disabled],
textarea[disabled], textarea[disabled],
.input-prepend .add-on { .input-prepend .add-on {
background-color: #f1f2f7; background-color: #f1f2f6;
} }
.navbar-inner { .navbar-inner {
@ -44,6 +44,11 @@ textarea[disabled],
color: #64656b; color: #64656b;
} }
.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
background-color: #8e929a;
border-color: #8e929a;
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus, .dropdown-menu > li > a:focus,
.dropdown-submenu:hover > a, .dropdown-submenu:hover > a,

View File

@ -178,8 +178,8 @@ input[type="color"]:focus,
.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus { .nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
color: #fff; color: #fff;
background-color: #222; background-color: #333;
border-color: #222; border-color: #333;
border-bottom-color: transparent; border-bottom-color: transparent;
} }
@ -189,12 +189,12 @@ input[type="color"]:focus,
.nav > li > a:hover, .nav > li > a:hover,
.nav > li > a:focus { .nav > li > a:focus {
background-color: #333; background-color: #222;
} }
.nav-tabs > li > a:hover, .nav-tabs > li > a:hover,
.nav-tabs > li > a:focus { .nav-tabs > li > a:focus {
border-color: #333 #333 #222; border-color: #222 #222 #222;
} }
.nav .dropdown-toggle .caret, .nav .dropdown-toggle:hover .caret, .nav .dropdown-toggle:focus .caret { .nav .dropdown-toggle .caret, .nav .dropdown-toggle:hover .caret, .nav .dropdown-toggle:focus .caret {

View File

@ -11,9 +11,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="msvalidate.01" content="5E47EE6F67B069C17E3CDD418351A612" /> <meta name="msvalidate.01" content="5E47EE6F67B069C17E3CDD418351A612" />
<script> <script>
// Use http://.../?debug to serve original CSS/JavaScript files for debugging instead of minified // Use http://.../?debug to serve original CSS/JavaScript files instead of minified
var suffix = ""; var suffix = "";
if (location.search.indexOf("debug") === -1) { if (!location.search.match(/(\?|&)debug/)) {
suffix = "-min"; suffix = "-min";
} }
document.write('<link href="css/main' + suffix + '.css" rel="stylesheet">'); document.write('<link href="css/main' + suffix + '.css" rel="stylesheet">');