diff --git a/css/main.css b/css/main.css
index dae5950f..f8dff3c6 100644
--- a/css/main.css
+++ b/css/main.css
@@ -332,7 +332,8 @@ hr {
}
#modal-settings textarea {
- height: 180px;
+ height: 80px;
+ max-width: 206px;
}
.tooltip-inner {
diff --git a/index.html b/index.html
index 539eee13..db2c1593 100644
--- a/index.html
+++ b/index.html
@@ -483,6 +483,15 @@
class="input-mini">px
+
+
+
+
+
+
diff --git a/js/core.js b/js/core.js
index 6730091e..0dd285fe 100644
--- a/js/core.js
+++ b/js/core.js
@@ -210,7 +210,8 @@ define(
layoutOrientation : "horizontal",
scrollLink : true,
editorFontSize : 14,
- commitMsg : "Published by StackEdit",
+ defaultContent: "\n\n\n> Written with [StackEdit](http://benweet.github.io/stackedit/).",
+ commitMsg : "Published by http://benweet.github.io/stackedit",
template : ['\n',
'\n',
'\n',
@@ -228,19 +229,16 @@ define(
// Layout orientation
$("input:radio[name=radio-layout-orientation][value="
+ core.settings.layoutOrientation + "]").prop("checked", true);
-
// Scroll Link
$("#input-settings-scroll-link").prop("checked", core.settings.scrollLink);
-
// Converter type
$("#input-settings-converter-type").val(core.settings.converterType);
-
// Editor font size
$("#input-settings-editor-font-size").val(core.settings.editorFontSize);
-
+ // Default content
+ $("#textarea-settings-default-content").val(core.settings.defaultContent);
// Commit message
$("#input-settings-publish-commit-msg").val(core.settings.commitMsg);
-
// Template
$("#textarea-settings-publish-template").val(core.settings.template);
};
@@ -251,19 +249,16 @@ define(
// Layout orientation
newSettings.layoutOrientation = $(
"input:radio[name=radio-layout-orientation]:checked").prop("value");
-
// Converter type
newSettings.converterType = $("#input-settings-converter-type").val();
-
// Scroll Link
newSettings.scrollLink = $("#input-settings-scroll-link").prop("checked");
-
// Editor font size
newSettings.editorFontSize = core.getInputIntValue($("#input-settings-editor-font-size"), event, 1, 99);
-
+ // Default content
+ newSettings.defaultContent = $("#textarea-settings-default-content").val();
// Commit message
newSettings.commitMsg = core.getInputValue($("#input-settings-publish-commit-msg"), event);
-
// Template
newSettings.template = core.getInputValue($("#textarea-settings-publish-template"), event);
@@ -917,6 +912,12 @@ define(
'Therefore, if your document does not contain any title, the mapping will be linear and consequently less efficient.',
].join("")
});
+ $(".tooltip-default-content").tooltip({
+ html: true,
+ container: '#modal-settings',
+ placement: 'right',
+ title: 'Thanks for supporting StackEdit by adding a backlink in your documents!'
+ });
$(".tooltip-template").tooltip({
html: true,
container: '#modal-settings',
diff --git a/js/file-manager.js b/js/file-manager.js
index 0305d770..320b4caf 100644
--- a/js/file-manager.js
+++ b/js/file-manager.js
@@ -49,7 +49,7 @@ define(["jquery", "core", "synchronizer", "publisher", "text!../WELCOME.md", "un
};
fileManager.createFile = function(title, content, syncIndexes) {
- content = content || "";
+ content = content || core.settings.defaultContent;
syncIndexes = syncIndexes || [];
if (!title) {
// Create a file title
@@ -135,13 +135,15 @@ define(["jquery", "core", "synchronizer", "publisher", "text!../WELCOME.md", "un
synchronizer.resetSyncFlags();
function composeTitle(fileIndex) {
- var result = " " + localStorage[fileIndex + ".title"];
+ var result = [];
var providerIdList = synchronizer.getSyncProvidersFromFile(fileIndex);
- providerIsList = _.extend(providerIdList, publisher.getPublishProvidersFromFile(fileIndex));
- _.each(providerIdList, function(providerId) {
- result = '' + result;
+ providerIdList = providerIdList.concat(publisher.getPublishProvidersFromFile(fileIndex));
+ _.each(providerIdList.sort(), function(providerId) {
+ result.push('');
});
- return result;
+ result.push(" ");
+ result.push(localStorage[fileIndex + ".title"]);
+ return result.join("");
}
// Update the file title
@@ -231,7 +233,7 @@ define(["jquery", "core", "synchronizer", "publisher", "text!../WELCOME.md", "un
});
$("#file-title").click(function() {
$(this).hide();
- $("#file-title-input").show().focus();
+ $("#file-title-input").show().focus().get(0).select();
});
function applyTitle(input) {
var title = $.trim(input.val());
diff --git a/js/publisher.js b/js/publisher.js
index 16fd52a6..1ef92961 100644
--- a/js/publisher.js
+++ b/js/publisher.js
@@ -210,10 +210,10 @@ define(["jquery", "core", "github-provider", "blogger-provider", "dropbox-provid
publisher.getPublishProvidersFromFile = function(fileIndex) {
var publishIndexList = _.compact(localStorage[fileIndex + ".publish"].split(";"));
- var providerIdList = {};
+ var providerIdList = [];
_.each(publishIndexList, function(publishIndex) {
var publishAttributes = JSON.parse(localStorage[publishIndex]);
- providerIdList[publishAttributes.provider] = publishAttributes.provider;
+ providerIdList.push(publishAttributes.provider);
});
return providerIdList;
};
diff --git a/js/synchronizer.js b/js/synchronizer.js
index 903883a6..bc6c7df0 100644
--- a/js/synchronizer.js
+++ b/js/synchronizer.js
@@ -225,13 +225,12 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
});
};
synchronizer.getSyncProvidersFromFile = function(fileIndex) {
- var sync = localStorage[fileIndex + ".sync"];
- var providerIdList = {};
- _.each(providerMap, function(provider) {
- if (sync.indexOf(";sync." + provider.providerId + ".") !== -1) {
- provider.useSync = true;
- providerIdList[provider.providerId] = provider.providerId;
- }
+ var syncIndexList = _.compact(localStorage[fileIndex + ".sync"].split(";"));
+ var providerIdList = [];
+ _.each(syncIndexList, function(syncIndex) {
+ var syncAttributes = JSON.parse(localStorage[syncIndex]);
+ providerIdList.push(syncAttributes.provider);
+ providerMap[syncAttributes.provider].useSync = true;
});
return providerIdList;
};
diff --git a/test.md b/test.md
deleted file mode 100644
index e6fd729d..00000000
--- a/test.md
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-> Written with [StackEdit](http://benweet.github.io/stackedit/).