From e226acf11552d1bae28654352dd85bd7146e04d4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 13 Aug 2016 03:06:35 +0300 Subject: [PATCH] moved most of the templats out of wiki.js into bootstrap/* ... Signed-off-by: Alex A. Naanou --- bootstrap.js | 3 + bootstrap/System/settings.tpl | 34 +++++ bootstrap/System/style.tpl | 43 +++++++ bootstrap/Templates.tpl | 6 + bootstrap/Templates/EmptyOutline.tpl | 1 + bootstrap/Templates/EmptyPage.tpl | 8 ++ bootstrap/Templates/EmptyToDo.tpl | 1 + bootstrap/Templates/_css.tpl | 3 + bootstrap/Templates/_edit.tpl | 13 ++ bootstrap/Templates/_outline.tpl | 9 ++ bootstrap/Templates/_raw.tpl | 1 + bootstrap/Templates/_todo.tpl | 9 ++ bootstrap/Templates/_view.tpl | 29 +++++ bootstrap/Templates/all_pages.tpl | 9 ++ bootstrap/Templates/outline.tpl | 47 +++++++ bootstrap/Templates/pages.tpl | 9 ++ bootstrap/Templates/todo.tpl | 7 ++ bootstrap/Templates/tree.tpl | 15 +++ index.html | 6 + make_bootstrap.js | 41 ++++++ package.json | 6 +- wiki.js | 179 ++------------------------- 22 files changed, 307 insertions(+), 172 deletions(-) create mode 100755 bootstrap.js create mode 100644 bootstrap/System/settings.tpl create mode 100644 bootstrap/System/style.tpl create mode 100644 bootstrap/Templates.tpl create mode 100644 bootstrap/Templates/EmptyOutline.tpl create mode 100644 bootstrap/Templates/EmptyPage.tpl create mode 100644 bootstrap/Templates/EmptyToDo.tpl create mode 100644 bootstrap/Templates/_css.tpl create mode 100644 bootstrap/Templates/_edit.tpl create mode 100644 bootstrap/Templates/_outline.tpl create mode 100644 bootstrap/Templates/_raw.tpl create mode 100644 bootstrap/Templates/_todo.tpl create mode 100644 bootstrap/Templates/_view.tpl create mode 100644 bootstrap/Templates/all_pages.tpl create mode 100644 bootstrap/Templates/outline.tpl create mode 100644 bootstrap/Templates/pages.tpl create mode 100644 bootstrap/Templates/todo.tpl create mode 100644 bootstrap/Templates/tree.tpl create mode 100644 make_bootstrap.js diff --git a/bootstrap.js b/bootstrap.js new file mode 100755 index 0000000..40f7e77 --- /dev/null +++ b/bootstrap.js @@ -0,0 +1,3 @@ +// This file is generated automatically, all changes made here will be lost. + +var Bootstrap = {"Templates":{"text":"@filter(nl2br) @filter(-wikiword)\r\n\r\nXXX Genereal template description...\r\n\r\n

@source(./path)

@quote(./raw)
\r\n\r\n"},"System/settings":{"text":"/**********************************************************************\r\n* !EXPERIMENTAL!\r\n*\r\n* These filters are required for .code to be JSON compatible: \r\n* @filter(json) @filter(-wikiword)\r\n*\r\n* NOTE: currently inline editing may mess this up.\r\n* NOTE: all the comments will be removed before parsing.\r\n*\r\n**********************************************************************/\r\n\r\n// The actual root data to be parsed...\r\n{\r\n // Wiki config...\r\n \"HomePage\": \"WikiHome\",\r\n \"ShowSystemPages\": false,\r\n \"ShowBasePages\": true,\r\n // NOTE: setting this to true will effectively allow pages to control\r\n // your wiki. This is a potential threat if you allow untrusted\r\n // content on your wiki...\r\n // You are doing this at your own risk!\r\n \"AllowScripts\": false,\r\n\r\n // PeerJS API key...\r\n \"PeerJS-API-key\": \"XXX\",\r\n // PeerJS server URL (leave blank for default)...\r\n \"PeerJS-Server\": null,\r\n\r\n // XXX\r\n \"CouchDB-Server\": null\r\n}\r\n\r\n\r\n/*********************************************************************/\r\n"},"System/style":{"text":".raw,\r\n.text {\r\n display: block;\r\n}\r\n\r\ninput[type=\"checkbox\"][checked]~*,\r\n.checked {\r\n text-decoration: line-through;\r\n}\r\n\r\n.button {\r\n text-decoration: none;\r\n}\r\n.button:last-child {\r\n margin-right: 5px;\r\n}\r\n\r\n.separator~* {\r\n float: right;\r\n}\r\n\r\n.item:hover {\r\n background-color: rgba(0, 0, 0, 0.05);\r\n}\r\n.item .button {\r\n display: none;\r\n}\r\n.item:hover .button {\r\n display: inline-block;\r\n}\r\n\r\n.sort-handle {\r\n opacity: 0.1;\r\n padding-left: 5px;\r\n padding-right: 5px;\r\n cursor: pointer;\r\n}\r\n.item:hover .sort-handle {\r\n opacity: 0.3;\r\n}\r\n.sort-placeholder {\r\n display: block;\r\n}\r\n"},"Templates/all_pages":{"text":"\r\n\t
\r\n\t\t[@source(./path)]\r\n\t\t\r\n\t\t×\r\n\t
\r\n
\r\n\r\n\r\n"},"Templates/EmptyOutline":{"text":"@include(./outline)\r\n"},"Templates/EmptyPage":{"text":"\r\n\r\nPage @include(./path) is empty.

