From 120203a8e0bfec4d3ec9678febf81ed6f33de34d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 2 Aug 2014 11:58:55 +0100 Subject: [PATCH 1/7] Refactor sidebar tools tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s going to be like the tools tab of tiddler info --- core/ui/PageControls/language.tid | 6 +++++- core/ui/SideBar/Tools.tid | 29 ++++++++++++++++++++++++++++- themes/tiddlywiki/vanilla/base.tid | 11 ++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/core/ui/PageControls/language.tid b/core/ui/PageControls/language.tid index 1360a297c..b6afd1f7e 100644 --- a/core/ui/PageControls/language.tid +++ b/core/ui/PageControls/language.tid @@ -5,7 +5,9 @@ description: {{$:/language/Buttons/Language/Hint}} <$button popup=<> title={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<> selectedClass="tw-selected"> <$list filter="[prefix[yes]]"> -<$transclude tiddler="$:/language/Flag"/> + +<$image source="$:/language/Flag"/> + <$list filter="[prefix[yes]]"> <$text text={{$:/language/Buttons/Language/Caption}}/> @@ -24,11 +26,13 @@ description: {{$:/language/Buttons/Language/Hint}}   + <$transclude subtiddler="$:/language/Flag"> <$list filter="[all[current]field:title[$:/languages/en-GB]]"> <$transclude tiddler="$:/core" subtiddler="$:/language/Flag"/> + <$view field="description"> <$view field="name"> <$view field="title"/> diff --git a/core/ui/SideBar/Tools.tid b/core/ui/SideBar/Tools.tid index 515bafed0..7e68c3935 100644 --- a/core/ui/SideBar/Tools.tid +++ b/core/ui/SideBar/Tools.tid @@ -3,6 +3,34 @@ tags: $:/tags/SideBar caption: {{$:/language/SideBar/Tools/Caption}} \define lingo-base() $:/language/ControlPanel/ +\define config-title() +$:/config/PageControlButtons/Visibility/$(listItem)$ +\end + +<> <> + +--- + +<$set name="tw-config-toolbar-icons" value="yes"> + +<$set name="tw-config-toolbar-text" value="yes"> + +<$set name="tw-config-toolbar-class" value=""> + +<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem"> + +<$checkbox tiddler=<> field="text" checked="show" unchecked="hide" default="show"> <$transclude tiddler=<>/> <$transclude tiddler=<> field="description"/> + + + + + + + + + +--- + <> <$browse/> --- @@ -11,7 +39,6 @@ caption: {{$:/language/SideBar/Tools/Caption}} --- -<> <> --- diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index a98b533fd..9aa2b7255 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -282,7 +282,7 @@ button svg, button img { color: <>; } -.tw-image-button { +button svg.tw-image-button, button .tw-image-button img { height: 1em; width: 1em; } @@ -872,6 +872,15 @@ canvas.tw-edit-bitmapeditor { padding: 0 14px 0 14px; } +.tw-drop-down svg { + width: 1em; + height: 1em; +} + +.tw-drop-down img { + width: 1em; +} + .tw-drop-down a, .tw-drop-down button { display: block; padding: 0 14px 0 14px; From 7816c1d944dd92a1ff83210d82357154d646e1c5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 2 Aug 2014 11:59:07 +0100 Subject: [PATCH 2/7] Add import button --- core/images/import-button.tid | 8 +++++++ core/language/en-GB/Buttons.multids | 2 ++ core/ui/PageControls/import.tid | 16 +++++++++++++ core/wiki/config/PageControlButtons.multids | 1 + core/wiki/tags/PageControls.tid | 2 +- themes/tiddlywiki/vanilla/base.tid | 25 +++++++++++++++++++++ 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 core/images/import-button.tid create mode 100644 core/ui/PageControls/import.tid diff --git a/core/images/import-button.tid b/core/images/import-button.tid new file mode 100644 index 000000000..88211353b --- /dev/null +++ b/core/images/import-button.tid @@ -0,0 +1,8 @@ +title: $:/core/images/import-button +tags: $:/tags/Image + + + + + + \ No newline at end of file diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 61f0359d9..28b17e19a 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -26,6 +26,8 @@ Encryption/SetPassword/Caption: set password Encryption/SetPassword/Hint: Set a password for saving this wiki with encryption FullScreen/Caption: full-screen FullScreen/Hint: Enter or leave full-screen mode +Import/Caption: import +Import/Hint: Import files Info/Caption: info Info/Hint: Show information for this tiddler Home/Caption: home diff --git a/core/ui/PageControls/import.tid b/core/ui/PageControls/import.tid new file mode 100644 index 000000000..0bb68ac81 --- /dev/null +++ b/core/ui/PageControls/import.tid @@ -0,0 +1,16 @@ +title: $:/core/ui/Buttons/import +tags: $:/tags/PageControls +caption: {{$:/core/images/import-button}} {{$:/language/Buttons/Import/Caption}} +description: {{$:/language/Buttons/Import/Hint}} + + +<$button title={{$:/language/Buttons/Import/Hint}} aria-label={{$:/language/Buttons/Import/Caption}} class=<>> +<$list filter="[prefix[yes]]"> +{{$:/core/images/import-button}} + +<$list filter="[prefix[yes]]"> +<$text text={{$:/language/Buttons/Import/Caption}}/> + + +<$browse/> + diff --git a/core/wiki/config/PageControlButtons.multids b/core/wiki/config/PageControlButtons.multids index 4c23178ed..ab191578e 100644 --- a/core/wiki/config/PageControlButtons.multids +++ b/core/wiki/config/PageControlButtons.multids @@ -4,6 +4,7 @@ core/ui/Buttons/close-all: hide core/ui/Buttons/encryption: hide core/ui/Buttons/full-screen: hide core/ui/Buttons/home: hide +core/ui/Buttons/import: hide core/ui/Buttons/language: hide core/ui/Buttons/more-page-actions: hide core/ui/Buttons/permaview: hide diff --git a/core/wiki/tags/PageControls.tid b/core/wiki/tags/PageControls.tid index e1bca558f..af98a288b 100644 --- a/core/wiki/tags/PageControls.tid +++ b/core/wiki/tags/PageControls.tid @@ -1,2 +1,2 @@ title: $:/tags/PageControls -list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/save-wiki]] +list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/more-page-actions]] diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 9aa2b7255..8fb6a9c42 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1352,3 +1352,28 @@ body.tw-dirty span.tw-dirty-indicator, body.tw-dirty span.tw-dirty-indicator svg fill: <>; color: <>; } + +/* +** File inputs +*/ + +.tw-file-input-wrapper { + position: relative; +} + +.tw-file-input-wrapper input[type=file] { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + font-size: 999px; + max-width: 100%; + max-height: 100%; + filter: alpha(opacity=0); + opacity: 0; + outline: none; + background: white; + cursor: pointer; + display: inline-block; +} From bdd33be001735c0edec6317910b30fa707dabde0 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 2 Aug 2014 12:05:01 +0100 Subject: [PATCH 3/7] Fixes for file input styling --- themes/tiddlywiki/vanilla/base.tid | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 8fb6a9c42..a8e8b3c5d 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1359,6 +1359,7 @@ body.tw-dirty span.tw-dirty-indicator, body.tw-dirty span.tw-dirty-indicator svg .tw-file-input-wrapper { position: relative; + overflow: hidden; } .tw-file-input-wrapper input[type=file] { From bf39a45fc0a3efdb74e05bf5c8d321c86b121234 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 2 Aug 2014 12:16:14 +0100 Subject: [PATCH 4/7] Fixes for import button position --- core/ui/PageControls/import.tid | 4 ++-- core/ui/TiddlerInfo/Tools.tid | 1 - themes/tiddlywiki/vanilla/base.tid | 10 +++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/core/ui/PageControls/import.tid b/core/ui/PageControls/import.tid index 0bb68ac81..f0be94dca 100644 --- a/core/ui/PageControls/import.tid +++ b/core/ui/PageControls/import.tid @@ -3,7 +3,7 @@ tags: $:/tags/PageControls caption: {{$:/core/images/import-button}} {{$:/language/Buttons/Import/Caption}} description: {{$:/language/Buttons/Import/Hint}} - +
<$button title={{$:/language/Buttons/Import/Hint}} aria-label={{$:/language/Buttons/Import/Caption}} class=<>> <$list filter="[prefix[yes]]"> {{$:/core/images/import-button}} @@ -13,4 +13,4 @@ description: {{$:/language/Buttons/Import/Hint}} <$browse/> - +
diff --git a/core/ui/TiddlerInfo/Tools.tid b/core/ui/TiddlerInfo/Tools.tid index 1d1336b47..c14d71692 100644 --- a/core/ui/TiddlerInfo/Tools.tid +++ b/core/ui/TiddlerInfo/Tools.tid @@ -6,7 +6,6 @@ caption: {{$:/language/TiddlerInfo/Tools/Caption}} \define config-title() $:/config/ViewToolbarButtons/Visibility/$(listItem)$ \end - <$set name="tw-config-toolbar-icons" value="yes"> <$set name="tw-config-toolbar-text" value="yes"> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index a8e8b3c5d..00ffb28f9 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -270,8 +270,9 @@ button svg, button img { color: <>; } -.tw-sidebar-lists button.btn { +.tw-sidebar-lists button { color: <>; + fill: <>; } .tw-sidebar-lists button.btn-mini { @@ -534,6 +535,11 @@ button svg.tw-image-button, button .tw-image-button img { border-bottom: 1px solid <>; } +.tw-tiddler-info p { + margin-top: 3px; + margin-bottom: 3px; +} + .tw-tiddler-info .tw-tab-buttons button.tw-tab-selected { background-color: <>; border-bottom: 1px solid <>; @@ -1360,6 +1366,8 @@ body.tw-dirty span.tw-dirty-indicator, body.tw-dirty span.tw-dirty-indicator svg .tw-file-input-wrapper { position: relative; overflow: hidden; + display: inline-block; + vertical-align: middle; } .tw-file-input-wrapper input[type=file] { From 1cc85fa3cb0428e212d612643a5a47063ad1a63c Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 2 Aug 2014 12:27:52 +0100 Subject: [PATCH 5/7] Add description for github ribbon --- editions/tw5.com/tiddlers/system/github-fork-ribbon.tid | 1 + 1 file changed, 1 insertion(+) diff --git a/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid b/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid index 5d9c7e385..22fddf73b 100644 --- a/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid +++ b/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid @@ -1,6 +1,7 @@ title: $:/editions/tw5.com/github-fork-ribbon tags: $:/tags/PageControls caption: ~GitHub ribbon +description: ~GitHub ribbon for tw5.com \ No newline at end of file From 748e4ccddc916cc2765db88db990508623661784 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 2 Aug 2014 12:28:09 +0100 Subject: [PATCH 6/7] Update button image sizes --- core/images/globe.tid | 2 +- core/images/import-button.tid | 2 +- core/images/storyview-cecily.tid | 2 +- core/images/storyview-classic.tid | 2 +- core/images/storyview-pop.tid | 2 +- core/images/storyview-zoomin.tid | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/images/globe.tid b/core/images/globe.tid index 7f668bb8c..2edccf671 100644 --- a/core/images/globe.tid +++ b/core/images/globe.tid @@ -1,7 +1,7 @@ title: $:/core/images/globe tags: $:/tags/Image - + diff --git a/core/images/import-button.tid b/core/images/import-button.tid index 88211353b..307809e5e 100644 --- a/core/images/import-button.tid +++ b/core/images/import-button.tid @@ -1,7 +1,7 @@ title: $:/core/images/import-button tags: $:/tags/Image - + diff --git a/core/images/storyview-cecily.tid b/core/images/storyview-cecily.tid index 6b8d6f222..80bf5c8ed 100644 --- a/core/images/storyview-cecily.tid +++ b/core/images/storyview-cecily.tid @@ -1,7 +1,7 @@ title: $:/core/images/storyview-cecily tags: $:/tags/Image - + diff --git a/core/images/storyview-classic.tid b/core/images/storyview-classic.tid index 4e3be0197..86fa1c21e 100644 --- a/core/images/storyview-classic.tid +++ b/core/images/storyview-classic.tid @@ -1,7 +1,7 @@ title: $:/core/images/storyview-classic tags: $:/tags/Image - + diff --git a/core/images/storyview-pop.tid b/core/images/storyview-pop.tid index e5c41aef3..442fc8e77 100644 --- a/core/images/storyview-pop.tid +++ b/core/images/storyview-pop.tid @@ -1,7 +1,7 @@ title: $:/core/images/storyview-pop tags: $:/tags/Image - + diff --git a/core/images/storyview-zoomin.tid b/core/images/storyview-zoomin.tid index 2f76f0513..764c27993 100644 --- a/core/images/storyview-zoomin.tid +++ b/core/images/storyview-zoomin.tid @@ -1,7 +1,7 @@ title: $:/core/images/storyview-zoomin tags: $:/tags/Image - + From 9b9f7d32a0ceaef3333367063124652b956dc421 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 2 Aug 2014 12:42:05 +0100 Subject: [PATCH 7/7] Add plugin blocklist Starting with blocking the old fullscreen plugin --- core/language/en-GB/Import.multids | 5 +++-- core/modules/upgraders/plugins.js | 21 +++++++++++++++++++-- languages/de-DE/Import.multids | 2 +- languages/fr-FR/Import.multids | 2 +- languages/zh-Hans/Import.multids | 2 +- languages/zh-Hant/Import.multids | 2 +- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/core/language/en-GB/Import.multids b/core/language/en-GB/Import.multids index 147c1b430..d5dea4680 100644 --- a/core/language/en-GB/Import.multids +++ b/core/language/en-GB/Import.multids @@ -6,7 +6,8 @@ Listing/Import/Caption: Import Listing/Select/Caption: Select Listing/Status/Caption: Status Listing/Title/Caption: Title -Upgrader/Plugins/Suppressed: Suppressed plugin (due to incoming <> being older than existing <>) +Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin +Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <> being older than existing <>) Upgrader/Plugins/Upgraded: Upgraded plugin from <> to <> -Upgrader/System/Suppressed: Suppressed system tiddler +Upgrader/System/Suppressed: Blocked system tiddler Upgrader/ThemeTweaks/Created: Migrated theme tweak from <$text text=<>/> diff --git a/core/modules/upgraders/plugins.js b/core/modules/upgraders/plugins.js index 306c948f1..91948ff73 100644 --- a/core/modules/upgraders/plugins.js +++ b/core/modules/upgraders/plugins.js @@ -14,6 +14,12 @@ Upgrader module that checks that plugins are newer than any already installed ve var UPGRADE_LIBRARY_TITLE = "$:/UpgradeLibrary"; +var BLOCKED_PLUGINS = { + "$:/plugins/tiddlywiki/fullscreen": { + versions: ["*"] + } +}; + exports.upgrade = function(wiki,titles,tiddlers) { var self = this, messages = {}, @@ -23,7 +29,7 @@ exports.upgrade = function(wiki,titles,tiddlers) { upgradeLibrary = wiki.getTiddlerData(UPGRADE_LIBRARY_TITLE,{}); upgradeLibrary.tiddlers = upgradeLibrary.tiddlers || {}; } - return upgradeLibrary.tiddlers[title] + return upgradeLibrary.tiddlers[title]; }; // Go through all the incoming tiddlers @@ -46,7 +52,18 @@ exports.upgrade = function(wiki,titles,tiddlers) { // Reject the incoming plugin by blanking all its fields if($tw.utils.checkVersions(existingTiddler.fields.version,incomingTiddler.version)) { tiddlers[title] = Object.create(null); - messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Suppressed",{variables: {incoming: incomingTiddler.version, existing: existingTiddler.fields.version}}); + messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Suppressed/Version",{variables: {incoming: incomingTiddler.version, existing: existingTiddler.fields.version}}); + return; + } + } + } + if(incomingTiddler && incomingTiddler["plugin-type"]) { + // Check whether the plugin is on the blocked list + var blockInfo = BLOCKED_PLUGINS[title]; + if(blockInfo) { + if(blockInfo.versions.indexOf("*") !== -1 || (incomingTiddler.version && blockInfo.versions.indexOf(incomingTiddler.version) !== -1)) { + tiddlers[title] = Object.create(null); + messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Suppressed/Incompatible"); return; } } diff --git a/languages/de-DE/Import.multids b/languages/de-DE/Import.multids index 9e9e6e5ce..95c10dd4b 100644 --- a/languages/de-DE/Import.multids +++ b/languages/de-DE/Import.multids @@ -6,7 +6,7 @@ Listing/Import/Caption: Importieren Listing/Select/Caption: Auswahl Listing/Status/Caption: Status Listing/Title/Caption: Titel -Upgrader/Plugins/Suppressed: Einige "plugins" weden unterdrückt! Importierte plugins: <> sind älter als existierende: <>. +Upgrader/Plugins/Suppressed/Version: Einige "plugins" weden unterdrückt! Importierte plugins: <> sind älter als existierende: <>. Upgrader/Plugins/Upgraded: Aktualisieren der plugins von: <> nach: <> Upgrader/System/Suppressed: Unterdrückte "System Tiddler" Upgrader/ThemeTweaks/Created: Migrieren der "theme tweaks" von: <$text text=<>/> diff --git a/languages/fr-FR/Import.multids b/languages/fr-FR/Import.multids index 273ef2dc9..b6d5b880f 100644 --- a/languages/fr-FR/Import.multids +++ b/languages/fr-FR/Import.multids @@ -6,7 +6,7 @@ Listing/Import/Caption: Importer Listing/Select/Caption: Sélectionner Listing/Status/Caption: Statut Listing/Title/Caption: Titre -Upgrader/Plugins/Suppressed: Plugin supprimé (le pressenti <> étant plus ancien que l'existant <>) +Upgrader/Plugins/Suppressed/Version: Plugin supprimé (le pressenti <> étant plus ancien que l'existant <>) Upgrader/Plugins/Upgraded: Plugin mis à jour depuis <> vers <> Upgrader/System/Suppressed: Tiddler système supprimé Upgrader/ThemeTweaks/Created: Thème modifié à partir de <$text text=<>/> diff --git a/languages/zh-Hans/Import.multids b/languages/zh-Hans/Import.multids index 6cf5d6b14..6b4757c70 100644 --- a/languages/zh-Hans/Import.multids +++ b/languages/zh-Hans/Import.multids @@ -6,7 +6,7 @@ Listing/Import/Caption: 导入 Listing/Select/Caption: 选择 Listing/Status/Caption: 状态 Listing/Title/Caption: 条目 -Upgrader/Plugins/Suppressed: 排除插件 (由于传入的 <> 较现有版本 <> 旧) +Upgrader/Plugins/Suppressed/Version: 排除插件 (由于传入的 <> 较现有版本 <> 旧) Upgrader/Plugins/Upgraded: 升级插件,从 <> 到 <> Upgrader/System/Suppressed: 排除系统条目 Upgrader/ThemeTweaks/Created: 從 <$text text=<>/> 遷移佈景主題 diff --git a/languages/zh-Hant/Import.multids b/languages/zh-Hant/Import.multids index 740b2e691..e80736b4c 100644 --- a/languages/zh-Hant/Import.multids +++ b/languages/zh-Hant/Import.multids @@ -6,7 +6,7 @@ Listing/Import/Caption: 導入 Listing/Select/Caption: 選擇 Listing/Status/Caption: 狀態 Listing/Title/Caption: 條目 -Upgrader/Plugins/Suppressed: 排除插件 (由於傳入的 <> 較現有版本 <> 舊) +Upgrader/Plugins/Suppressed/Version: 排除插件 (由於傳入的 <> 較現有版本 <> 舊) Upgrader/Plugins/Upgraded: 升級插件,從 <> 到 <> Upgrader/System/Suppressed: 排除系統條目 Upgrader/ThemeTweaks/Created: 從 <$text text=<>/> 遷移佈景主題