diff --git a/bin/build-site.sh b/bin/build-site.sh index cd5267389..7f56e6d30 100755 --- a/bin/build-site.sh +++ b/bin/build-site.sh @@ -359,14 +359,14 @@ node $TW5_BUILD_TIDDLYWIKI \ # Delete any existing static content -rm $TW5_BUILD_OUTPUT/languages/de-AT/static/* -rm $TW5_BUILD_OUTPUT/languages/de-DE/static/* -rm $TW5_BUILD_OUTPUT/languages/es-ES/static/* -rm $TW5_BUILD_OUTPUT/languages/fr-FR/static/* -rm $TW5_BUILD_OUTPUT/languages/ja-JP/static/* -rm $TW5_BUILD_OUTPUT/languages/ko-KR/static/* -rm $TW5_BUILD_OUTPUT/languages/zh-Hans/static/* -rm $TW5_BUILD_OUTPUT/languages/zh-Hant/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/de-AT/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/de-DE/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/es-ES/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/fr-FR/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/ja-JP/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/ko-KR/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/zh-Hans/static/* +rm -rf $TW5_BUILD_OUTPUT/languages/zh-Hant/static/* # /languages/de-AT/index.html Demo wiki with de-AT language # /languages/de-AT/empty.html Empty wiki with de-AT language diff --git a/boot/boot.js b/boot/boot.js index aeaa919fe..1a06c843f 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -313,7 +313,7 @@ $tw.utils.getLocationHash = function() { var idx = href.indexOf('#'); if(idx === -1) { return "#"; - } else if(idx < href.length-1 && href[idx+1] === '#') { + } else if(href.substr(idx + 1,1) === "#" || href.substr(idx + 1,3) === "%23") { // Special case: ignore location hash if it itself starts with a # return "#"; } else { diff --git a/core/modules/widgets/dropzone.js b/core/modules/widgets/dropzone.js index efa08162c..729ad26ed 100644 --- a/core/modules/widgets/dropzone.js +++ b/core/modules/widgets/dropzone.js @@ -232,10 +232,32 @@ DropZoneWidget.prototype.handleDropEvent = function(event) { }; DropZoneWidget.prototype.handlePasteEvent = function(event) { - var self = this, - readFileCallback = function(tiddlerFieldsArray) { + var self = this; + var readFileCallback = function(tiddlerFieldsArray) { self.readFileCallback(tiddlerFieldsArray); }; + var getItem = function(type) { + type = type || "text/plain"; + return function(str) { + // Use the deserializer specified if any + if(self.dropzoneDeserializer) { + tiddlerFields = self.wiki.deserializeTiddlers(null,str,{title: self.wiki.generateNewTitle("Untitled " + type)},{deserializer:self.dropzoneDeserializer}); + if(tiddlerFields && tiddlerFields.length) { + readFileCallback(tiddlerFields); + } + } else { + tiddlerFields = { + title: self.wiki.generateNewTitle("Untitled " + type), + text: str, + type: type + }; + if($tw.log.IMPORT) { + console.log("Importing string '" + str + "', type: '" + type + "'"); + } + readFileCallback([tiddlerFields]); + } + } + }; // Let the browser handle it if we're in a textarea or input box if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) == -1 && !event.target.isContentEditable) { var self = this, @@ -251,27 +273,10 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) { }); } else if(item.kind === "string") { // Create tiddlers from string items - var tiddlerFields, - type = item.type; - item.getAsString(function(str) { - // Use the deserializer specified if any - if(self.dropzoneDeserializer) { - tiddlerFields = self.wiki.deserializeTiddlers(null,str,{title: self.wiki.generateNewTitle("Untitled")},{deserializer:self.dropzoneDeserializer}); - if(tiddlerFields && tiddlerFields.length) { - readFileCallback(tiddlerFields); - } - } else { - tiddlerFields = { - title: self.wiki.generateNewTitle("Untitled"), - text: str, - type: type - }; - if($tw.log.IMPORT) { - console.log("Importing string '" + str + "', type: '" + type + "'"); - } - readFileCallback([tiddlerFields]); - } - }); + var tiddlerFields; + // It's important to give getAsString a closure with the right type + // So it can be added to the import queue + item.getAsString(getItem(item.type)); } } // Tell the browser that we've handled the paste diff --git a/core/modules/widgets/messagecatcher.js b/core/modules/widgets/messagecatcher.js index 85a3561f2..1457cd11f 100644 --- a/core/modules/widgets/messagecatcher.js +++ b/core/modules/widgets/messagecatcher.js @@ -82,7 +82,7 @@ MessageCatcherWidget.prototype.render = function(parent,nextSibling) { } }); // Render children - this.renderChildren(parent,null); + this.renderChildren(parent,nextSibling); }; /* diff --git a/core/ui/LayoutSwitcher.tid b/core/ui/LayoutSwitcher.tid index 2c5243553..0f7e3f15e 100644 --- a/core/ui/LayoutSwitcher.tid +++ b/core/ui/LayoutSwitcher.tid @@ -13,13 +13,13 @@ caption: {{$:/language/ControlPanel/LayoutSwitcher/Caption}} <$set name="cls" filter="[all[current]field:title{$:/layout}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">