\r\n\r\nLinks to this page:
\r\n@include(./links)

\r\n\r\n\r\n"},"Templates/EmptyToDo":{"text":"@include(./todo)\r\n"},"Templates/outline":{"text":"\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t×\r\n\r\n\r\n\r\n
\r\n\t\r\n\t\t+\r\n\t\r\n
\r\n
\r\n\t\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
\r\n\r\n\r\n"},"Templates/pages":{"text":"\r\n\t
\r\n\t\t[@source(./path)]\r\n\t\t\r\n\t\t×\r\n\t
\r\n
\r\n\r\n\r\n"},"Templates/todo":{"text":"\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n"},"Templates/tree":{"text":"
\r\n\t\r\n\t\t
\r\n\t\t\t \r\n\t\t\t@source(./title)\r\n\t\t\t\r\n\t\t\t×\r\n\t\t
\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
\r\n\r\n\r\n"},"Templates/_css":{"text":"\r\n"},"Templates/_edit":{"text":"\r\n\r\n\r\n\r\n(view)\r\n\r\n@source(../title)\r\n\r\n\r\n\t
\r\n
\r\n\r\n\r\n"},"Templates/_outline":{"text":"\r\n\r\n@source(../title)\r\n\r\n\r\n\t@include(../outline)\r\n\r\n\r\n\r\n"},"Templates/_raw":{"text":"@source(..)\r\n"},"Templates/_todo":{"text":"\r\n\r\n@source(../title)\r\n\r\n\r\n\t@include(../todo)\r\n\r\n\r\n\r\n"},"Templates/_view":{"text":"\r\n@include(style/_css)\r\n\r\n
\r\n\t \r\n\r\n\t[@source(../path)]\r\n\r\n\t (edit) \r\n\r\n\t\r\n\r\n\t+\r\n
\r\n\r\n
\r\n\t

\r\n\t\t@source(../title)\r\n\t

\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n
\r\nhome\r\n\r\n\r\n"}} \ No newline at end of file diff --git a/bootstrap/System/settings.tpl b/bootstrap/System/settings.tpl new file mode 100644 index 0000000..a008ade --- /dev/null +++ b/bootstrap/System/settings.tpl @@ -0,0 +1,34 @@ +/********************************************************************** +* !EXPERIMENTAL! +* +* These filters are required for .code to be JSON compatible: +* @filter(json) @filter(-wikiword) +* +* NOTE: currently inline editing may mess this up. +* NOTE: all the comments will be removed before parsing. +* +**********************************************************************/ + +// The actual root data to be parsed... +{ + // Wiki config... + "HomePage": "WikiHome", + "ShowSystemPages": false, + "ShowBasePages": true, + // NOTE: setting this to true will effectively allow pages to control + // your wiki. This is a potential threat if you allow untrusted + // content on your wiki... + // You are doing this at your own risk! + "AllowScripts": false, + + // PeerJS API key... + "PeerJS-API-key": "XXX", + // PeerJS server URL (leave blank for default)... + "PeerJS-Server": null, + + // XXX + "CouchDB-Server": null +} + + +/*********************************************************************/ diff --git a/bootstrap/System/style.tpl b/bootstrap/System/style.tpl new file mode 100644 index 0000000..576f0ad --- /dev/null +++ b/bootstrap/System/style.tpl @@ -0,0 +1,43 @@ +.raw, +.text { + display: block; +} + +input[type="checkbox"][checked]~*, +.checked { + text-decoration: line-through; +} + +.button { + text-decoration: none; +} +.button:last-child { + margin-right: 5px; +} + +.separator~* { + float: right; +} + +.item:hover { + background-color: rgba(0, 0, 0, 0.05); +} +.item .button { + display: none; +} +.item:hover .button { + display: inline-block; +} + +.sort-handle { + opacity: 0.1; + padding-left: 5px; + padding-right: 5px; + cursor: pointer; +} +.item:hover .sort-handle { + opacity: 0.3; +} +.sort-placeholder { + display: block; +} diff --git a/bootstrap/Templates.tpl b/bootstrap/Templates.tpl new file mode 100644 index 0000000..03fb460 --- /dev/null +++ b/bootstrap/Templates.tpl @@ -0,0 +1,6 @@ +@filter(nl2br) @filter(-wikiword) + +XXX Genereal template description... + +

