Customizable MIME type for Google Drive

This commit is contained in:
benweet 2014-04-22 00:20:46 +01:00
parent 5a1ea7c14f
commit c8dd5498c9
4 changed files with 22 additions and 3 deletions

View File

@ -123,6 +123,8 @@ define([
utils.setInputRadio("radio-settings-edit-mode", settings.editMode);
// Commit message
utils.setInputValue("#input-settings-publish-commit-msg", settings.commitMsg);
// Markdown MIME type
utils.setInputValue("#input-settings-markdown-mime-type", settings.markdownMimeType);
// Gdrive multi-accounts
utils.setInputValue("#input-settings-gdrive-multiaccount", settings.gdriveMultiAccount);
// Gdrive full access
@ -168,6 +170,8 @@ define([
newSettings.commitMsg = utils.getInputTextValue("#input-settings-publish-commit-msg", event);
// Gdrive multi-accounts
newSettings.gdriveMultiAccount = utils.getInputIntValue("#input-settings-gdrive-multiaccount");
// Markdown MIME type
newSettings.markdownMimeType = utils.getInputValue("#input-settings-markdown-mime-type");
// Gdrive full access
newSettings.gdriveFullAccess = utils.getInputChecked("#input-settings-gdrive-full-access");
// Drobox full access

View File

@ -233,7 +233,7 @@ define([
var boundary = '-------314159265358979323846';
var delimiter = "\r\n--" + boundary + "\r\n";
var close_delim = "\r\n--" + boundary + "--";
contentType = contentType || 'text/x-markdown';
contentType = contentType || settings.markdownMimeType;
var metadata = {
title: title,
mimeType: contentType
@ -768,6 +768,9 @@ define([
title: title,
content: content
};
if(publishDate) {
data.published = publishDate.toISOString();
}
var type = "POST";
// If it's an update
if(postId !== undefined) {

View File

@ -53,8 +53,8 @@
<pre id="wmd-input" class="ui-layout-center form-control"><div class="editor-content" contenteditable=true></div><div class="editor-margin"></div></pre>
<div class="preview-panel">
<div class="layout-resizer layout-resizer-preview"></div>
<div class="layout-toggler layout-toggler-navbar btn btn-info"><i class="icon-th"></i></div>
<div class="layout-toggler layout-toggler-preview btn btn-info"><i class="icon-none"></i></div>
<div class="layout-toggler layout-toggler-navbar btn btn-info" title="Toggle navigation bar"><i class="icon-th"></i></div>
<div class="layout-toggler layout-toggler-preview btn btn-info" title="Toggle preview"><i class="icon-none"></i></div>
<div class="preview-container">
<div id="preview-contents">
<div id="wmd-preview" class="preview-content"></div>
@ -1076,6 +1076,17 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="input-settings-markdown-mime-type">Markdown MIME type</a>
</label>
<div class="col-sm-7">
<select id="input-settings-markdown-mime-type" class="form-control">
<option value="text/plain">text/plain</option>
<option value="text/x-markdown">text/x-markdown</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Permissions</label>
<div class="col-sm-7">

View File

@ -14,6 +14,7 @@ define([
defaultContent: "\n\n\n> Written with [StackEdit](" + constants.MAIN_URL + ").",
commitMsg: "Published with " + constants.MAIN_URL,
conflictMode: 'merge',
markdownMimeType: 'text/x-markdown',
gdriveMultiAccount: 1,
gdriveFullAccess: true,
dropboxFullAccess: true,