diff --git a/css/default.css b/css/default.css index 56882856..2ca71459 100644 --- a/css/default.css +++ b/css/default.css @@ -124,7 +124,7 @@ input::-webkit-input-placeholder,textarea::-webkit-input-placeholder { color: #333333; background-color: #ddd; opacity: 0.3; - filter: alpha(opacity = 30); + filter: alpha(opacity = 30); } .dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>a,.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus @@ -619,9 +619,9 @@ blockquote p { } input[type="file"] { - line-height: inherit; - height: inherit; - border: none !important; + line-height: inherit; + height: inherit; + border: none !important; } .drop-zone { @@ -635,6 +635,12 @@ input[type="file"] { color: #bbb; } +#modal-import-harddrive-html textarea { + width: 500px; + max-width: 500px; + height: 100px; +} + #md-section-helper { position: absolute; top: -100px; diff --git a/index.html b/index.html index 7e88f5f2..2a4e280c 100644 --- a/index.html +++ b/index.html @@ -71,11 +71,12 @@ class="icon-hdd"> Open from...
Please select the Markdown files to import:
- -Or drag and drop the Markdown files here:
-Please select your Markdown files here:
+ +Or drag and drop your Markdown files here:
+Drop + files here
Handles the "Open from hard drive" and the "Convert HTML to Markdown" dialog boxes.
' + settingsBloc: 'Handles the "Import from hard drive" and the "Convert HTML to Markdown" dialog boxes.
' }; var fileMgr = undefined; @@ -87,6 +88,19 @@ define([ this.addEventListener('dragover', handleDragOver, false); this.addEventListener('drop', handleHtmlImport, false); }); + $(".action-convert-html").click(function(e) { + var content = utils.getInputTextValue("#input-convert-html", e); + if(content === undefined) { + return; + } + content = converter.makeMd(content); + if(content === undefined) { + extensionMgr.onError(importedFile.name + " is not a valid HTML file."); + return; + } + var fileDesc = fileMgr.createFile(undefined, content); + fileMgr.selectFile(fileDesc); + }); }; return dialogOpenHarddrive; diff --git a/js/extensions/googleAnalytics.js b/js/extensions/googleAnalytics.js index 64c55294..52cbdea3 100644 --- a/js/extensions/googleAnalytics.js +++ b/js/extensions/googleAnalytics.js @@ -1,9 +1,10 @@ define([ "jquery", "underscore", + "utils", "settings", "config", -], function($, _, settings) { +], function($, _, utils, settings) { var googleAnalytics = { extensionId: "googleAnalytics", @@ -31,6 +32,19 @@ define([ } }; + var lastPageView = 0; + function trackPageView() { + if(utils.currentTime - lastPageView > 180000) { + _gaq.push([ + '_trackPageview' + ]); + lastPageView = utils.currentTime; + } + } + googleAnalytics.onPeriodicRun = function() { + trackPageView(); + }; + googleAnalytics.onReady = function() { // First configure GA @@ -38,9 +52,7 @@ define([ '_setAccount', GOOGLE_ANALYTICS_ACCOUNT_ID ]); - _gaq.push([ - '_trackPageview' - ]); + trackPageView(); // Collect informations about user settings _gaq.push([ @@ -96,8 +108,8 @@ define([ _gaq.push([ "_trackEvent", "Error", - url, - message + " (" + line + ")" + message, + url + ":" + line + utils.formatEventList() ]); }; @@ -195,7 +207,7 @@ define([ '_trackEvent', "Error", "message", - error.message + error.message + utils.formatEventList() ]); }; diff --git a/js/html/dialogAbout.html b/js/html/dialogAbout.html index c73ae847..9c445d5f 100644 --- a/js/html/dialogAbout.html +++ b/js/html/dialogAbout.html @@ -1,6 +1,6 @@ -StackEdit is a free, open-source Markdown - editor based on PageDown, the Markdown library used by Stack Overflow - and the other Stack Exchange sites.+
StackEdit is a free, open-source Markdown editor based on + PageDown, the Markdown library used by Stack Overflow and the other + Stack Exchange sites.