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
# Fri May 24 00:37:11 GMT 2013
# Thu May 30 00:04:52 GMT 2013
CACHE:
index.html

34
css/main-min.css vendored
View File

@ -5500,6 +5500,27 @@ input[readonly], select[readonly], textarea[readonly] {
.btn-group {
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 {
padding-right: 12px;
padding-left: 12px;
@ -5602,17 +5623,20 @@ hr {
}
div.dropdown-menu {
padding: 5px 20px;
white-space: normal;
}
div.dropdown-menu p,
div.dropdown-menu blockquote {
margin: 10px 0;
}
div.dropdown-menu .stat {
margin-bottom: 10px;
}
div.dropdown-menu i {
margin-right: 0;
}
#link-container {
min-width: 210px;
white-space: normal;
}
#link-container .link-list {
margin-top: 10px;
@ -5624,6 +5648,9 @@ div.dropdown-menu i {
width: 15px;
background-position: -384px -168px;
}
.icon-stat {
background-position: -1px -168px;
}
.icon-numbered-list {
background-position: -408px -168px;
}
@ -5687,7 +5714,7 @@ div.dropdown-menu i {
width: 43px;
height: 11px;
background-position: 0 0;
margin: 14px 15px 0;
margin: 16px 16px 0;
}
.working-indicator.show {
background-image: url(../img/ajax-loader.gif) !important;
@ -5755,6 +5782,9 @@ div.dropdown-menu i {
#modal-settings .accordion-inner .form-horizontal .control-label {
text-align: left;
}
#modal-settings .accordion-inner .form-inline .label-text {
margin: 0 10px;
}
.accordion-toggle {
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="msvalidate.01" content="5E47EE6F67B069C17E3CDD418351A612" />
<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 = "";
if (location.search.indexOf("debug") === -1) {
if (!location.search.match(/(\?|&)debug/)) {
suffix = "-min";
}
document.write('<link href="css/main' + suffix + '.css" rel="stylesheet">');
@ -604,7 +604,7 @@
<div class="tab-pane" id="tabpane-settings-extensions">
<div class="accordion" id="accordion-extensions"></div>
<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>
</div>
<div class="tab-pane" id="tabpane-settings-utils">

View File

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

View File

@ -54,6 +54,11 @@ define([
buildSelector();
}
$("#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");
};

View File

@ -9,7 +9,7 @@ define([
extensionId: "notifications",
extensionName: "Notifications",
defaultConfig: {
timeout: 5000
timeout: 8000
},
settingsBloc: [
'<p>Shows notification messages in the bottom-right corner of the screen.</p>',
@ -41,24 +41,24 @@ define([
jGrowl.defaults.position = 'bottom-right';
};
function showMessage(msg, iconClass, options) {
if(!msg) {
function showMessage(message, iconClass, options) {
logger.log(message);
if(!message) {
return;
}
var endOfMsg = msg.indexOf("|");
var endOfMsg = message.indexOf("|");
if(endOfMsg !== -1) {
msg = msg.substring(0, endOfMsg);
if(!msg) {
message = message.substring(0, endOfMsg);
if(!message) {
return;
}
}
options = options || {};
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) {
logger.log(message);
showMessage(message);
};
@ -87,9 +87,6 @@ define([
};
notifications.onSyncImportSuccess = function(fileDescList, provider) {
if(!fileDescList) {
return;
}
var titles = _.map(fileDescList, function(fileDesc) {
return fileDesc.title;
}).join(", ");
@ -108,7 +105,7 @@ define([
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 + '.');
};

View File

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

View File

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

View File

@ -52,7 +52,9 @@ define([
fileMgr.selectFile(fileDesc);
fileDescList.push(fileDesc);
});
if(fileDescList.length !== 0) {
extensionMgr.onSyncImportSuccess(fileDescList, gdriveProvider);
}
});
});
}
@ -68,7 +70,7 @@ define([
var syncIndex = createSyncIndex(id);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) {
extensionMgr.onError('"' + fileDesc.title + '" was already imported');
extensionMgr.onError('"' + fileDesc.title + '" was already imported.');
return;
}
importIds.push(id);
@ -98,7 +100,7 @@ define([
var syncIndex = createSyncIndex(id);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
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);
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() {}
};
// Use http://.../?console to print logs in the console
if (location.search.indexOf("console") !== -1) {
if (location.search.match(/(\?|&)console/)) {
logger = console;
}

View File

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

View File

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

View File

@ -7,7 +7,7 @@ input[disabled],
select[disabled],
textarea[disabled],
.input-prepend .add-on {
background-color: #f1f2f7;
background-color: #f1f2f6;
}
.navbar-inner {
@ -44,6 +44,11 @@ textarea[disabled],
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:focus,
.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 {
color: #fff;
background-color: #222;
border-color: #222;
background-color: #333;
border-color: #333;
border-bottom-color: transparent;
}
@ -189,12 +189,12 @@ input[type="color"]:focus,
.nav > li > a:hover,
.nav > li > a:focus {
background-color: #333;
background-color: #222;
}
.nav-tabs > li > a:hover,
.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 {

View File

@ -11,9 +11,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="msvalidate.01" content="5E47EE6F67B069C17E3CDD418351A612" />
<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 = "";
if (location.search.indexOf("debug") === -1) {
if (!location.search.match(/(\?|&)debug/)) {
suffix = "-min";
}
document.write('<link href="css/main' + suffix + '.css" rel="stylesheet">');