@source(./path)

@quote(./raw)
+ diff --git a/bootstrap/Templates/EmptyOutline.tpl b/bootstrap/Templates/EmptyOutline.tpl new file mode 100644 index 0000000..c4c465a --- /dev/null +++ b/bootstrap/Templates/EmptyOutline.tpl @@ -0,0 +1 @@ +@include(./outline) diff --git a/bootstrap/Templates/EmptyPage.tpl b/bootstrap/Templates/EmptyPage.tpl new file mode 100644 index 0000000..001e183 --- /dev/null +++ b/bootstrap/Templates/EmptyPage.tpl @@ -0,0 +1,8 @@ + + +Page @include(./path) is empty.

+ +Links to this page:
+@include(./links)

+ + diff --git a/bootstrap/Templates/EmptyToDo.tpl b/bootstrap/Templates/EmptyToDo.tpl new file mode 100644 index 0000000..7046988 --- /dev/null +++ b/bootstrap/Templates/EmptyToDo.tpl @@ -0,0 +1 @@ +@include(./todo) diff --git a/bootstrap/Templates/_css.tpl b/bootstrap/Templates/_css.tpl new file mode 100644 index 0000000..ca60dc4 --- /dev/null +++ b/bootstrap/Templates/_css.tpl @@ -0,0 +1,3 @@ + diff --git a/bootstrap/Templates/_edit.tpl b/bootstrap/Templates/_edit.tpl new file mode 100644 index 0000000..bf7986c --- /dev/null +++ b/bootstrap/Templates/_edit.tpl @@ -0,0 +1,13 @@ + + + + +(view) + +@source(../title) + + +
+
+ + diff --git a/bootstrap/Templates/_outline.tpl b/bootstrap/Templates/_outline.tpl new file mode 100644 index 0000000..e02635d --- /dev/null +++ b/bootstrap/Templates/_outline.tpl @@ -0,0 +1,9 @@ + + +@source(../title) + + + @include(../outline) + + + diff --git a/bootstrap/Templates/_raw.tpl b/bootstrap/Templates/_raw.tpl new file mode 100644 index 0000000..a62cf6a --- /dev/null +++ b/bootstrap/Templates/_raw.tpl @@ -0,0 +1 @@ +@source(..) diff --git a/bootstrap/Templates/_todo.tpl b/bootstrap/Templates/_todo.tpl new file mode 100644 index 0000000..627476d --- /dev/null +++ b/bootstrap/Templates/_todo.tpl @@ -0,0 +1,9 @@ + + +@source(../title) + + + @include(../todo) + + + diff --git a/bootstrap/Templates/_view.tpl b/bootstrap/Templates/_view.tpl new file mode 100644 index 0000000..dba4807 --- /dev/null +++ b/bootstrap/Templates/_view.tpl @@ -0,0 +1,29 @@ + +@include(style/_css) + +
+ + + [@source(../path)] + + (edit) + + + + + +
+ +
+

+ @source(../title) +

+
+ + + + + +
+home + + diff --git a/bootstrap/Templates/all_pages.tpl b/bootstrap/Templates/all_pages.tpl new file mode 100644 index 0000000..999b43b --- /dev/null +++ b/bootstrap/Templates/all_pages.tpl @@ -0,0 +1,9 @@ + +
+ [@source(./path)] + + × +
+
+ + diff --git a/bootstrap/Templates/outline.tpl b/bootstrap/Templates/outline.tpl new file mode 100644 index 0000000..029ddc0 --- /dev/null +++ b/bootstrap/Templates/outline.tpl @@ -0,0 +1,47 @@ + + + + + + + + × + + + +
+ + + + +
+
+ +
+
+ + + + + +
+
+ +
+
+
+
+ + diff --git a/bootstrap/Templates/pages.tpl b/bootstrap/Templates/pages.tpl new file mode 100644 index 0000000..79a7a7a --- /dev/null +++ b/bootstrap/Templates/pages.tpl @@ -0,0 +1,9 @@ + +
+ [@source(./path)] + + × +
+
+ + diff --git a/bootstrap/Templates/todo.tpl b/bootstrap/Templates/todo.tpl new file mode 100644 index 0000000..c71277e --- /dev/null +++ b/bootstrap/Templates/todo.tpl @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bootstrap/Templates/tree.tpl b/bootstrap/Templates/tree.tpl new file mode 100644 index 0000000..096ad0b --- /dev/null +++ b/bootstrap/Templates/tree.tpl @@ -0,0 +1,15 @@ +
+ +
+ + @source(./title) + + × +
+
+ +
+
+
+ + diff --git a/index.html b/index.html index cc6e3f0..9cc45a4 100755 --- a/index.html +++ b/index.html @@ -17,6 +17,7 @@ +