diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/js/extra.js | 4 | ||||
-rw-r--r-- | public/js/lib/common/constant.ejs | 4 | ||||
-rw-r--r-- | public/vendor/inlineAttachment/inline-attachment.js | 13 | ||||
-rw-r--r-- | public/views/index/body.ejs | 12 |
4 files changed, 15 insertions, 18 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index ec7d39da..dbb0f458 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -713,11 +713,11 @@ $.fn.sortByDepth = function () { function toggleTodoEvent (e) { const startline = $(this).closest('li').attr('data-startline') - 1 const line = window.editor.getLine(startline) - const matches = line.match(/^[>\s]*[-+*]\s\[([x ])\]/) + const matches = line.match(/^[>\s-]*[-+*]\s\[([x ])\]/) if (matches && matches.length >= 2) { let checked = null if (matches[1] === 'x') { checked = true } else if (matches[1] === ' ') { checked = false } - const replacements = matches[0].match(/(^[>\s]*[-+*]\s\[)([x ])(\])/) + const replacements = matches[0].match(/(^[>\s-]*[-+*]\s\[)([x ])(\])/) window.editor.replaceRange(checked ? ' ' : 'x', { line: startline, ch: replacements[1].length diff --git a/public/js/lib/common/constant.ejs b/public/js/lib/common/constant.ejs index e4a1cf0a..c0963635 100644 --- a/public/js/lib/common/constant.ejs +++ b/public/js/lib/common/constant.ejs @@ -3,6 +3,8 @@ window.urlpath = '<%- urlpath %>' window.debug = <%- debug %> window.version = '<%- version %>' +window.allowedUploadMimeTypes = <%- JSON.stringify(allowedUploadMimeTypes) %> + window.GOOGLE_API_KEY = '<%- GOOGLE_API_KEY %>' window.GOOGLE_CLIENT_ID = '<%- GOOGLE_CLIENT_ID %>' -window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>'
\ No newline at end of file +window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>' diff --git a/public/vendor/inlineAttachment/inline-attachment.js b/public/vendor/inlineAttachment/inline-attachment.js index 0ffd3f9f..d9503d62 100644 --- a/public/vendor/inlineAttachment/inline-attachment.js +++ b/public/vendor/inlineAttachment/inline-attachment.js @@ -141,12 +141,7 @@ /** * Allowed MIME types */ - allowedTypes: [ - 'image/jpeg', - 'image/png', - 'image/jpg', - 'image/gif' - ], + allowedTypes: window.allowedUploadMimeTypes, /** * Text which will be inserted when dropping or pasting a file. @@ -304,7 +299,7 @@ if (this.settings.onFileUploadResponse.call(this, xhr) !== false) { var result = JSON.parse(xhr.responseText), filename = result[this.settings.jsonFieldName]; - + if (result && filename) { var replacements = []; var string = this.settings.progressText.replace(this.filenameTag, id); @@ -415,7 +410,7 @@ // <http://wiki.ecmascript.org/doku.php?id=strawman:names>. // // The goals of this function are twofold: -// +// // * Provide a way to generate a string guaranteed to be unique when compared // to other strings generated by this function. // * Make the string complex enough that it is highly unlikely to be @@ -432,4 +427,4 @@ var ID = function () { // Convert it to base 36 (numbers + letters), and grab the first 9 characters // after the decimal. return '_' + Math.random().toString(36).substr(2, 9); -};
\ No newline at end of file +}; diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs index 82d83f02..d8766fec 100644 --- a/public/views/index/body.ejs +++ b/public/views/index/body.ejs @@ -123,12 +123,6 @@ <div class="mastfoot"> <div class="inner"> - <h6 class="social-foot"> - <iframe src="//ghbtns.com/github-btn.html?user=hackmdio&repo=hackmd&type=star&count=true" frameborder="0" scrolling="0" width="104px" height="20px"></iframe> - </h6> - <p> - © 2018 <a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a> - </p> <select class="ui-locale"> <option value="en">English</option> <option value="zh-CN">简体中文</option> @@ -152,6 +146,12 @@ <option value="eo">Esperanto</option> <option value="da">dansk</option> </select> + <p> + © 2018 <a href="https://hackmd.io">HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a> + </p> + <h6 class="social-foot"> + <%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/HackMD" target="_blank"><i class="fa fa-github"></i> GitHub</a>, <a href="https://twitter.com/hackmdio" target="_blank"><i class="fa fa-twitter"></i> Twitter</a>', '<a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> Facebook</a>') %> + </h6> </div> </div> </div> |