From 3b9411ba1b18a5197a82fa37fa1e4a1aee7d79f1 Mon Sep 17 00:00:00 2001 From: BinChan Date: Tue, 14 Nov 2017 23:30:47 +0800 Subject: [PATCH 01/27] Merge TOC, tag feature --- .gitignore | 12 + content.json | 242 +++--------- data/data.json | 17 + data/data.json-old | 17 + data/users/content.json | 27 ++ dbschema.json | 13 +- index.html | 10 +- js/Comments.coffee | 4 + js/ZeroBlog.coffee | 334 ++++++++++++++-- js/all.js | 836 +++++++++++++++++++++++++++------------- languages/pl.json | 34 ++ 11 files changed, 1058 insertions(+), 488 deletions(-) create mode 100644 .gitignore create mode 100644 data/data.json create mode 100644 data/data.json-old create mode 100644 data/users/content.json create mode 100644 languages/pl.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0671370 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +# Hidden files +.* +!/.gitignore +!/.travis.yml + + +# Database +*.db + +data/users/* +!/data/users/content.json +!/data/data.json \ No newline at end of file diff --git a/content.json b/content.json index e2350d6..d2d61f7 100644 --- a/content.json +++ b/content.json @@ -1,201 +1,45 @@ { - "address": "1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8", + "address": "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW", "background-color": "white", + "clone_root": "template-new", "cloneable": true, "description": "Blogging platform Demo", - "domain": "Blog.ZeroNetwork.bit", "files": { + "LICENSE": { + "sha512": "d281feecb7d1218e1aea8269f288fcd63385da1a130681fadae77262637cb65f", + "size": 18027 + }, + "README.md": { + "sha512": "07dbb7b8386b600d7eea237f237269ed705cf3d97a46edc02c8ba43fa63b59c2", + "size": 312 + }, "alloy-editor/all.css": { - "sha512": "c1e2049d304f77ad078fd4546a62c1456ba5459ef169fe82394a090a22487b8e", - "size": 63344 + "sha512": "7f92b9206df4994b119df0123734193ad95c5961c2b5190aa1e60f394026d150", + "size": 63384 }, "alloy-editor/all.js": { "sha512": "0c917acb6b3f7397d37263a8ee01100929e7aed3c752b2103cb884f65aef7b23", "size": 737537 }, "css/all.css": { - "sha512": "b5426b2cc41ca837fea4f0c72b21d4cd456739d794404504d2dbbbf486c3c725", - "size": 130050 + "sha512": "2d7a6001b26a4a33911cc0c5935ccbaf1a40f56a0ea213267ac3b1b865d58863", + "size": 130255 }, "data-default/data.json": { - "sha512": "aff6accbac7e950ff567105666ddf29b70ca7c2dcd9d90f9a969509a42a9b195", - "size": 352 + "sha512": "c8952629acf0c47ac1a53c7b8910e3aae2eda34371cb5182b9c9a50e483a297c", + "size": 437 }, "data-default/users/content-default.json": { "sha512": "0603ce08f7abb92b3840ad0cf40e95ea0b3ed3511b31524d4d70e88adba83daa", "size": 679 }, "data/data.json": { - "sha512": "5f419fff6baaf3ee1c41ba5d3b396f0d5d406136f5aa681376889f4fb7380243", - "size": 123877 - }, - "data/files/ZeroFrame.coffee": { - "sha512": "e9d440c26e858ff524313e60881714bcaf292470ce63d2b33b93d9920a21a7c4", - "size": 1467 - }, - "data/img/allony.png": { - "sha512": "2cf2ef70d1dbf2395384581ffb0e1cc9e8dfa5a64441e5ab7c08477127fb6d9a", - "size": 1572 - }, - "data/img/autoupdate.png": { - "sha512": "d2b4dc8e0da2861ea051c0c13490a4eccf8933d77383a5b43de447c49d816e71", - "size": 24460 - }, - "data/img/clone.png": { - "sha512": "07df9f39af99b2a4348f1f0984b0e8667add7821a689e0a737df49bd68411def", - "size": 11539 - }, - "data/img/decentralized_web_summit.png": { - "sha512": "90f83d91ea366eeb13c5874c0d25ef6efa6d20cc6e3f556fdc4de949d58248a4", - "size": 25428 - }, - "data/img/direct_domains.png": { - "sha512": "5f14b30c1852735ab329b22496b1e2ea751cb04704789443ad73a70587c59719", - "size": 16185 - }, - "data/img/domain.png": { - "sha512": "ce87e0831f4d1e95a95d7120ca4d33f8273c6fce9f5bbedf7209396ea0b57b6a", - "size": 11881 - }, - "data/img/getd.png": { - "sha512": "22987f498e2dd6e5dee9f6367fec22fa1d2ad3538b2455d1d9e3fc400d1933db", - "size": 36735 - }, - "data/img/memory.png": { - "sha512": "dd56515085b4a79b5809716f76f267ec3a204be3ee0d215591a77bf0f390fa4e", - "size": 12775 - }, - "data/img/multiuser.png": { - "sha512": "88e3f795f9b86583640867897de6efc14e1aa42f93e848ed1645213e6cc210c6", - "size": 29480 - }, - "data/img/new_zeronet_logos.png": { - "sha512": "a8685d5d8d9d84a83710a1316ee7b8f998f14918cef32e14217d5e45f156aa20", - "size": 59816 - }, - "data/img/optional.png": { - "sha512": "84df27a2ee59f18bc646ed4e6610a6ca7569fad2e85198ba9aa278a3258f35c3", - "size": 104799 - }, - "data/img/optional_manager.png": { - "sha512": "f0df2c1df5106f63e922ac0b65388d97bab1e7c26f6bf06469b44eae8b798cec", - "size": 29008 - }, - "data/img/peers.jpg": { - "sha512": "3142ae89ed2347953033068fd789ac316692a3bdcbbf01257326685fc1402be9", - "size": 67768 - }, - "data/img/pocketchip.jpg": { - "sha512": "05ddad3659e71dfbc6afbba3faaf680c810636ea2319e1e9950ed462cfa75d01", - "size": 131607 - }, - "data/img/post_101_ezgif.com-f1dae34e05.gif": { - "sha512": "ee45043be1c79a1ef952f2ab030d24b63592790b572750b8bf42544d80a228e3", - "size": 15609 - }, - "data/img/post_101_plus.png": { - "sha512": "e8d3bd6fe509e79389385389d66874a388a8474218c3ef5b3cf9339196d0633d", - "size": 243 - }, - "data/img/post_102_1484303724.jpg": { - "sha512": "1e75a71128f3675389ccef9748d071b779ef8635db826f933dffdccf2e6fed61", - "size": 90260 - }, - "data/img/post_102_peers.jpg": { - "sha512": "37c064e0b8fafa801a6264e9495d515b7468fa387566d329debd80e66cc7ebcf", - "size": 79172 - }, - "data/img/post_103_publish.png": { - "sha512": "ace77f3163cd0de7dc560d18cecd73b3e6cd8a5b32751d4038c65c400521e88c", - "size": 1087 - }, - "data/img/post_104_mute.png": { - "sha512": "6bdad39da3dfbc3db3a57e52fc10d9205cf0729a6cd124e7e5c8704a130161b4", - "size": 15562 - }, - "data/img/progressbar.png": { - "sha512": "23d592ae386ce14158cec34d32a3556771725e331c14d5a4905c59e0fe980ebf", - "size": 13294 - }, - "data/img/search.png": { - "sha512": "b5adf6562b0078bdda257d216a07b43fa6f81e0989fcabf83817ef072cbeb1f1", - "size": 18735 - }, - "data/img/sidebar.png": { - "sha512": "e5fdafcc7226f830eb27a1296236aa985625e27480e6829660db978ceae0bba9", - "size": 98641 - }, - "data/img/slides.png": { - "sha512": "1933db3b90ab93465befa1bd0843babe38173975e306286e08151be9992f767e", - "size": 14439 - }, - "data/img/slots_memory.png": { - "sha512": "82a250e6da909d7f66341e5b5c443353958f86728cd3f06e988b6441e6847c29", - "size": 9488 - }, - "data/img/startup.png": { - "sha512": "d9f4d652396bbb89f0508e3e3908bd03408e99681f33e47f790b53a9b1c4fafc", - "size": 4257 - }, - "data/img/trayicon.png": { - "sha512": "e7ae65bf280f13fb7175c1293dad7d18f1fcb186ebc9e1e33850cdaccb897b8f", - "size": 19040 - }, - "data/img/tutorial-1.png": { - "sha512": "885d322f4e189775cbacb6e7d4f9ee89554d5709077e3777f0d382b0e9d315f1", - "size": 18729 - }, - "data/img/uipassword.png": { - "sha512": "2f7ddb406cb318da51c36dc4e30e79aca17ef6730b9ba1fa5a9768127d3d0f02", - "size": 5383 - }, - "data/img/xmas_tree.jpg": { - "sha512": "fec017f87867f43d0f2b98e0b275b59a1997746e6cae9d322c551d7ab357488c", - "size": 43706 - }, - "data/img/zeroblog-comments.png": { - "sha512": "efe4e815a260e555303e5c49e550a689d27a8361f64667bd4a91dbcccb83d2b4", - "size": 24001 - }, - "data/img/zerochat.png": { - "sha512": "b1512ad6514a87d8052dac880b3ef0d9f2e70cf2e4605bfebd4a6c792d1c2ba9", - "size": 12029 - }, - "data/img/zeroid.png": { - "sha512": "b46d541a9e51ba2ddc8a49955b7debbc3b45fd13467d3c20ef104e9d938d052b", - "size": 18875 - }, - "data/img/zeromail.png": { - "sha512": "f2ced47d30bbf76549ae990b63dab00f3764ad48b6085464b122b108f31da368", - "size": 34638 - }, - "data/img/zerome.png": { - "sha512": "2b97eadf18d93c52c3316d14d8d54b1564a058e332fbf7bbb107bf24ad07e302", - "size": 21698 - }, - "data/img/zeroname.png": { - "sha512": "bab45a1bb2087b64e4f69f756b2ffa5ad39b7fdc48c83609cdde44028a7a155d", - "size": 36031 - }, - "data/img/zerotalk-mark.png": { - "sha512": "a335b2fedeb8d291ca68d3091f567c180628e80f41de4331a5feb19601d078af", - "size": 44862 - }, - "data/img/zerotalk-upvote.png": { - "sha512": "b1ffd7f948b4f99248dde7efe256c2efdfd997f7e876fb9734f986ef2b561732", - "size": 41092 - }, - "data/img/zerotalk.png": { - "sha512": "54d10497a1ffca9a4780092fd1bd158c15f639856d654d2eb33a42f9d8e33cd8", - "size": 26606 - }, - "data/pdf/zeronet_presentation.pdf": { - "sha512": "70274438cf2fbb63e1d3c75a74250ca5d968d63cadbb4426305b3b51f2608a01", - "size": 472084 + "sha512": "e1c05f2052558fa9dbdb1e254fe44cecdea2e7212bfa7e09ba4d623342d6a899", + "size": 439 }, "dbschema.json": { - "sha512": "fa70ee2fce3f8342c6909e0e9b853bca71fa996f23f85739f94c086f2bda5ceb", - "size": 2571 + "sha512": "01300937662ec84f6bc18b57e650d8f03dfe6888e89b669022ee91c4c44ed0c1", + "size": 2908 }, "img/avatar.png": { "sha512": "a656c470967e27c2b385182a361db8bab1696fe3b2d79c86394236d02ce42eb8", @@ -206,19 +50,35 @@ "size": 723 }, "index.html": { - "sha512": "503623af793ba3d4209a08b7c94b06db410804bdf7089fed040c471c459a71a5", - "size": 6382 + "sha512": "31b50f6d59d23a8c24292161585d1e4a695b4d1fba9645648c7e6acfd72ea6ba", + "size": 6740 }, "js/all.js": { - "sha512": "2e75e1eddde295bc99ce54f87b987219caed30d0828fe361c900ffb9a9fe1905", - "size": 247867 + "sha512": "61d103f38f39f3e64144a2473e9c9da109df5404768960f9dc6b9eeefdd8da85", + "size": 259843 + }, + "languages/es.json": { + "sha512": "9005bf63e41b2670af8eba0103badfe9ba24ae94b6cac64d00193cfbb2624d85", + "size": 871 + }, + "languages/fr.json": { + "sha512": "6e87d27a3ee084c8300642ac83133d9b967d8ba3997d7bb0dfbe104ee3e1b327", + "size": 1773 + }, + "languages/nl.json": { + "sha512": "1844365e54a2a5b53fcff4f36ad2e870fe738ba033dbae77172de3126e72bcb7", + "size": 912 }, "languages/pl.json": { "sha512": "f84ea772597afc947fb0e759318aaa3371a36efe542abdbd6b6411ea99468826", "size": 864 + }, + "languages/zh.json": { + "sha512": "b8ae541464d09451f2d0e9af32dabc0b7ed2474576f721e2bd592ba4de22e231", + "size": 761 } }, - "ignore": "((js|css|alloy-editor)/(?!all.(js|css))|data/.*db|data/users/.*/.*)", + "ignore": "((js|css|alloy-editor)/(?!all.(js|css))|data/.*db|data/users/.*/.*|.git|.gitignore)", "includes": { "data/users/content.json": { "signers": [], @@ -226,22 +86,14 @@ } }, "inner_path": "content.json", - "modified": 1486949114, + "modified": 1510673379, "postmessage_nonce_security": true, - "sign": [ - 46220524892014274189597736846232592807986501080175547419624109664319912543976, - 48261414791532551873927752970010534526261073351836499372694272435238865271264 - ], - "signers_sign": "G7W/oNvczE5nPTFYVOqv8+GOpQd23LS/Dc1Q6xQ1NRDDHlYzmoSE63UQ7Za05kD0rwIYXbuUSr8z8p6RhZmnUs8=", + "signers_sign": "GwcX6fQSYco45YGEw0Tr7h8TE8UqLlz4HM/2NLzbfdPRcorFKi9IO2P5ZznLBLbTQK+11D3zZjAK/MQmSaSoSpA=", "signs": { - "1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8": "G4MrVTYetIomtruNF7KyB5VNSynx4oy/IEZJzNz84XwTcW1GQNkXuRHLFVK0YLtVxmTyX8Jm3AscS4e2+0QG/wg=" + "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW": "G3IaJOeyt1xHHks998VdG5QylJHTQFHUMhTBMS8BbZo/DbPPL33J3fcQfIW3JVvWt+A1MQawoflnLy7rXr7qgbQ=" }, "signs_required": 1, - "title": "ZeroBlog", - "translate": [ - "index.html", - "js/all.js", - "alloy-editor/all.js" - ], - "zeronet_version": "0.5.2" + "title": "ZeroBlog Plus", + "translate": ["index.html", "js/all.js", "alloy-editor/all.js"], + "zeronet_version": "0.6.0" } \ No newline at end of file diff --git a/data/data.json b/data/data.json new file mode 100644 index 0000000..638b8a0 --- /dev/null +++ b/data/data.json @@ -0,0 +1,17 @@ +{ + "title": "ZeroBlog Plus", + "description": "My ZeroBlog.", + "links": "- [Source code](https://github.com/HelloZeroNet)", + "next_post_id": 2, + "demo": false, + "footer": "Powered by [ZeroNet](https://zeronet.io) [open, free, and uncensored]", + "modified": 1510673351, + "post": [ + { + "post_id": 1, + "title": "Congratulations!", + "date_published": 1433033779.604, + "body": "Your zeronet blog has been successfully created!" + } + ] +} \ No newline at end of file diff --git a/data/data.json-old b/data/data.json-old new file mode 100644 index 0000000..c440bef --- /dev/null +++ b/data/data.json-old @@ -0,0 +1,17 @@ +{ + "title": "MyZeroBlog", + "description": "My ZeroBlog.", + "links": "- [Source code](https://github.com/HelloZeroNet)", + "next_post_id": 2, + "demo": false, + "footer": "Powered by [ZeroNet](https://zeronet.io) [open, free, and uncensored]", + "modified": 1432515193, + "post": [ + { + "post_id": 1, + "title": "Congratulations!", + "date_published": 1433033779.604, + "body": "Your zeronet blog has been successfully created!" + } + ] +} diff --git a/data/users/content.json b/data/users/content.json new file mode 100644 index 0000000..a895830 --- /dev/null +++ b/data/users/content.json @@ -0,0 +1,27 @@ +{ + "address": "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW", + "files": {}, + "ignore": ".*", + "inner_path": "data/users/content.json", + "modified": 1510673085, + "signs": { + "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW": "G7jsSZej1HHS1yhjkgN1WucanZG0No9XCtIW5JQgb26/fjaU/fr0owPGxuNP+9wNsDjYwrQSfeoYnccS/Bo+nsg=" + }, + "user_contents": { + "cert_signers": { + "zeroid.bit": ["1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz"] + }, + "permission_rules": { + ".*": { + "files_allowed": "data.json", + "max_size": 10000 + }, + "bitid/.*@zeroid.bit": {"max_size": 40000}, + "bitmsg/.*@zeroid.bit": {"max_size": 15000} + }, + "permissions": { + "banexample@zeroid.bit": false, + "nofish@zeroid.bit": {"max_size": 20000} + } + } +} \ No newline at end of file diff --git a/dbschema.json b/dbschema.json index 7945db3..9db07c6 100644 --- a/dbschema.json +++ b/dbschema.json @@ -14,7 +14,7 @@ "to_keyvalue": [ "cert_user_id" ] }, "data.json": { - "to_table": [ "post" ], + "to_table": [ "post" ,"tag"], "to_keyvalue": [ "title", "description", "links", "next_post_id", "demo", "modified", "footer" ] } @@ -51,6 +51,15 @@ "indexes": ["CREATE UNIQUE INDEX post_uri ON post(json_id, post_id)", "CREATE INDEX post_id ON post(post_id)"], "schema_changed": 1426195823 }, + "tag": { + "cols":[ + ["value","TEXT NOT NULL CHECK(length(value)!=0)"], + ["post_id","REFERENCES post(post_id)"], + ["json_id", "INTEGER REFERENCES json (json_id)"] + ], + "indexes": ["CREATE UNIQUE INDEX tag_post_uri ON tag(value,post_id)"], + "schema_changed": 1426195822 + }, "post_vote": { "cols": [ ["post_id", "INTEGER"], @@ -65,4 +74,4 @@ "Comments": "SELECT 'comment' AS type, date_added, post.title AS title, keyvalue.value || ': ' || comment.body AS body, '?Post:' || comment.post_id || '#Comments' AS url FROM comment LEFT JOIN json USING (json_id) LEFT JOIN json AS json_content ON (json_content.directory = json.directory AND json_content.file_name='content.json') LEFT JOIN keyvalue ON (keyvalue.json_id = json_content.json_id AND key = 'cert_user_id') LEFT JOIN post ON (comment.post_id = post.post_id)", "Posts": "SELECT post_id AS event_uri, 'post' AS type, date_published AS date_added, title AS title, body AS body, '?Post:' || post_id AS url FROM post" } -} \ No newline at end of file +} diff --git a/index.html b/index.html index 8366034..55ef924 100644 --- a/index.html +++ b/index.html @@ -53,6 +53,10 @@

Follow in NewsfeedFollowing

+ TOC by date +
+ TOC by tag +
@@ -94,6 +98,8 @@

^0 ^1 --> +
+ tag:
Body
Read more @@ -110,6 +116,8 @@

21 hours ago · 2 min read +
+ tag:
@@ -175,4 +183,4 @@

0 Comments:

- \ No newline at end of file + diff --git a/js/Comments.coffee b/js/Comments.coffee index 8f9ad97..c519a71 100644 --- a/js/Comments.coffee +++ b/js/Comments.coffee @@ -169,5 +169,9 @@ class Comments extends Class if elem.height() > 0 then elem.trigger "input" else elem.height("48px") + hide: () -> + $(".comment").hide() + $("#Comments").hide() + window.Comments = new Comments() diff --git a/js/ZeroBlog.coffee b/js/ZeroBlog.coffee index b3febbb..aa8937b 100644 --- a/js/ZeroBlog.coffee +++ b/js/ZeroBlog.coffee @@ -145,20 +145,194 @@ class ZeroBlog extends ZeroFrame $("body").addClass("page-post") @post_id = parseInt(match[1]) @pagePost() + else if match = url.match /Toc=(.*)/ + @pageToc(match[1]) else $("body").addClass("page-main") if match = url.match /page=([0-9]+)/ @page = parseInt(match[1]) @pageMain() + pageToc:(tocType) -> + $("body").addClass("page-post") + + if tocType.match /^dateDesc/ + @pageTocDateDesc() + else if tocType.match /^tagAll/ + @pageTocTagAll() + else if tocType.match /^tag/ + @pageTocByTag(tocType.split("&")[0].substring(3)) + + @pageLoaded() + #TOC page didn't show details row nor allow edit,comments + $(".post .details").hide() + $(".editable-edit").hide() + Comments.hide() + + emptyTocPage: (title,body) -> + @applyPostdata($(".post-full"), + title:title + post_id:-1 + votes:-1 + comments:-1 + body:body + ,true) + + pageTocByTag:(tagType) -> + queryString = "" + tag ="" + #query untagged + if tagType.match /^None/ + tag="all untagged" + queryString = """SELECT date_published,title,post_id FROM post + WHERE post_id NOT IN (SELECT DISTINCT (post_id) FROM tag) + ORDER BY date_published DESC""" + else + + tag = decodeURIComponent(tagType.substring(1)) + @log "Toc by tag:", tag + #by tag + queryString = """SELECT post.date_published AS date_published, + post_id,post.title AS title FROM tag + JOIN (SELECT date_published,title,post_id FROM post) AS post + USING (post_id) WHERE value="#{tag}" + ORDER BY date_published DESC + """ + @cmd "dbQuery", [queryString], (res) => + parse_res = (res) => + if res.length is 0 + @emptyTocPage("#{tag}","no posts found") + return + + markdown="" + for i in res + date = new Date(i.date_published*1000) + markdown += "- [#{date.getFullYear()}-\ + #{date.getMonth()+1}-#{date.getDate()}:\ + #{i.title}](?Post:#{i.post_id})\n" + + + @applyPostdata($(".post-full"), + title:"posts of tag:"+tag + post_id:-1 + votes:-1 + comments:-1 + body:markdown + ,true) + if res.error + @emptyTocPage("error when getting index","error when getting index") + else + parse_res(res) + + + pageTocTagAll: () -> + #list all tags only. to avoid too many duplicate post with different tag + #first row is total post number + #second row is tagged number + #follow rows is tagged value,count + @cmd "dbQuery", ["""SELECT "all" AS value,COUNT(*) AS count FROM post + UNION ALL + SELECT "tagged" AS value,COUNT(DISTINCT post_id) AS count + FROM tag + UNION ALL + SELECT value, COUNT(post_id) + FROM tag GROUP BY value ORDER BY count DESC"""], (res) => + parse_res = (res) => + + total_post = res[0].count + if total_post is 0 + emptyTocPage("no post","no post at all") + return + + markdown = "" + tagged = res[2..] + + if tagged.length > 0 + markdown += "Tagged:\n\n" + + for one in tagged + escaped = encodeURIComponent(one.value) + markdown += "[#{one.value}: #{one.count} post(s)]\ + (?Toc=tag:#{escaped})\n" + + untagged=total_post - res[1].count + + if untagged != 0 + markdown += "\n[Untagged: #{untagged} post(s)]\ + (?Toc=tagNone)" + + + @applyPostdata($(".post-full"), + title:"index by tag" + post_id:-1 + votes:-1 + comments:-1 + body:markdown + ,true) + if res.error + @emptyTocPage("error when getting index","sorry, error happened") + else + parse_res(res) + # - Pages - + + pageTocDateDesc: () -> + @log "Toc by date desc" + @cmd "dbQuery", ["SELECT post_id,date_published,title FROM post + ORDER BY date_published DESC"], (res) => + parse_res = (res) => + + #id is needed when applyPostdata + + if res.length is 0 + + @emptyTocPage("no post","no post at all") + return + + # makes next month + month = new Date(new Date().getTime()+31*24*60*60*1000) + markdown = "" + + for post in res + #in current range + post_date = new Date(post.date_published*1000) + if post_date s = (+ new Date) @cmd "dbQuery", ["SELECT *, (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes FROM post WHERE post_id = #{@post_id} LIMIT 1"], (res) => - parse_res = (res) => + parse_res = (res,tag_res) => if res.length post = res[0] + #post.tag is in data["tag"] table, must query and add them manually + post.tag=[] + for tag in tag_res + post.tag.push(tag.value) @applyPostdata($(".post-full"), post, true) $(".post-full").css("display", "block") $(".post-full .like").attr("id", "post_like_#{post.post_id}").off("click").off("click").on "click", @submitPostVote @@ -170,16 +344,35 @@ class ZeroBlog extends ZeroFrame @pageLoaded() Comments.checkCert() - # Temporary dbschema bug workaround - if res.error - @cmd "dbQuery", ["SELECT *, -1 AS votes FROM post WHERE post_id = #{@post_id} LIMIT 1"], parse_res - else - parse_res(res) + tag_query = """ + SELECT value FROM tag + WHERE post_id=#{@post_id} + """ + deal_post = (post_res,tag_res) => + # Temporary dbschema bug workaround + if res.error + @cmd "dbQuery", ["SELECT *, -1 AS votes FROM post + WHERE post_id = #{@post_id} LIMIT 1"], + (res)->parse_res(res,tag_res) + else + parse_res(res,tag_res) + + @cmd "dbQuery", [tag_query], (tag_res) => + if tag_res.error + deal_post(res,[]) + else + deal_post(res,tag_res) pageMain: -> limit = 15 query = """ + SELECT COUNT(*) as post_id, + NULL as title,NULL as body,NULL as date_published, + NULL as json_id, NULL as comments,NULL as votes + FROM post + UNION ALL + SELECT * FROM ( SELECT post.*, COUNT(comment_id) AS comments, (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes @@ -188,9 +381,10 @@ class ZeroBlog extends ZeroFrame GROUP BY post_id ORDER BY date_published DESC LIMIT #{(@page-1)*limit}, #{limit+1} + ) """ @cmd "dbQuery", [query], (res) => - parse_res = (res) => + parse_res = (res,tags) => s = (+ new Date) if res.length > limit # Has next page res.pop() @@ -198,8 +392,22 @@ class ZeroBlog extends ZeroFrame else @applyPagerdata(@page, limit, false) + @cmd "dbQuery", [query], (res) => + parse_res = (res,tags) => + total = res[0].post_id + res = res[1..] + s = (+ new Date) + + @applyPagerdata(@page, limit, total) + res.reverse() for post in res + post.tag =[] + + for tag in tags + if post.post_id == tag.post_id + post.tag.push(tag.value) + elem = $("#post_#{post.post_id}") if elem.length == 0 # Not exits yet elem = $(".post.template").clone().removeClass("template").attr("id", "post_#{post.post_id}") @@ -231,22 +439,37 @@ class ZeroBlog extends ZeroFrame @writeData(data) return false - # Temporary dbschema bug workaround - if res.error - query = """ - SELECT - post.*, COUNT(comment_id) AS comments, - -1 AS votes - FROM post - LEFT JOIN comment USING (post_id) - GROUP BY post_id - ORDER BY date_published DESC - LIMIT #{(@page-1)*limit}, #{limit+1} - """ - @cmd "dbQuery", [query], parse_res - else - parse_res(res) + tag_query = """ + SELECT tag.* FROM tag + LEFT JOIN ( + SELECT post_id FROM post + ORDER BY date_published DESC + LIMIT #{(@page-1)*limit}, #{limit+1} + ) AS post USING (post_id) + """ + + deal_post = (post_res,tag_res) -> + # Temporary dbschema bug workaround + if res.error + query = """ + SELECT + post.*, COUNT(comment_id) AS comments, + -1 AS votes + FROM post + LEFT JOIN comment USING (post_id) + GROUP BY post_id + ORDER BY date_published DESC + LIMIT #{(@page-1)*limit}, #{limit+1} + """ + @cmd "dbQuery", [query], (res)-> parse_res(res,tag_res) + else + parse_res(res,tag_res) + @cmd "dbQuery", [tag_query], (tag_res) -> + if tag_res.error + deal_post(res,[]) + else + deal_post(res,tag_res) # - EOF Pages - @@ -305,9 +528,28 @@ class ZeroBlog extends ZeroFrame return false # Ignore link default event + tagToHtml: (tag) => + if typeof tag is 'string' + #input parameter must not empty nor have duplicate + tag = tag.split(" ") + + if tag.length is 0 + ret = "not tagged" + else + ret = " " + for i in tag + ret+=(""+i+" ") + return ret # Apply from data to post html element applyPostdata: (elem, post, full=false) -> + #tag is passed as post property (to display tag links), + #but it's not saved to post.tag in json + #so must delete this property after use + tag=post.tag + if not tag + tag=[] + delete post.tag title_hash = post.title.replace(/[#?& ]/g, "+").replace(/[+]+/g, "+") elem.data("object", "Post:"+post.post_id) $(".title .editable", elem).html(post.title).attr("href", "?Post:#{post.post_id}:#{title_hash}").data("content", post.title) @@ -318,6 +560,12 @@ class ZeroBlog extends ZeroFrame date_published += " · #{Time.readtime(post.body)}" # If has break add readtime $(".more", elem).css("display", "inline-block").attr("href", "?Post:#{post.post_id}:#{title_hash}") $(".details .published", elem).html(date_published).data("content", post.date_published) + #$(".details .tag",elem).html(@tagToHtml(tag)) + # Temporary double tag bug workaround + if !$(".details .tag", elem).hasClass("tagged") + $(".details .tag", elem).addClass("tagged") + $(".details .tag", elem).append(@tagToHtml(tag)) + $(".details .tag",elem).data("content",(tag.join(" "))) # Comments num if post.comments > 0 $(".details .comments-num", elem).css("display", "inline").attr("href", "?Post:#{post.post_id}:#{title_hash}#Comments") @@ -423,12 +671,36 @@ class ZeroBlog extends ZeroFrame @cmd "fileGet", ["data/data.json"], (res) => data = JSON.parse(res) if type == "Post" - post = (post for post in data.post when post.post_id == id)[0] + changeKey=elem.data("editable") + #tag is maintained by data["tag"],not post["tag"] + #so must exclude tag property changes. + if changeKey != "tag" + post = (post for post in data.post when post.post_id == id)[0] - if elem.data("editable-mode") == "timestamp" # Time parse to timestamp - content = Time.timestamp(content) + if elem.data("editable-mode") == "timestamp" # Time parse to timestamp + content = Time.timestamp(content) - post[elem.data("editable")] = content + post[changeKey] = content + else + #db not allow duplicate tag of same post nor empty tag + temp = {} + dedup = [] + for val,idx in content.split(" ") + if val != "" + temp[val]=idx + for k,v of temp + dedup.push(k) + + if not data.tag + data.tag = [] + #exclude old tag + tag_index = (tag for tag in data.tag when tag.post_id != id) + data["tag"] = tag_index + #add new tag + for tag in dedup + data["tag"].push( + value:tag + post_id:id) else if type == "Site" data[elem.data("editable")] = content @@ -436,7 +708,10 @@ class ZeroBlog extends ZeroFrame if cb if res == true # OK @cleanupImages() - if elem.data("editable-mode") == "simple" # No markdown + if elem.data("editable") == "tag" + # tag list appears as links + cb($(".post.template span.tag").text() + @tagToHtml(dedup)) + else if elem.data("editable-mode") == "simple" # No markdown cb(content) else if elem.data("editable-mode") == "timestamp" # Format timestamp cb(Time.since(content)) @@ -477,6 +752,11 @@ class ZeroBlog extends ZeroFrame if type == "Post" post = (post for post in data.post when post.post_id == id)[0] if not post then return false # No post found for this id + if not data.tag + data.tag=[] + #remove all tag index from json + tag_index = (tag for tag in data.tag when tag.post_id != id) + data["tag"] = tag_index data.post.splice(data.post.indexOf(post), 1) # Remove from data @writeData data, (res) => diff --git a/js/all.js b/js/all.js index 782e97f..8e44942 100644 --- a/js/all.js +++ b/js/all.js @@ -1,6 +1,6 @@ -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/00-jquery.min.js ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/00-jquery.min.js ---- */ /*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ @@ -10,13 +10,13 @@ -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/highlight.pack.js ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/highlight.pack.js ---- */ !function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){var n=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return n=n.map(function(e){return e.replace(/^lang(uage)?-/,"")}),n.filter(function(e){return N(e)||/no(-?)highlight/.test(e)})[0]}function o(e,n){var t={};for(var r in e)t[r]=e[r];if(n)for(var r in n)t[r]=n[r];return t}function i(e){var n=[];return function r(e,a){for(var o=e.firstChild;o;o=o.nextSibling)3==o.nodeType?a+=o.nodeValue.length:1==o.nodeType&&(n.push({event:"start",offset:a,node:o}),a=r(o,a),t(o).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:o}));return a}(e,0),n}function c(e,r,a){function o(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function c(e){l+=""}function u(e){("start"==e.event?i:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=o();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=o();while(g==e&&g.length&&g[0].offset==s);f.reverse().forEach(i)}else"start"==g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function u(e){function n(e){return e&&e.source||e}function t(t,r){return RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var c={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");c[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):Object.keys(a.k).forEach(function(e){u(e,a.k[e])}),a.k=c}a.lR=t(a.l||/\b[A-Za-z0-9_]+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function s(e,t,a,o){function i(e,n){for(var t=0;t";return o+=e+'">',o+n+i}function d(){if(!w.k)return n(y);var e="",t=0;w.lR.lastIndex=0;for(var r=w.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(w,r);a?(B+=a[1],e+=p(a[0],n(r[0]))):e+=n(r[0]),t=w.lR.lastIndex,r=w.lR.exec(y)}return e+n(y.substr(t))}function h(){if(w.sL&&!R[w.sL])return n(y);var e=w.sL?s(w.sL,y,!0,L[w.sL]):l(y);return w.r>0&&(B+=e.r),"continuous"==w.subLanguageMode&&(L[w.sL]=e.top),p(e.language,e.value,!1,!0)}function v(){return void 0!==w.sL?h():d()}function b(e,t){var r=e.cN?p(e.cN,"",!0):"";e.rB?(M+=r,y=""):e.eB?(M+=n(t)+r,y=""):(M+=r,y=t),w=Object.create(e,{parent:{value:w}})}function m(e,t){if(y+=e,void 0===t)return M+=v(),0;var r=i(t,w);if(r)return M+=v(),b(r,t),r.rB?0:t.length;var a=c(w,t);if(a){var o=w;o.rE||o.eE||(y+=t),M+=v();do w.cN&&(M+=""),B+=w.r,w=w.parent;while(w!=a.parent);return o.eE&&(M+=n(t)),y="",a.starts&&b(a.starts,""),o.rE?0:t.length}if(f(t,w))throw new Error('Illegal lexeme "'+t+'" for mode "'+(w.cN||"")+'"');return y+=t,t.length||1}var x=N(e);if(!x)throw new Error('Unknown language: "'+e+'"');u(x);for(var w=o||x,L={},M="",k=w;k!=x;k=k.parent)k.cN&&(M=p(k.cN,"",!0)+M);var y="",B=0;try{for(var C,j,I=0;;){if(w.t.lastIndex=I,C=w.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}m(t.substr(I));for(var k=w;k.parent;k=k.parent)k.cN&&(M+="");return{r:B,value:M,language:e,top:w}}catch(A){if(-1!=A.message.indexOf("Illegal"))return{r:0,value:n(t)};throw A}}function l(e,t){t=t||E.languages||Object.keys(R);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(N(n)){var t=s(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function f(e){return E.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,E.tabReplace)})),E.useBR&&(e=e.replace(/\n/g,"
")),e}function g(e,n,t){var r=n?x[n]:t,a=[e.trim()];return e.match(/(\s|^)hljs(\s|$)/)||a.push("hljs"),r&&a.push(r),a.join(" ").trim()}function p(e){var n=a(e);if(!/no(-?)highlight/.test(n)){var t;E.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;var r=t.textContent,o=n?s(n,r,!0):l(r),u=i(t);if(u.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(u,i(p),r)}o.value=f(o.value),e.innerHTML=o.value,e.className=g(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){E=o(E,e)}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",h,!1),addEventListener("load",h,!1)}function b(n,t){var r=R[n]=t(e);r.aliases&&r.aliases.forEach(function(e){x[e]=n})}function m(){return Object.keys(R)}function N(e){return R[e]||R[x[e]]}var E={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},R={},x={};return e.highlight=s,e.highlightAuto=l,e.fixMarkup=f,e.highlightBlock=p,e.configure=d,e.initHighlighting=h,e.initHighlightingOnLoad=v,e.registerLanguage=b,e.listLanguages=m,e.getLanguage=N,e.inherit=o,e.IR="[a-zA-Z][a-zA-Z0-9_]*",e.UIR="[a-zA-Z_][a-zA-Z0-9_]*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.CLCM={cN:"comment",b:"//",e:"$",c:[e.PWM]},e.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[e.PWM]},e.HCM={cN:"comment",b:"#",e:"$",c:[e.PWM]},e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("cpp",function(t){var i={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginaryintmax_t uintmax_t int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_tint_least8_t uint_least8_t int_least16_t uint_least16_t int_least32_t uint_least32_tint_least64_t uint_least64_t int_fast8_t uint_fast8_t int_fast16_t uint_fast16_t int_fast32_tuint_fast32_t int_fast64_t uint_fast64_t intptr_t uintptr_t atomic_bool atomic_char atomic_scharatomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llongatomic_ullong atomic_wchar_t atomic_char16_t atomic_char32_t atomic_intmax_t atomic_uintmax_tatomic_intptr_t atomic_uintptr_t atomic_size_t atomic_ptrdiff_t atomic_int_least8_t atomic_int_least16_tatomic_int_least32_t atomic_int_least64_t atomic_uint_least8_t atomic_uint_least16_t atomic_uint_least32_tatomic_uint_least64_t atomic_int_fast8_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_tatomic_uint_fast8_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c","h","c++","h++"],k:i,i:""]',k:"include",i:"\\n"},t.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:i,c:["self"]},{b:t.IR+"::"},{bK:"new throw return",r:0},{cN:"function",b:"("+t.IR+"\\s+)+"+t.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:t.IR+"\\s*\\(",rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:i,r:0,c:[t.CBCM]},t.CLCM,t.CBCM]}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",c={cN:"yardoctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},s={cN:"comment",v:[{b:"#",e:"$",c:[c]},{b:"^\\=begin",e:"^\\=end",c:[c],r:10},{b:"^__END__",e:"\\n$"}]},n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},i={cN:"params",b:"\\(",e:"\\)",k:r},d=[t,a,s,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},s]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:b}),i,s]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,s,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];n.c=d,i.c=d;var l="[>?]>",u="[\\w#]+\\(\\w+\\):\\d+:\\d+>",N="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",o=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:d}},{cN:"prompt",b:"^("+l+"|"+u+"|"+N+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:[s].concat(o).concat(d)}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"tag",b:""},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("python",function(e){var r={cN:"prompt",b:/^(>>>|\.\.\.) /},b={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},l={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},c={cN:"params",b:/\(/,e:/\)/,c:["self",r,l,b]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[r,l,b,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n]/,c:[e.UTM,c]},{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("javascript",function(r){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",r:10,v:[{b:/^\s*('|")use strict('|")/},{b:/^\s*('|")use asm('|")/}]},r.ASM,r.QSM,r.CLCM,r.CBCM,r.CNM,{b:"("+r.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[r.CLCM,r.CBCM,r.RM,{b:/;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[r.inherit(r.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[r.CLCM,r.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+r.IR,r:0}]}});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",t={cN:"subst",b:/#\{/,e:/}/,k:c},r=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,t]},{b:/"/,e:/"/,c:[e.BE,t]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[t,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{cN:"property",b:"@"+n},{b:"`",e:"`",eB:!0,eE:!0,sL:"javascript"}];t.c=r;var i=e.inherit(e.TM,{b:n}),s="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(r)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:r.concat([{cN:"comment",b:"###",e:"###",c:[e.PWM]},e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+s,e:"[-=]>",rB:!0,c:[i,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:s,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[i]},i]},{cN:"attribute",b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("http",function(){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("};return{cI:!0,i:"[=/|']",c:[e.CBCM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[e.CBCM,{cN:"rule",b:"[^\\s]",rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});hljs.registerLanguage("ini",function(e){return{cI:!0,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:!0,k:"on off true false yes no",c:[e.QSM,e.NM],r:0}]}]}});hljs.registerLanguage("objectivec",function(e){var t={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSData NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView NSView NSViewController NSWindow NSWindowController NSSet NSUUID NSIndexSet UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection NSURLSession NSURLSessionDataTask NSURLSessionDownloadTask NSURLSessionUploadTask NSURLResponseUIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,a="@interface @class @protocol @implementation";return{aliases:["m","mm","objc","obj-c"],k:t,l:o,i:""}]}]},{cN:"class",b:"("+a.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:a,l:o,c:[e.UTM]},{cN:"variable",b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});hljs.registerLanguage("markdown",function(){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]}});hljs.registerLanguage("java",function(e){var a=e.UIR+"(<"+e.UIR+">)?",t="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",c="(\\b(0b[01_]+)|\\b0[xX][a-fA-F0-9_]+|(\\b[\\d_]+(\\.[\\d_]*)?|\\.[\\d_]+)([eE][-+]?\\d+)?)[lLfF]?",r={cN:"number",b:c,r:0};return{aliases:["jsp"],k:t,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return",r:0},{cN:"function",b:"("+a+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:t,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},r,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("diff",function(){return{aliases:["patch"],c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@][^\s\w{]/,r:0}]},o={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5},i=[e.BE,r,n],c=[n,e.HCM,o,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:!0},s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,o,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];return r.c=c,s.c=c,{aliases:["pl"],k:t,c:c}});hljs.registerLanguage("makefile",function(e){var a={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[a]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[e.QSM,a]}]}});hljs.registerLanguage("cs",function(e){var r="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long null object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async protected public private internal ascending descending from get group into join let orderby partial select set value var where yield",t=e.IR+"(<"+e.IR+">)?";return{aliases:["csharp"],k:r,i:/::/,c:[{cN:"comment",b:"///",e:"$",rB:!0,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:""},{b:""}]}]},e.CLCM,e.CBCM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},e.ASM,e.QSM,e.CNM,{bK:"class namespace interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"new return throw await",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("json",function(e){var t={literal:"true false null"},i=[e.QSM,e.CNM],l={cN:"value",e:",",eW:!0,eE:!0,c:i,k:t},c={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:l}],i:"\\S"},n={b:"\\[",e:"\\]",c:[e.inherit(l,{cN:null})],i:"\\S"};return i.splice(i.length,0,c,n),{c:i,k:t,i:"\\S"}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"title",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("sql",function(e){var t={cN:"comment",b:"--",e:"$"};return{cI:!0,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup",e:/;/,eW:!0,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage("xml",function(){var t="[A-Za-z0-9\\._:-]+",e={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},c={eW:!0,i:/]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[c],starts:{e:"",rE:!0,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[c],starts:{e:"",rE:!0,sL:"javascript"}},e,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},c]}]}});hljs.registerLanguage("php",function(e){var c={cN:"variable",b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"preprocessor",b:/<\?(php)?|\?>/},a={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},i]},{cN:"comment",b:"__halt_compiler.+?;",eW:!0,k:"__halt_compiler",l:e.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},i,c,{b:/->+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,a,n]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},a,n]}}); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/identicon.js ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/identicon.js ---- */ /** @@ -113,7 +113,7 @@ })(); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/jquery.cssanim.coffee ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/jquery.cssanim.coffee ---- */ (function() { @@ -186,7 +186,8 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/jquery.csslater.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/jquery.csslater.coffee ---- */ (function() { @@ -221,7 +222,7 @@ }; jQuery.fn.addClassLater = function(class_name, time, mode) { - var elem, timers, _base; + var base, elem, timers; if (time == null) { time = 5; } @@ -229,8 +230,8 @@ mode = "clear"; } elem = this; - if ((_base = elem[0]).timers == null) { - _base.timers = {}; + if ((base = elem[0]).timers == null) { + base.timers = {}; } timers = elem[0].timers; if (timers[class_name] && mode === "clear") { @@ -243,7 +244,7 @@ }; jQuery.fn.removeClassLater = function(class_name, time, mode) { - var elem, timers, _base; + var base, elem, timers; if (time == null) { time = 500; } @@ -251,8 +252,8 @@ mode = "clear"; } elem = this; - if ((_base = elem[0]).timers == null) { - _base.timers = {}; + if ((base = elem[0]).timers == null) { + base.timers = {}; } timers = elem[0].timers; if (timers[class_name] && mode === "clear") { @@ -265,7 +266,7 @@ }; jQuery.fn.cssLater = function(name, val, time, mode) { - var elem, timers, _base; + var base, elem, timers; if (time == null) { time = 500; } @@ -273,8 +274,8 @@ mode = "clear"; } elem = this; - if ((_base = elem[0]).timers == null) { - _base.timers = {}; + if ((base = elem[0]).timers == null) { + base.timers = {}; } timers = elem[0].timers; if (timers[name] && mode === "clear") { @@ -291,7 +292,7 @@ }; jQuery.fn.toggleClassLater = function(name, val, time, mode) { - var elem, timers, _base; + var base, elem, timers; if (time == null) { time = 10; } @@ -299,8 +300,8 @@ mode = "clear"; } elem = this; - if ((_base = elem[0]).timers == null) { - _base.timers = {}; + if ((base = elem[0]).timers == null) { + base.timers = {}; } timers = elem[0].timers; if (timers[name] && mode === "clear") { @@ -315,7 +316,8 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/marked.min.js ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/marked.min.js ---- */ /** @@ -326,7 +328,7 @@ (function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
"+(escaped?code:escape(code,true))+"\n
"}return'
'+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"
\n"+quote+"
\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/pnglib.js ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/pnglib.js ---- */ /** @@ -539,7 +541,7 @@ -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/zoom.min.js ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/zoom.min.js ---- */ /** @@ -825,12 +827,12 @@ -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Class.coffee ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Class.coffee ---- */ (function() { var Class, - __slice = [].slice; + slice = [].slice; Class = (function() { function Class() {} @@ -839,7 +841,7 @@ Class.prototype.log = function() { var args; - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + args = 1 <= arguments.length ? slice.call(arguments, 0) : []; if (!this.trace) { return; } @@ -853,23 +855,23 @@ Class.prototype.logStart = function() { var args, name; - name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + name = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; if (!this.trace) { return; } this.logtimers || (this.logtimers = {}); this.logtimers[name] = +(new Date); if (args.length > 0) { - this.log.apply(this, ["" + name].concat(__slice.call(args), ["(started)"])); + this.log.apply(this, ["" + name].concat(slice.call(args), ["(started)"])); } return this; }; Class.prototype.logEnd = function() { var args, ms, name; - name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + name = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; ms = +(new Date) - this.logtimers[name]; - this.log.apply(this, ["" + name].concat(__slice.call(args), ["(Done in " + ms + "ms)"])); + this.log.apply(this, ["" + name].concat(slice.call(args), ["(Done in " + ms + "ms)"])); return this; }; @@ -882,28 +884,29 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/CustomAlloyEditor.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/CustomAlloyEditor.coffee ---- */ (function() { var CustomAlloyEditor, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; - CustomAlloyEditor = (function(_super) { - __extends(CustomAlloyEditor, _super); + CustomAlloyEditor = (function(superClass) { + extend(CustomAlloyEditor, superClass); - function CustomAlloyEditor(_at_tag) { + function CustomAlloyEditor(tag) { var editor, el, height_added, height_before, style; - this.tag = _at_tag; - this.handleSelectionChange = __bind(this.handleSelectionChange, this); - this.handleChange = __bind(this.handleChange, this); - this.handleCommand = __bind(this.handleCommand, this); - this.handleAction = __bind(this.handleAction, this); - this.handleImageAdd = __bind(this.handleImageAdd, this); - this.getExtension = __bind(this.getExtension, this); - this.resizeImage = __bind(this.resizeImage, this); + this.tag = tag; + this.handleSelectionChange = bind(this.handleSelectionChange, this); + this.handleChange = bind(this.handleChange, this); + this.handleCommand = bind(this.handleCommand, this); + this.handleAction = bind(this.handleAction, this); + this.handleImageAdd = bind(this.handleImageAdd, this); + this.getExtension = bind(this.getExtension, this); + this.resizeImage = bind(this.resizeImage, this); editor = AlloyEditor.editable(this.tag); el = editor._editor.element.$; height_before = el.getClientRects()[0].height; @@ -961,10 +964,10 @@ }; CustomAlloyEditor.prototype.resizeImage = function(image, width, height) { - var canvas, ctx, image_base64uri, image_resized, _ref; + var canvas, ctx, image_base64uri, image_resized, ref; canvas = document.createElement("canvas"); if (this.image_preverse_ratio) { - _ref = this.calcSize(image.width, image.height, width, height), canvas.width = _ref[0], canvas.height = _ref[1]; + ref = this.calcSize(image.width, image.height, width, height), canvas.width = ref[0], canvas.height = ref[1]; } else { canvas.width = width; canvas.height = height; @@ -1006,7 +1009,7 @@ }; CustomAlloyEditor.prototype.handleImageAdd = function(e) { - var height, image_base64uri, name, width, _ref; + var height, image_base64uri, name, ref, width; if (e.data.file.name) { name = e.data.file.name.replace(/[^\w\.-]/gi, "_"); } else { @@ -1015,7 +1018,7 @@ e.data.el.$.style.maxWidth = "2400px"; if (e.data.file.size > this.image_size_limit) { this.log("File size " + e.data.file.size + " larger than allowed " + this.image_size_limit + ", resizing..."); - _ref = this.resizeImage(e.data.el.$, this.image_resize_width, this.image_resize_height), image_base64uri = _ref[0], width = _ref[1], height = _ref[2]; + ref = this.resizeImage(e.data.el.$, this.image_resize_width, this.image_resize_height), image_base64uri = ref[0], width = ref[1], height = ref[2]; e.data.el.$.src = image_base64uri; name = name.replace(/(png|gif|jpg)/, this.getExtension(image_base64uri)); } else { @@ -1138,38 +1141,38 @@ -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Follow.coffee ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Follow.coffee ---- */ (function() { var Follow, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Follow = (function(_super) { - __extends(Follow, _super); - - function Follow(_at_elem) { - this.elem = _at_elem; - this.handleMenuClick = __bind(this.handleMenuClick, this); - this.init = __bind(this.init, this); + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty, + indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + Follow = (function(superClass) { + extend(Follow, superClass); + + function Follow(elem) { + this.elem = elem; + this.handleMenuClick = bind(this.handleMenuClick, this); + this.init = bind(this.init, this); this.menu = new Menu(this.elem); this.feeds = {}; this.follows = {}; this.elem.off("click"); this.elem.on("click", (function(_this) { return function() { - var is_default_feed, menu_item, param, query, title, _ref, _ref1; + var is_default_feed, menu_item, param, query, ref, ref1, title; if (Page.server_info.rev > 850) { if (_this.elem.hasClass("following")) { _this.showFeeds(); } else { _this.followDefaultFeeds(); - _ref = _this.feeds; - for (title in _ref) { - _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; + ref = _this.feeds; + for (title in ref) { + ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; if (!menu_item.hasClass("selected")) { _this.showFeeds(); break; @@ -1189,13 +1192,13 @@ return; } Page.cmd("feedListFollow", [], (function(_this) { - return function(_at_follows) { - var is_default_feed, menu_item, param, query, title, _ref, _ref1; - _this.follows = _at_follows; - _ref = _this.feeds; - for (title in _ref) { - _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; - if (_this.follows[title] && __indexOf.call(_this.follows[title][1], param) >= 0) { + return function(follows1) { + var is_default_feed, menu_item, param, query, ref, ref1, title; + _this.follows = follows1; + ref = _this.feeds; + for (title in ref) { + ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; + if (_this.follows[title] && indexOf.call(_this.follows[title][1], param) >= 0) { menu_item.addClass("selected"); } else { menu_item.removeClass("selected"); @@ -1238,10 +1241,10 @@ }; Follow.prototype.followDefaultFeeds = function() { - var is_default_feed, menu_item, param, query, title, _ref, _ref1; - _ref = this.feeds; - for (title in _ref) { - _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; + var is_default_feed, menu_item, param, query, ref, ref1, title; + ref = this.feeds; + for (title in ref) { + ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; if (is_default_feed) { menu_item.addClass("selected"); this.log("Following", title, menu_item); @@ -1262,23 +1265,23 @@ Follow.prototype.saveFeeds = function() { return Page.cmd("feedListFollow", [], (function(_this) { return function(follows) { - var is_default_feed, item, menu_item, param, params, query, title, _ref, _ref1; + var is_default_feed, item, menu_item, param, params, query, ref, ref1, title; _this.follows = follows; - _ref = _this.feeds; - for (title in _ref) { - _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; + ref = _this.feeds; + for (title in ref) { + ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; if (follows[title]) { params = (function() { - var _i, _len, _ref2, _results; - _ref2 = follows[title][1]; - _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - item = _ref2[_i]; + var i, len, ref2, results; + ref2 = follows[title][1]; + results = []; + for (i = 0, len = ref2.length; i < len; i++) { + item = ref2[i]; if (item !== param) { - _results.push(item); + results.push(item); } } - return _results; + return results; })(); } else { params = []; @@ -1306,25 +1309,26 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/InlineEditor.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/InlineEditor.coffee ---- */ (function() { var InlineEditor, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; InlineEditor = (function() { - function InlineEditor(_at_elem, _at_getContent, _at_saveContent, _at_getObject) { - this.elem = _at_elem; - this.getContent = _at_getContent; - this.saveContent = _at_saveContent; - this.getObject = _at_getObject; - this.cancelEdit = __bind(this.cancelEdit, this); - this.deleteObject = __bind(this.deleteObject, this); - this.saveEdit = __bind(this.saveEdit, this); - this.stopEdit = __bind(this.stopEdit, this); - this.handleImageSave = __bind(this.handleImageSave, this); - this.startEdit = __bind(this.startEdit, this); + function InlineEditor(elem1, getContent, saveContent, getObject) { + this.elem = elem1; + this.getContent = getContent; + this.saveContent = saveContent; + this.getObject = getObject; + this.cancelEdit = bind(this.cancelEdit, this); + this.deleteObject = bind(this.deleteObject, this); + this.saveEdit = bind(this.saveEdit, this); + this.stopEdit = bind(this.stopEdit, this); + this.handleImageSave = bind(this.handleImageSave, this); + this.startEdit = bind(this.startEdit, this); this.edit_button = $("
    "); this.edit_button.on("click", this.startEdit); this.elem.addClass("editable").before(this.edit_button); @@ -1353,7 +1357,7 @@ } InlineEditor.prototype.startEdit = function() { - var _i, _results; + var j, results; this.content_before = this.elem.html(); if (this.elem.data("editable-mode") === "meditor") { this.editor = new Meditor(this.elem[0], this.getContent(this.elem, "raw")); @@ -1364,9 +1368,9 @@ this.editor.val(this.getContent(this.elem, "raw")); this.elem.after(this.editor); this.elem.html((function() { - _results = []; - for (_i = 1; _i <= 50; _i++){ _results.push(_i); } - return _results; + results = []; + for (j = 1; j <= 50; j++){ results.push(j); } + return results; }).apply(this).join("fill the width")); this.copyStyle(this.elem, this.editor); this.elem.html(this.content_before); @@ -1526,26 +1530,27 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Meditor.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Meditor.coffee ---- */ (function() { var Meditor, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - - Meditor = (function(_super) { - __extends(Meditor, _super); - - function Meditor(_at_tag_original, body) { - this.tag_original = _at_tag_original; - this.val = __bind(this.val, this); - this.remove = __bind(this.remove, this); - this.save = __bind(this.save, this); - this.handleEditmodeChange = __bind(this.handleEditmodeChange, this); - this.handleEditorLoad = __bind(this.handleEditorLoad, this); - this.load = __bind(this.load, this); + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + Meditor = (function(superClass) { + extend(Meditor, superClass); + + function Meditor(tag_original, body) { + this.tag_original = tag_original; + this.val = bind(this.val, this); + this.remove = bind(this.remove, this); + this.save = bind(this.save, this); + this.handleEditmodeChange = bind(this.handleEditmodeChange, this); + this.handleEditorLoad = bind(this.handleEditorLoad, this); + this.load = bind(this.load, this); this.log("Create", this); this.tag_original.insertAdjacentHTML('beforeBegin', "
    "); this.tag_container = this.tag_original.previousSibling; @@ -1686,16 +1691,17 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Menu.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Menu.coffee ---- */ (function() { var Menu, - __slice = [].slice; + slice = [].slice; Menu = (function() { - function Menu(_at_button) { - this.button = _at_button; + function Menu(button) { + this.button = button; this.elem = $(".menu.template").clone().removeClass("template"); this.elem.appendTo("body"); this.items = []; @@ -1746,8 +1752,8 @@ Menu.prototype.log = function() { var args; - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return console.log.apply(console, ["[Menu]"].concat(__slice.call(args))); + args = 1 <= arguments.length ? slice.call(arguments, 0) : []; + return console.log.apply(console, ["[Menu]"].concat(slice.call(args))); }; return Menu; @@ -1765,7 +1771,8 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/RateLimit.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/RateLimit.coffee ---- */ (function() { @@ -1794,17 +1801,18 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Text.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Text.coffee ---- */ (function() { var Renderer, Text, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - Renderer = (function(_super) { - __extends(Renderer, _super); + Renderer = (function(superClass) { + extend(Renderer, superClass); function Renderer() { return Renderer.__super__.constructor.apply(this, arguments); @@ -1820,13 +1828,13 @@ Text = (function() { function Text() { - this.toUrl = __bind(this.toUrl, this); + this.toUrl = bind(this.toUrl, this); } Text.prototype.toColor = function(text) { - var color, hash, i, _i, _ref; + var color, hash, i, j, ref; hash = 0; - for (i = _i = 0, _ref = text.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) { + for (i = j = 0, ref = text.length - 1; 0 <= ref ? j <= ref : j >= ref; i = 0 <= ref ? ++j : --j) { hash = text.charCodeAt(i) + ((hash << 5) - hash); } color = '#'; @@ -1879,7 +1887,8 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Time.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Time.coffee ---- */ (function() { @@ -1951,23 +1960,24 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/ZeroFrame.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/ZeroFrame.coffee ---- */ (function() { var ZeroFrame, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; - ZeroFrame = (function(_super) { - __extends(ZeroFrame, _super); + ZeroFrame = (function(superClass) { + extend(ZeroFrame, superClass); function ZeroFrame(url) { - this.onCloseWebsocket = __bind(this.onCloseWebsocket, this); - this.onOpenWebsocket = __bind(this.onOpenWebsocket, this); - this.onRequest = __bind(this.onRequest, this); - this.onMessage = __bind(this.onMessage, this); + this.onCloseWebsocket = bind(this.onCloseWebsocket, this); + this.onOpenWebsocket = bind(this.onOpenWebsocket, this); + this.onRequest = bind(this.onRequest, this); + this.onMessage = bind(this.onMessage, this); this.url = url; this.waiting_cb = {}; this.wrapper_nonce = document.location.href.replace(/.*wrapper_nonce=([A-Za-z0-9]+).*/, "$1"); @@ -2064,16 +2074,17 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/Comments.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/Comments.coffee ---- */ (function() { var Comments, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; - Comments = (function(_super) { - __extends(Comments, _super); + Comments = (function(superClass) { + extend(Comments, superClass); function Comments() { return Comments.__super__.constructor.apply(this, arguments); @@ -2116,10 +2127,10 @@ query = "SELECT comment.*, json_content.json_id AS content_json_id, keyvalue.value AS cert_user_id, json.directory, (SELECT COUNT(*) FROM comment_vote WHERE comment_vote.comment_uri = comment.comment_id || '@' || json.directory)+1 AS votes FROM comment LEFT JOIN json USING (json_id) LEFT JOIN json AS json_content ON (json_content.directory = json.directory AND json_content.file_name='content.json') LEFT JOIN keyvalue ON (keyvalue.json_id = json_content.json_id AND key = 'cert_user_id') WHERE post_id = " + this.post_id + " ORDER BY date_added DESC"; return Page.cmd("dbQuery", query, (function(_this) { return function(comments) { - var comment, comment_address, elem, user_address, _i, _len; + var comment, comment_address, elem, i, len, user_address; $("#Comments").text(comments.length + (comments.length > 1 ? " Comments:" : " Comment:")); - for (_i = 0, _len = comments.length; _i < _len; _i++) { - comment = comments[_i]; + for (i = 0, len = comments.length; i < len; i++) { + comment = comments[i]; user_address = comment.directory.replace("users/", ""); comment_address = comment.comment_id + "_" + user_address; elem = $("#comment_" + comment_address); @@ -2143,8 +2154,8 @@ }; Comments.prototype.applyCommentData = function(elem, comment) { - var cert_domain, user_address, user_name, _ref; - _ref = comment.cert_user_id.split("@"), user_name = _ref[0], cert_domain = _ref[1]; + var cert_domain, ref, user_address, user_name; + ref = comment.cert_user_id.split("@"), user_name = ref[0], cert_domain = ref[1]; user_address = comment.directory.replace("users/", ""); $(".comment-body", elem).html(Text.renderMarked(comment.body, { "sanitize": true @@ -2306,6 +2317,11 @@ } }; + Comments.prototype.hide = function() { + $(".comment").hide(); + return $("#Comments").hide(); + }; + return Comments; })(Class); @@ -2315,28 +2331,30 @@ }).call(this); -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/ZeroBlog.coffee ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/ZeroBlog.coffee ---- */ (function() { var ZeroBlog, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; - ZeroBlog = (function(_super) { - __extends(ZeroBlog, _super); + ZeroBlog = (function(superClass) { + extend(ZeroBlog, superClass); function ZeroBlog() { - this.setSiteinfo = __bind(this.setSiteinfo, this); - this.actionSetSiteInfo = __bind(this.actionSetSiteInfo, this); - this.submitPostVote = __bind(this.submitPostVote, this); - this.saveContent = __bind(this.saveContent, this); - this.getContent = __bind(this.getContent, this); - this.getObject = __bind(this.getObject, this); - this.onOpenWebsocket = __bind(this.onOpenWebsocket, this); - this.publish = __bind(this.publish, this); - this.pageLoaded = __bind(this.pageLoaded, this); + this.setSiteinfo = bind(this.setSiteinfo, this); + this.actionSetSiteInfo = bind(this.actionSetSiteInfo, this); + this.submitPostVote = bind(this.submitPostVote, this); + this.saveContent = bind(this.saveContent, this); + this.getContent = bind(this.getContent, this); + this.getObject = bind(this.getObject, this); + this.onOpenWebsocket = bind(this.onOpenWebsocket, this); + this.tagToHtml = bind(this.tagToHtml, this); + this.publish = bind(this.publish, this); + this.pageLoaded = bind(this.pageLoaded, this); return ZeroBlog.__super__.constructor.apply(this, arguments); } @@ -2399,11 +2417,11 @@ } return this.cmd("dbQuery", [query], (function(_this) { return function(res) { - var row, _i, _len; + var j, len, row; _this.data = {}; if (res) { - for (_i = 0, _len = res.length; _i < _len; _i++) { - row = res[_i]; + for (j = 0, len = res.length; j < len; j++) { + row = res[j]; _this.data[row.key] = row.value; } if (_this.data.title) { @@ -2413,7 +2431,10 @@ $(".left h2").html(Text.renderMarked(_this.data.description)).data("content", _this.data.description); } if (_this.data.links) { - return $(".left .links").html(Text.renderMarked(_this.data.links)).data("content", _this.data.links); + $(".left .links").html(Text.renderMarked(_this.data.links)).data("content", _this.data.links); + } + if (_this.data.footer) { + return $(".footer h4").html(Text.renderMarked(_this.data.footer)).data("content", _this.data.footer); } } }; @@ -2431,13 +2452,13 @@ query = "SELECT comment.*, json_content.json_id AS content_json_id, keyvalue.value AS cert_user_id, json.directory, post.title AS post_title FROM comment LEFT JOIN json USING (json_id) LEFT JOIN json AS json_content ON (json_content.directory = json.directory AND json_content.file_name='content.json') LEFT JOIN keyvalue ON (keyvalue.json_id = json_content.json_id AND key = 'cert_user_id') LEFT JOIN post ON (comment.post_id = post.post_id) WHERE post.title IS NOT NULL ORDER BY date_added DESC LIMIT 3"; return this.cmd("dbQuery", [query], (function(_this) { return function(res) { - var elem, lastcomment, _i, _len; + var elem, j, lastcomment, len; if (res.length) { $(".lastcomments").css("display", "block"); res.reverse(); } - for (_i = 0, _len = res.length; _i < _len; _i++) { - lastcomment = res[_i]; + for (j = 0, len = res.length; j < len; j++) { + lastcomment = res[j]; elem = $("#lastcomment_" + lastcomment.json_id + "_" + lastcomment.comment_id); if (elem.length === 0) { elem = $(".lastcomment.template").clone().removeClass("template").attr("id", "lastcomment_" + lastcomment.json_id + "_" + lastcomment.comment_id); @@ -2488,6 +2509,8 @@ $("body").addClass("page-post"); this.post_id = parseInt(match[1]); return this.pagePost(); + } else if (match = url.match(/Toc=(.*)/)) { + return this.pageToc(match[1]); } else { $("body").addClass("page-main"); if (match = url.match(/page=([0-9]+)/)) { @@ -2497,16 +2520,175 @@ } }; + ZeroBlog.prototype.pageToc = function(tocType) { + $("body").addClass("page-post"); + if (tocType.match(/^dateDesc/)) { + this.pageTocDateDesc(); + } else if (tocType.match(/^tagAll/)) { + this.pageTocTagAll(); + } else if (tocType.match(/^tag/)) { + this.pageTocByTag(tocType.split("&")[0].substring(3)); + } + this.pageLoaded(); + $(".post .details").hide(); + $(".editable-edit").hide(); + return Comments.hide(); + }; + + ZeroBlog.prototype.emptyTocPage = function(title, body) { + return this.applyPostdata($(".post-full"), { + title: title, + post_id: -1, + votes: -1, + comments: -1, + body: body + }, true); + }; + + ZeroBlog.prototype.pageTocByTag = function(tagType) { + var queryString, tag; + queryString = ""; + tag = ""; + if (tagType.match(/^None/)) { + tag = "all untagged"; + queryString = "SELECT date_published,title,post_id FROM post\nWHERE post_id NOT IN (SELECT DISTINCT (post_id) FROM tag)\nORDER BY date_published DESC"; + } else { + tag = decodeURIComponent(tagType.substring(1)); + this.log("Toc by tag:", tag); + queryString = "SELECT post.date_published AS date_published,\npost_id,post.title AS title FROM tag\nJOIN (SELECT date_published,title,post_id FROM post) AS post\nUSING (post_id) WHERE value=\"" + tag + "\"\nORDER BY date_published DESC"; + } + return this.cmd("dbQuery", [queryString], (function(_this) { + return function(res) { + var parse_res; + parse_res = function(res) { + var date, i, j, len, markdown; + if (res.length === 0) { + _this.emptyTocPage("" + tag, "no posts found"); + return; + } + markdown = ""; + for (j = 0, len = res.length; j < len; j++) { + i = res[j]; + date = new Date(i.date_published * 1000); + markdown += "- [" + (date.getFullYear()) + "-" + (date.getMonth() + 1) + "-" + (date.getDate()) + ":" + i.title + "](?Post:" + i.post_id + ")\n"; + } + return _this.applyPostdata($(".post-full"), { + title: "posts of tag:" + tag, + post_id: -1, + votes: -1, + comments: -1, + body: markdown + }, true); + }; + if (res.error) { + return _this.emptyTocPage("error when getting index", "error when getting index"); + } else { + return parse_res(res); + } + }; + })(this)); + }; + + ZeroBlog.prototype.pageTocTagAll = function() { + return this.cmd("dbQuery", ["SELECT \"all\" AS value,COUNT(*) AS count FROM post\nUNION ALL\nSELECT \"tagged\" AS value,COUNT(DISTINCT post_id) AS count\nFROM tag\nUNION ALL\nSELECT value, COUNT(post_id)\nFROM tag GROUP BY value ORDER BY count DESC"], (function(_this) { + return function(res) { + var parse_res; + parse_res = function(res) { + var escaped, j, len, markdown, one, tagged, total_post, untagged; + total_post = res[0].count; + if (total_post === 0) { + emptyTocPage("no post", "no post at all"); + return; + } + markdown = ""; + tagged = res.slice(2); + if (tagged.length > 0) { + markdown += "Tagged:\n\n"; + } + for (j = 0, len = tagged.length; j < len; j++) { + one = tagged[j]; + escaped = encodeURIComponent(one.value); + markdown += "[" + one.value + ": " + one.count + " post(s)](?Toc=tag:" + escaped + ")\n"; + } + untagged = total_post - res[1].count; + if (untagged !== 0) { + markdown += "\n[Untagged: " + untagged + " post(s)](?Toc=tagNone)"; + } + return _this.applyPostdata($(".post-full"), { + title: "index by tag", + post_id: -1, + votes: -1, + comments: -1, + body: markdown + }, true); + }; + if (res.error) { + return _this.emptyTocPage("error when getting index", "sorry, error happened"); + } else { + return parse_res(res); + } + }; + })(this)); + }; + + ZeroBlog.prototype.pageTocDateDesc = function() { + this.log("Toc by date desc"); + return this.cmd("dbQuery", ["SELECT post_id,date_published,title FROM post ORDER BY date_published DESC"], (function(_this) { + return function(res) { + var parse_res; + parse_res = function(res) { + var j, len, markdown, month, post, post_date; + if (res.length === 0) { + _this.emptyTocPage("no post", "no post at all"); + return; + } + month = new Date(new Date().getTime() + 31 * 24 * 60 * 60 * 1000); + markdown = ""; + for (j = 0, len = res.length; j < len; j++) { + post = res[j]; + post_date = new Date(post.date_published * 1000); + if (post_date < month) { + month = new Date(post_date); + month.setDate(1); + month.setHours(0); + month.setMinutes(0); + month.setSeconds(0); + markdown += "\n" + month.getFullYear() + " " + (month.getMonth() + 1) + "\n"; + } + markdown += "- [" + post_date.getDate() + " :" + post.title + ("](?Post:" + post.post_id + ")\n"); + } + return _this.applyPostdata($(".post-full"), { + title: "index by date", + post_id: -1, + votes: -1, + comments: -1, + body: markdown + }, true); + }; + if (res.error) { + return _this.emptyTocPage("error", "error while getting index"); + } else { + return parse_res(res); + } + }; + })(this)); + }; + ZeroBlog.prototype.pagePost = function() { var s; s = +(new Date); return this.cmd("dbQuery", ["SELECT *, (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes FROM post WHERE post_id = " + this.post_id + " LIMIT 1"], (function(_this) { return function(res) { - var parse_res; - parse_res = function(res) { - var post; + var deal_post, parse_res, tag_query; + parse_res = function(res, tag_res) { + var j, len, post, tag; if (res.length) { post = res[0]; + post.tag = []; + for (j = 0, len = tag_res.length; j < len; j++) { + tag = tag_res[j]; + post.tag.push(tag.value); + } _this.applyPostdata($(".post-full"), post, true); $(".post-full").css("display", "block"); $(".post-full .like").attr("id", "post_like_" + post.post_id).off("click").off("click").on("click", _this.submitPostVote); @@ -2519,11 +2701,23 @@ _this.pageLoaded(); return Comments.checkCert(); }; - if (res.error) { - return _this.cmd("dbQuery", ["SELECT *, -1 AS votes FROM post WHERE post_id = " + _this.post_id + " LIMIT 1"], parse_res); - } else { - return parse_res(res); - } + tag_query = "SELECT value FROM tag\nWHERE post_id=" + _this.post_id; + deal_post = function(post_res, tag_res) { + if (res.error) { + return _this.cmd("dbQuery", ["SELECT *, -1 AS votes FROM post WHERE post_id = " + _this.post_id + " LIMIT 1"], function(res) { + return parse_res(res, tag_res); + }); + } else { + return parse_res(res, tag_res); + } + }; + return _this.cmd("dbQuery", [tag_query], function(tag_res) { + if (tag_res.error) { + return deal_post(res, []); + } else { + return deal_post(res, tag_res); + } + }); }; })(this)); }; @@ -2531,22 +2725,41 @@ ZeroBlog.prototype.pageMain = function() { var limit, query; limit = 15; - query = "SELECT\n post.*, COUNT(comment_id) AS comments,\n (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((this.page - 1) * limit) + ", " + (limit + 1); - return this.cmd("dbQuery", [query], (function(_this) { + query = "SELECT COUNT(*) as post_id,\n NULL as title,NULL as body,NULL as date_published,\n NULL as json_id, NULL as comments,NULL as votes\nFROM post\nUNION ALL\nSELECT * FROM (\nSELECT\n post.*, COUNT(comment_id) AS comments,\n (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((this.page - 1) * limit) + ", " + (limit + 1) + "\n)"; + this.cmd("dbQuery", [query], (function(_this) { return function(res) { var parse_res; - parse_res = function(res) { - var elem, post, s, _i, _len; + return parse_res = function(res, tags) { + var s; s = +(new Date); if (res.length > limit) { res.pop(); - _this.applyPagerdata(_this.page, limit, true); + return _this.applyPagerdata(_this.page, limit, true); } else { - _this.applyPagerdata(_this.page, limit, false); + return _this.applyPagerdata(_this.page, limit, false); } + }; + }; + })(this)); + return this.cmd("dbQuery", [query], (function(_this) { + return function(res) { + var deal_post, parse_res, tag_query; + parse_res = function(res, tags) { + var elem, j, l, len, len1, post, s, tag, total; + total = res[0].post_id; + res = res.slice(1); + s = +(new Date); + _this.applyPagerdata(_this.page, limit, total); res.reverse(); - for (_i = 0, _len = res.length; _i < _len; _i++) { - post = res[_i]; + for (j = 0, len = res.length; j < len; j++) { + post = res[j]; + post.tag = []; + for (l = 0, len1 = tags.length; l < len1; l++) { + tag = tags[l]; + if (post.post_id === tag.post_id) { + post.tag.push(tag.value); + } + } elem = $("#post_" + post.post_id); if (elem.length === 0) { elem = $(".post.template").clone().removeClass("template").attr("id", "post_" + post.post_id); @@ -2578,12 +2791,24 @@ return false; }); }; - if (res.error) { - query = "SELECT\n post.*, COUNT(comment_id) AS comments,\n -1 AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((_this.page - 1) * limit) + ", " + (limit + 1); - return _this.cmd("dbQuery", [query], parse_res); - } else { - return parse_res(res); - } + tag_query = "SELECT tag.* FROM tag\nLEFT JOIN (\nSELECT post_id FROM post\nORDER BY date_published DESC\nLIMIT " + ((_this.page - 1) * limit) + ", " + (limit + 1) + "\n) AS post USING (post_id)"; + deal_post = function(post_res, tag_res) { + if (res.error) { + query = "SELECT\n post.*, COUNT(comment_id) AS comments,\n -1 AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((this.page - 1) * limit) + ", " + (limit + 1); + return this.cmd("dbQuery", [query], function(res) { + return parse_res(res, tag_res); + }); + } else { + return parse_res(res, tag_res); + } + }; + return _this.cmd("dbQuery", [tag_query], function(tag_res) { + if (tag_res.error) { + return deal_post(res, []); + } else { + return deal_post(res, tag_res); + } + }); }; })(this)); }; @@ -2598,11 +2823,11 @@ }; ZeroBlog.prototype.addInlineEditors = function(parent) { - var editor, elem, elems, _i, _len; + var editor, elem, elems, j, len; this.logStart("Adding inline editors"); elems = $("[data-editable]:visible", parent); - for (_i = 0, _len = elems.length; _i < _len; _i++) { - elem = elems[_i]; + for (j = 0, len = elems.length; j < len; j++) { + elem = elems[j]; elem = $(elem); if (!elem.data("editor") && !elem.hasClass("editor")) { editor = new InlineEditor(elem, this.getContent, this.saveContent, this.getObject); @@ -2616,9 +2841,9 @@ return $("img", parent).each((function(_this) { return function(i, img_elem) { img_elem.onload = function() { - var size, _ref; + var ref, size; img_elem = $(img_elem); - size = (_ref = img_elem.attr("alt")) != null ? _ref.match("([0-9]+)x([0-9]+)") : void 0; + size = (ref = img_elem.attr("alt")) != null ? ref.match("([0-9]+)x([0-9]+)") : void 0; if (!size) { return; } @@ -2663,11 +2888,33 @@ return false; }; + ZeroBlog.prototype.tagToHtml = function(tag) { + var i, j, len, ret; + if (typeof tag === 'string') { + tag = tag.split(" "); + } + if (tag.length === 0) { + ret = "not tagged"; + } else { + ret = " "; + for (j = 0, len = tag.length; j < len; j++) { + i = tag[j]; + ret += "" + i + " "; + } + } + return ret; + }; + ZeroBlog.prototype.applyPostdata = function(elem, post, full) { - var body, date_published, title_hash; + var body, date_published, tag, title_hash; if (full == null) { full = false; } + tag = post.tag; + if (!tag) { + tag = []; + } + delete post.tag; title_hash = post.title.replace(/[#?& ]/g, "+").replace(/[+]+/g, "+"); elem.data("object", "Post:" + post.post_id); $(".title .editable", elem).html(post.title).attr("href", "?Post:" + post.post_id + ":" + title_hash).data("content", post.title); @@ -2678,6 +2925,11 @@ $(".more", elem).css("display", "inline-block").attr("href", "?Post:" + post.post_id + ":" + title_hash); } $(".details .published", elem).html(date_published).data("content", post.date_published); + if (!$(".details .tag", elem).hasClass("tagged")) { + $(".details .tag", elem).addClass("tagged"); + $(".details .tag", elem).append(this.tagToHtml(tag)); + } + $(".details .tag", elem).data("content", tag.join(" ")); if (post.comments > 0) { $(".details .comments-num", elem).css("display", "inline").attr("href", "?Post:" + post.post_id + ":" + title_hash + "#Comments"); if (post.comments > 1) { @@ -2732,9 +2984,9 @@ _this.setSiteinfo(site_info); query_my_votes = "SELECT\n 'post_vote' AS type,\n post_id AS uri\nFROM json\nLEFT JOIN post_vote USING (json_id)\nWHERE directory = 'users/" + _this.site_info.auth_address + "' AND file_name = 'data.json'"; _this.cmd("dbQuery", [query_my_votes], function(res) { - var row, _i, _len; - for (_i = 0, _len = res.length; _i < _len; _i++) { - row = res[_i]; + var j, len, row; + for (j = 0, len = res.length; j < len; j++) { + row = res[j]; _this.my_post_votes[row["uri"]] = 1; } return _this.routeUrl(window.location.search.substring(1)); @@ -2755,11 +3007,11 @@ }; ZeroBlog.prototype.getContent = function(elem, raw) { - var content, id, type, _ref; + var content, id, ref, type; if (raw == null) { raw = false; } - _ref = this.getObject(elem).data("object").split(":"), type = _ref[0], id = _ref[1]; + ref = this.getObject(elem).data("object").split(":"), type = ref[0], id = ref[1]; id = parseInt(id); content = elem.data("content"); if (elem.data("editable-mode") === "timestamp") { @@ -2773,7 +3025,7 @@ }; ZeroBlog.prototype.saveContent = function(elem, content, cb) { - var id, type, _ref; + var id, ref, type; if (cb == null) { cb = false; } @@ -2785,7 +3037,7 @@ } else { elem.data("content", content); } - _ref = this.getObject(elem).data("object").split(":"), type = _ref[0], id = _ref[1]; + ref = this.getObject(elem).data("object").split(":"), type = ref[0], id = ref[1]; id = parseInt(id); if (type === "Post" || type === "Site") { return this.saveSite(elem, type, id, content, cb); @@ -2797,25 +3049,65 @@ ZeroBlog.prototype.saveSite = function(elem, type, id, content, cb) { return this.cmd("fileGet", ["data/data.json"], (function(_this) { return function(res) { - var data, post; + var changeKey, data, dedup, idx, j, k, l, len, len1, post, ref, tag, tag_index, temp, v, val; data = JSON.parse(res); if (type === "Post") { - post = ((function() { - var _i, _len, _ref, _results; - _ref = data.post; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - post = _ref[_i]; - if (post.post_id === id) { - _results.push(post); + changeKey = elem.data("editable"); + if (changeKey !== "tag") { + post = ((function() { + var j, len, ref, results; + ref = data.post; + results = []; + for (j = 0, len = ref.length; j < len; j++) { + post = ref[j]; + if (post.post_id === id) { + results.push(post); + } } + return results; + })())[0]; + if (elem.data("editable-mode") === "timestamp") { + content = Time.timestamp(content); + } + post[changeKey] = content; + } else { + temp = {}; + dedup = []; + ref = content.split(" "); + for (idx = j = 0, len = ref.length; j < len; idx = ++j) { + val = ref[idx]; + if (val !== "") { + temp[val] = idx; + } + } + for (k in temp) { + v = temp[k]; + dedup.push(k); + } + if (!data.tag) { + data.tag = []; + } + tag_index = (function() { + var l, len1, ref1, results; + ref1 = data.tag; + results = []; + for (l = 0, len1 = ref1.length; l < len1; l++) { + tag = ref1[l]; + if (tag.post_id !== id) { + results.push(tag); + } + } + return results; + })(); + data["tag"] = tag_index; + for (l = 0, len1 = dedup.length; l < len1; l++) { + tag = dedup[l]; + data["tag"].push({ + value: tag, + post_id: id + }); } - return _results; - })())[0]; - if (elem.data("editable-mode") === "timestamp") { - content = Time.timestamp(content); } - post[elem.data("editable")] = content; } else if (type === "Site") { data[elem.data("editable")] = content; } @@ -2823,7 +3115,9 @@ if (cb) { if (res === true) { _this.cleanupImages(); - if (elem.data("editable-mode") === "simple") { + if (elem.data("editable") === "tag") { + return cb($(".post.template span.tag").text() + _this.tagToHtml(dedup)); + } else if (elem.data("editable-mode") === "simple") { return cb(content); } else if (elem.data("editable-mode") === "timestamp") { return cb(Time.since(content)); @@ -2852,16 +3146,16 @@ var comment, json_raw; data = JSON.parse(data); comment = ((function() { - var _i, _len, _ref, _results; - _ref = data.comment; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - comment = _ref[_i]; + var j, len, ref, results; + ref = data.comment; + results = []; + for (j = 0, len = ref.length; j < len; j++) { + comment = ref[j]; if (comment.comment_id === id) { - _results.push(comment); + results.push(comment); } } - return _results; + return results; })())[0]; comment[elem.data("editable")] = content; json_raw = unescape(encodeURIComponent(JSON.stringify(data, void 0, '\t'))); @@ -2885,33 +3179,49 @@ }; ZeroBlog.prototype.deleteObject = function(elem, cb) { - var id, inner_path, type, _ref; + var id, inner_path, ref, type; if (cb == null) { cb = False; } - _ref = elem.data("object").split(":"), type = _ref[0], id = _ref[1]; + ref = elem.data("object").split(":"), type = ref[0], id = ref[1]; id = parseInt(id); if (type === "Post") { return this.cmd("fileGet", ["data/data.json"], (function(_this) { return function(res) { - var data, post; + var data, post, tag, tag_index; data = JSON.parse(res); if (type === "Post") { post = ((function() { - var _i, _len, _ref1, _results; - _ref1 = data.post; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - post = _ref1[_i]; + var j, len, ref1, results; + ref1 = data.post; + results = []; + for (j = 0, len = ref1.length; j < len; j++) { + post = ref1[j]; if (post.post_id === id) { - _results.push(post); + results.push(post); } } - return _results; + return results; })())[0]; if (!post) { return false; } + if (!data.tag) { + data.tag = []; + } + tag_index = (function() { + var j, len, ref1, results; + ref1 = data.tag; + results = []; + for (j = 0, len = ref1.length; j < len; j++) { + tag = ref1[j]; + if (tag.post_id !== id) { + results.push(tag); + } + } + return results; + })(); + data["tag"] = tag_index; data.post.splice(data.post.indexOf(post), 1); return _this.writeData(data, function(res) { if (cb) { @@ -2934,16 +3244,16 @@ var comment, json_raw; data = JSON.parse(data); comment = ((function() { - var _i, _len, _ref1, _results; - _ref1 = data.comment; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - comment = _ref1[_i]; + var j, len, ref1, results; + ref1 = data.comment; + results = []; + for (j = 0, len = ref1.length; j < len; j++) { + comment = ref1[j]; if (comment.comment_id === id) { - _results.push(comment); + results.push(comment); } } - return _results; + return results; })())[0]; data.comment.splice(data.comment.indexOf(comment), 1); json_raw = unescape(encodeURIComponent(JSON.stringify(data, void 0, '\t'))); @@ -3081,21 +3391,21 @@ return this.cmd("fileGet", ["data/data.json"], (function(_this) { return function(data) { return Page.cmd("fileList", "data/img", function(files) { - var file, _i, _len, _results; - _results = []; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; + var file, j, len, results; + results = []; + for (j = 0, len = files.length; j < len; j++) { + file = files[j]; if (file.indexOf("post_") !== 0) { continue; } if (data.indexOf(file) === -1) { _this.log("Deleting image", file, "..."); - _results.push(_this.cmd("fileDelete", "data/img/" + file)); + results.push(_this.cmd("fileDelete", "data/img/" + file)); } else { - _results.push(void 0); + results.push(void 0); } } - return _results; + return results; }); }; })(this)); @@ -3115,13 +3425,13 @@ }; ZeroBlog.prototype.setSiteinfo = function(site_info) { - var mentions_menu_elem, _ref, _ref1, _ref2; + var mentions_menu_elem, ref, ref1, ref2; this.site_info = site_info; this.event_site_info.resolve(site_info); if ($("body").hasClass("page-post")) { Comments.checkCert(); } - if (((_ref = site_info.event) != null ? _ref[0] : void 0) === "file_done" && site_info.event[1].match(/.*users.*data.json$/)) { + if (((ref = site_info.event) != null ? ref[0] : void 0) === "file_done" && site_info.event[1].match(/.*users.*data.json$/)) { if ($("body").hasClass("page-post")) { this.pagePost(); Comments.loadComments(); @@ -3135,7 +3445,7 @@ }; })(this)); } - } else if (((_ref1 = site_info.event) != null ? _ref1[0] : void 0) === "file_done" && site_info.event[1] === "data/data.json") { + } else if (((ref1 = site_info.event) != null ? ref1[0] : void 0) === "file_done" && site_info.event[1] === "data/data.json") { this.loadData(); if ($("body").hasClass("page-main")) { this.pageMain(); @@ -3143,7 +3453,7 @@ if ($("body").hasClass("page-post")) { return this.pagePost(); } - } else if (((_ref2 = site_info.event) != null ? _ref2[0] : void 0) === "cert_changed" && site_info.cert_user_id) { + } else if (((ref2 = site_info.event) != null ? ref2[0] : void 0) === "cert_changed" && site_info.cert_user_id) { this.initFollowButton(); mentions_menu_elem = this.follow.feeds["Username mentions"][1]; return setTimeout(((function(_this) { @@ -3162,4 +3472,4 @@ window.Page = new ZeroBlog(); -}).call(this); \ No newline at end of file +}).call(this); diff --git a/languages/pl.json b/languages/pl.json new file mode 100644 index 0000000..79ad0a0 --- /dev/null +++ b/languages/pl.json @@ -0,0 +1,34 @@ +{ + "Add new post": "Dodaj nowy wpis", + "Follow in Newsfeed": "Śledź na Tablicy", + "Posts": "Wpisy", + "Comments": "Komentarze", + "Following": "Śledzony", + + "Like this post": "Polub ten wpis", + "Latest comments:": "Ostatnie komentarze:", + "Reply": "Odpowiedz", + + "Bold": "Wytłuszczenie", + "Italic": "Kursywa", + "Strikethrough": "Przekreślenie", + "Code": "Kod", + "Link": "Odnośnik", + + "More comments": "Więcej komentarzy", + "Sign in as...": "Zaloguj się jako...", + "Submit comment": "Wyślij komentarz", + "Please sign in": "Proszę, zaloguj się", + "new comment": "nowy komentarz", + "used: ": "zużyto: ", + + " minutes ago": " minut(y/ę) temu", + " hours ago": " godzin(y/ę) temu", + " days ago": " dni(dzień) temu", + "on ": "", + "Just now": "Właśnie teraz", + + "Save": "Zapisz", + "Cancel": "Anuluj", + "Delete ": "Usuń " +} From d4133e9e67225a65d530b72c2e93ebe53cec5848 Mon Sep 17 00:00:00 2001 From: BinChan Date: Wed, 15 Nov 2017 00:09:27 +0800 Subject: [PATCH 02/27] Add mobile support, general css improvement --- content.json | 12 ++-- css/Follow.css | 2 +- css/Menu.css | 4 +- css/ZeroBlog.css | 13 ++-- css/all.css | 160 ++++++++++++++++++++++++++++++++++++++++++----- index.html | 13 ++++ 6 files changed, 177 insertions(+), 27 deletions(-) diff --git a/content.json b/content.json index d2d61f7..d268d17 100644 --- a/content.json +++ b/content.json @@ -22,8 +22,8 @@ "size": 737537 }, "css/all.css": { - "sha512": "2d7a6001b26a4a33911cc0c5935ccbaf1a40f56a0ea213267ac3b1b865d58863", - "size": 130255 + "sha512": "5cae062efef2761952cd3d594b662b70c59bd6771cde1c6f7508917324f681fd", + "size": 132908 }, "data-default/data.json": { "sha512": "c8952629acf0c47ac1a53c7b8910e3aae2eda34371cb5182b9c9a50e483a297c", @@ -50,8 +50,8 @@ "size": 723 }, "index.html": { - "sha512": "31b50f6d59d23a8c24292161585d1e4a695b4d1fba9645648c7e6acfd72ea6ba", - "size": 6740 + "sha512": "24c864ff5d2b8a2bc0363c0132c19bfe32ab537c824119314f605895bfab9bc8", + "size": 7615 }, "js/all.js": { "sha512": "61d103f38f39f3e64144a2473e9c9da109df5404768960f9dc6b9eeefdd8da85", @@ -86,11 +86,11 @@ } }, "inner_path": "content.json", - "modified": 1510673379, + "modified": 1510675619, "postmessage_nonce_security": true, "signers_sign": "GwcX6fQSYco45YGEw0Tr7h8TE8UqLlz4HM/2NLzbfdPRcorFKi9IO2P5ZznLBLbTQK+11D3zZjAK/MQmSaSoSpA=", "signs": { - "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW": "G3IaJOeyt1xHHks998VdG5QylJHTQFHUMhTBMS8BbZo/DbPPL33J3fcQfIW3JVvWt+A1MQawoflnLy7rXr7qgbQ=" + "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW": "G/PbRQq63Pw1gMsaRi6f8s7U9weBXU09rAu8GLqWXq6sTqmJW48UNwOevRIFzxiBRobZiwsFLkbyzhvQvYwojsE=" }, "signs_required": 1, "title": "ZeroBlog Plus", diff --git a/css/Follow.css b/css/Follow.css index df8f615..9bdb39a 100644 --- a/css/Follow.css +++ b/css/Follow.css @@ -13,7 +13,7 @@ .feed-follow { font-size: 14px; display: inline-block; padding: 7px 14px; font-weight: normal; display: none; - border-radius: 4px; border: 1px solid #EEE; border-bottom: 1px solid #DDD; transition: all 0.3s + border-radius: 4px; border: 1px solid #333; border-bottom: 1px solid #333; transition: all 0.3s } .feed-follow .text-follow, .feed-follow .text-following { max-width: 0px; opacity: 0; overflow: hidden; display: inline-block; vertical-align: bottom; transition: all 0.3s; white-space: nowrap; diff --git a/css/Menu.css b/css/Menu.css index c450a2c..b526fb0 100644 --- a/css/Menu.css +++ b/css/Menu.css @@ -2,7 +2,7 @@ background-color: white; padding: 10px 0px; position: absolute; top: 0px; left: 0px; max-height: 0px; overflow: hidden; transform: translate(0px, -30px); pointer-events: none; box-shadow: 0px 2px 8px rgba(0,0,0,0.3); border-radius: 2px; opacity: 0; transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; } -.menu.visible { opacity: 1; max-height: 350px; transform: translate(0px, 0px); transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; pointer-events: all } +.menu.visible { opacity: 1; max-height: 350px; transform: translate(0px, 0px); transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; pointer-events: all; z-index: 110; } .menu-item { display: block; text-decoration: none; color: black; padding: 6px 24px; transition: all 0.2s; border-bottom: none; font-weight: normal; padding-left: 30px; } .menu-item-separator { margin-top: 5px; border-top: 1px solid #eee } @@ -12,4 +12,4 @@ .menu-item.selected:before { content: "L"; display: inline-block; transform: rotateZ(45deg) scaleX(-1); font-weight: bold; position: absolute; margin-left: -17px; font-size: 12px; margin-top: 2px; -} \ No newline at end of file +} diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 9434101..126b771 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -12,7 +12,7 @@ p { margin-top: 0.9em; margin-bottom: 0.9em } hr { margin: 20px 0px; border: none; border-bottom: 1px solid #eee; margin-left: auto; margin-right: auto; width: 120px; } small { font-size: 80%; color: #999; } -a { border-bottom: 1px solid #3498db; text-decoration: none; color: black; font-weight: bold } +a { text-decoration: none; color: #3498db; font-weight: bold; word-wrap: break-word; } a.nolink { border-bottom: none } a:hover { color: #3498db } @@ -88,9 +88,12 @@ a:hover { color: #3498db } } .left h1 a.nolink { font-family: Tinos; display: inline-block; padding: 1px } .left h1 a.editable-edit { float: none } -.left h2 { font-size: 15px; font-family: Tinos; line-height: 1.6em; color: #AAA; margin-top: 14px; letter-spacing: 0.2px } +.left h2 { font-size: 15px; font-family: Tinos; line-height: 1.6em; color: #AAA; margin-top: 14px; letter-spacing: 0.2px; color: #000; } +.left p { + word-wrap: break-word; +} .left ul, .left li { padding: 0px; margin: 0px; list-style-type: none; line-height: 2em } -.left hr { margin-left: 100px; margin-right: 0px; width: auto } +.left hr { margin-left: 100px; margin-right: 0px; width: auto; border-bottom: 1px solid #333 } /*.left .links { width: 230px; margin-left: -60px }*/ .left .links.editor { text-align: left !important } @@ -145,9 +148,11 @@ a:hover { color: #3498db } code { background-color: #f5f5f5; border: 1px solid #ccc; padding: 0px 5px; overflow: auto; border-radius: 2px; display: inline-block; color: #444; font-weight: normal; font-size: 13px; vertical-align: text-bottom; border-bottom-width: 2px; + max-width: 660px; + overflow: auto; } .post .body pre { table-layout: fixed; width: auto; display: table; white-space: normal; } -.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 850px; display: block } +.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 660px; display: block; overflow: auto } blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } /*.post .more { diff --git a/css/all.css b/css/all.css index 206b982..357ae60 100644 --- a/css/all.css +++ b/css/all.css @@ -1,6 +1,6 @@ -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/Comments.css ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/Comments.css ---- */ .comments { margin-bottom: 60px } @@ -56,7 +56,7 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/Follow.css ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/Follow.css ---- */ .icon-feed { @@ -74,7 +74,7 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro .feed-follow { font-size: 14px; display: inline-block; padding: 7px 14px; font-weight: normal; display: none; - -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px ; border: 1px solid #EEE; border-bottom: 1px solid #DDD; transition: all 0.3s + -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px ; border: 1px solid #333; border-bottom: 1px solid #333; transition: all 0.3s } .feed-follow .text-follow, .feed-follow .text-following { max-width: 0px; opacity: 0; overflow: hidden; display: inline-block; vertical-align: bottom; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; -o-transition: all 0.3s; -ms-transition: all 0.3s; transition: all 0.3s ; white-space: nowrap; @@ -90,14 +90,14 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/Menu.css ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/Menu.css ---- */ .menu { background-color: white; padding: 10px 0px; position: absolute; top: 0px; left: 0px; max-height: 0px; overflow: hidden; -webkit-transform: translate(0px, -30px); -moz-transform: translate(0px, -30px); -o-transform: translate(0px, -30px); -ms-transform: translate(0px, -30px); transform: translate(0px, -30px) ; pointer-events: none; -webkit-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); -moz-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); -o-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); -ms-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); box-shadow: 0px 2px 8px rgba(0,0,0,0.3) ; -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; border-radius: 2px ; opacity: 0; -webkit-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; -moz-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; -o-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; -ms-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out ; } -.menu.visible { opacity: 1; max-height: 350px; -webkit-transform: translate(0px, 0px); -moz-transform: translate(0px, 0px); -o-transform: translate(0px, 0px); -ms-transform: translate(0px, 0px); transform: translate(0px, 0px) ; -webkit-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -moz-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -o-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -ms-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out ; pointer-events: all } +.menu.visible { opacity: 1; max-height: 350px; -webkit-transform: translate(0px, 0px); -moz-transform: translate(0px, 0px); -o-transform: translate(0px, 0px); -ms-transform: translate(0px, 0px); transform: translate(0px, 0px) ; -webkit-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -moz-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -o-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -ms-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out ; pointer-events: all; z-index: 110; } .menu-item { display: block; text-decoration: none; color: black; padding: 6px 24px; -webkit-transition: all 0.2s; -moz-transition: all 0.2s; -o-transition: all 0.2s; -ms-transition: all 0.2s; transition: all 0.2s ; border-bottom: none; font-weight: normal; padding-left: 30px; } .menu-item-separator { margin-top: 5px; border-top: 1px solid #eee } @@ -110,7 +110,8 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro } -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/ZeroBlog.css ---- */ + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/ZeroBlog.css ---- */ /* Design based on medium */ @@ -127,7 +128,7 @@ p { margin-top: 0.9em; margin-bottom: 0.9em } hr { margin: 20px 0px; border: none; border-bottom: 1px solid #eee; margin-left: auto; margin-right: auto; width: 120px; } small { font-size: 80%; color: #999; } -a { border-bottom: 1px solid #3498db; text-decoration: none; color: black; font-weight: bold } +a { text-decoration: none; color: #3498db; font-weight: bold; word-wrap: break-word; } a.nolink { border-bottom: none } a:hover { color: #3498db } @@ -203,9 +204,12 @@ a:hover { color: #3498db } } .left h1 a.nolink { font-family: Tinos; display: inline-block; padding: 1px } .left h1 a.editable-edit { float: none } -.left h2 { font-size: 15px; font-family: Tinos; line-height: 1.6em; color: #AAA; margin-top: 14px; letter-spacing: 0.2px } +.left h2 { font-size: 15px; font-family: Tinos; line-height: 1.6em; color: #AAA; margin-top: 14px; letter-spacing: 0.2px; color: #000; } +.left p { + word-wrap: break-word; +} .left ul, .left li { padding: 0px; margin: 0px; list-style-type: none; line-height: 2em } -.left hr { margin-left: 100px; margin-right: 0px; width: auto } +.left hr { margin-left: 100px; margin-right: 0px; width: auto; border-bottom: 1px solid #333 } /*.left .links { width: 230px; margin-left: -60px }*/ .left .links.editor { text-align: left !important } @@ -260,9 +264,11 @@ a:hover { color: #3498db } code { background-color: #f5f5f5; border: 1px solid #ccc; padding: 0px 5px; overflow: auto; -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; border-radius: 2px ; display: inline-block; color: #444; font-weight: normal; font-size: 13px; vertical-align: text-bottom; border-bottom-width: 2px; + max-width: 660px; + overflow: auto; } .post .body pre { table-layout: fixed; width: auto; display: table; white-space: normal; } -.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 850px; display: block } +.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 660px; display: block; overflow: auto } blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } /*.post .more { @@ -327,7 +333,7 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/fonts.css ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/fonts.css ---- */ /* Base64 encoder: http://www.motobit.com/util/base64-decoder-encoder.asp */ @@ -364,7 +370,7 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/github.css ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/github.css ---- */ /* @@ -494,7 +500,7 @@ github.com style (c) Vasily Polovnyov -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/icons.css ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/icons.css ---- */ .icon { display: inline-block; vertical-align: text-bottom; background-repeat: no-repeat; } @@ -521,7 +527,133 @@ github.com style (c) Vasily Polovnyov .icon-up { font-weight: normal !important; font-size: 15px; font-family: Tahoma; vertical-align: -4px; padding-right: 5px; display: inline; height: 1px; } -/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/zoom.css ---- */ +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/mobile.css ---- */ + + +.left .nav-trigger { +display: none; } +.left .menu-icon { +display: none; } +@media screen and (max-width: 1000px) { +.right { +max-width: 650px; +} +.post .body pre code { +max-width: 600px; +} +} +@media screen and (max-width: 750px) { +body, html {height: 100%;} +code {max-width: 100%;} +.right { +width: 95%; +max-width: 100%; +margin-left: 0px; +padding-right: 10px; +padding-left: 10px; +} +.editable-edit { +position: absolute; +margin-left: -40px; +padding: 8px 40px; +} +.post { +min-width: 300px; +} +.editable { +width: 100% !important; +} +.left { +position: fixed; +left: -300px; +height: 100%; +z-index: 1; +margin-left: -20px; +margin-top: 0px; +} + +.left label[for="nav-trigger"] { +display: block; +cursor: pointer; +position: absolute; +z-index: 24; +margin-top: 10px; +margin-left: 310px; +} +.left .menu-icon { +background-color: #333; +display: block; +float: left; +border: 1px solid #e8e8e8; +-webkit-border-radius: 5px; -moz-border-radius: 5px; -o-border-radius: 5px; -ms-border-radius: 5px; border-radius: 5px ; +width: 36px; +height: 26px; +line-height: 0; +padding-top: 10px; +text-align: center; } +.left .menu-icon > svg path { + fill: #ccc; } +.left input ~ .trigger { +background-color: #eee; +overflow: auto; +position: absolute; +width: 100%; +left: 0px; +padding-top: 100px; +margin-top: -100px; +z-index: 20; +clear: both; +display: block; +height: 100%; +padding-left: 25px; +padding-right: 30px; +-webkit-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); -moz-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); -o-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); -ms-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1) ; +border-right: 2px solid #eee; +} +.left input:checked ~ .trigger { +-webkit-box-shadow: 0px 0px 30px #999; -moz-box-shadow: 0px 0px 30px #999; -o-box-shadow: 0px 0px 30px #999; -ms-box-shadow: 0px 0px 30px #999; box-shadow: 0px 0px 30px #999 ; +left: 310px; +} +.lastcomments { +background-color: transparent; +} +html, body, p, th, td, li { +font-size: medium !important; +} +.lastcomments .lastcomment { +font-size: 85% !important; +} +.editbg { +z-index: 0 !important; +} +.ae-ui .ae-toolbar-add { +left: 0px !important; +} +.post .body pre { +width: 100%; +} +.post .body pre code { +max-width: 100%; +padding: 5px 5px; +white-space: pre-wrap; +} +.post .body code { +max-width: 100%; +white-space: pre-wrap; +} + +} + +/* Fix publish bar */ +@media screen and (max-width: 410px) { +.publishbar small { +display: none; +} +} + + + +/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/zoom.css ---- */ img[data-action="zoom"] { diff --git a/index.html b/index.html index 55ef924..0f99875 100644 --- a/index.html +++ b/index.html @@ -46,6 +46,18 @@
    + + +
    + @@ -75,6 +87,7 @@

    Latest comments:

    +
    From 2aafedc4c85ca5f39811a6b92535e22604c6d2e9 Mon Sep 17 00:00:00 2001 From: BinChan Date: Wed, 15 Nov 2017 00:34:14 +0800 Subject: [PATCH 03/27] fix pagination bug --- js/ZeroBlog.coffee | 15 --------------- js/all.js | 39 +++++++-------------------------------- 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/js/ZeroBlog.coffee b/js/ZeroBlog.coffee index aa8937b..a666fce 100644 --- a/js/ZeroBlog.coffee +++ b/js/ZeroBlog.coffee @@ -367,12 +367,6 @@ class ZeroBlog extends ZeroFrame pageMain: -> limit = 15 query = """ - SELECT COUNT(*) as post_id, - NULL as title,NULL as body,NULL as date_published, - NULL as json_id, NULL as comments,NULL as votes - FROM post - UNION ALL - SELECT * FROM ( SELECT post.*, COUNT(comment_id) AS comments, (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes @@ -381,7 +375,6 @@ class ZeroBlog extends ZeroFrame GROUP BY post_id ORDER BY date_published DESC LIMIT #{(@page-1)*limit}, #{limit+1} - ) """ @cmd "dbQuery", [query], (res) => parse_res = (res,tags) => @@ -392,14 +385,6 @@ class ZeroBlog extends ZeroFrame else @applyPagerdata(@page, limit, false) - @cmd "dbQuery", [query], (res) => - parse_res = (res,tags) => - total = res[0].post_id - res = res[1..] - s = (+ new Date) - - @applyPagerdata(@page, limit, total) - res.reverse() for post in res post.tag =[] diff --git a/js/all.js b/js/all.js index 8e44942..8c825dc 100644 --- a/js/all.js +++ b/js/all.js @@ -186,7 +186,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/jquery.csslater.coffee ---- */ @@ -316,7 +315,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/marked.min.js ---- */ @@ -884,7 +882,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/CustomAlloyEditor.coffee ---- */ @@ -1140,7 +1137,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Follow.coffee ---- */ @@ -1309,7 +1305,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/InlineEditor.coffee ---- */ @@ -1530,7 +1525,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Meditor.coffee ---- */ @@ -1691,7 +1685,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Menu.coffee ---- */ @@ -1771,7 +1764,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/RateLimit.coffee ---- */ @@ -1801,7 +1793,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Text.coffee ---- */ @@ -1887,7 +1878,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Time.coffee ---- */ @@ -1960,7 +1950,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/ZeroFrame.coffee ---- */ @@ -2074,7 +2063,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/Comments.coffee ---- */ @@ -2331,7 +2319,6 @@ }).call(this); - /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/ZeroBlog.coffee ---- */ @@ -2725,31 +2712,19 @@ ZeroBlog.prototype.pageMain = function() { var limit, query; limit = 15; - query = "SELECT COUNT(*) as post_id,\n NULL as title,NULL as body,NULL as date_published,\n NULL as json_id, NULL as comments,NULL as votes\nFROM post\nUNION ALL\nSELECT * FROM (\nSELECT\n post.*, COUNT(comment_id) AS comments,\n (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((this.page - 1) * limit) + ", " + (limit + 1) + "\n)"; - this.cmd("dbQuery", [query], (function(_this) { + query = "SELECT\n post.*, COUNT(comment_id) AS comments,\n (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((this.page - 1) * limit) + ", " + (limit + 1); + return this.cmd("dbQuery", [query], (function(_this) { return function(res) { - var parse_res; - return parse_res = function(res, tags) { - var s; + var deal_post, parse_res, tag_query; + parse_res = function(res, tags) { + var elem, j, l, len, len1, post, s, tag; s = +(new Date); if (res.length > limit) { res.pop(); - return _this.applyPagerdata(_this.page, limit, true); + _this.applyPagerdata(_this.page, limit, true); } else { - return _this.applyPagerdata(_this.page, limit, false); + _this.applyPagerdata(_this.page, limit, false); } - }; - }; - })(this)); - return this.cmd("dbQuery", [query], (function(_this) { - return function(res) { - var deal_post, parse_res, tag_query; - parse_res = function(res, tags) { - var elem, j, l, len, len1, post, s, tag, total; - total = res[0].post_id; - res = res.slice(1); - s = +(new Date); - _this.applyPagerdata(_this.page, limit, total); res.reverse(); for (j = 0, len = res.length; j < len; j++) { post = res[j]; From 4d43e4670a75959b56b8245945f1679bb114cd71 Mon Sep 17 00:00:00 2001 From: BinChan Date: Wed, 15 Nov 2017 00:41:38 +0800 Subject: [PATCH 04/27] Add mobile support, general css improvement --- css/mobile.css | 119 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 css/mobile.css diff --git a/css/mobile.css b/css/mobile.css new file mode 100644 index 0000000..d31cf79 --- /dev/null +++ b/css/mobile.css @@ -0,0 +1,119 @@ +.left .nav-trigger { +display: none; } +.left .menu-icon { +display: none; } +@media screen and (max-width: 1000px) { +.right { +max-width: 650px; +} +.post .body pre code { +max-width: 600px; +} +} +@media screen and (max-width: 750px) { +body, html {height: 100%;} +code {max-width: 100%;} +html, body, p, th, td, li { +font-size: medium !important; +} +.right { +width: 95%; +max-width: 100%; +margin-left: 0px; +padding-right: 10px; +padding-left: 10px; +} +.editable-edit { +position: absolute; +margin-left: -40px; +padding: 8px 40px; +} +.editable { +width: 100% !important; +} +.editbg { +z-index: 0 !important; +} +.left { +position: fixed; +left: -300px; +height: 100%; +z-index: 1; +margin-left: -20px; +margin-top: 0px; +} +.left label[for="nav-trigger"] { +display: block; +cursor: pointer; +position: absolute; +z-index: 24; +margin-top: 10px; +margin-left: 310px; +} +.left .menu-icon { +background-color: #333; +display: block; +float: left; +border: 1px solid #e8e8e8; +border-radius: 5px; +width: 36px; +height: 26px; +line-height: 0; +padding-top: 10px; +text-align: center; } +.left .menu-icon > svg path { + fill: #ccc; } +.left input ~ .trigger { +background-color: #eee; +overflow: auto; +position: absolute; +width: 100%; +left: 0px; +padding-top: 100px; +margin-top: -100px; +z-index: 20; +clear: both; +display: block; +height: 100%; +padding-left: 25px; +padding-right: 30px; +transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); +border-right: 2px solid #eee; +} +.left input:checked ~ .trigger { +box-shadow: 0px 0px 30px #999; +left: 310px; +} +.lastcomments { +background-color: transparent; +} +.lastcomments .lastcomment { +font-size: 85% !important; +} +.ae-ui .ae-toolbar-add { +left: 0px !important; +} +.post { +min-width: 300px; +} +.post .body pre { +width: 100%; +} +.post .body pre code { +max-width: 100%; +padding: 5px 5px; +white-space: pre-wrap; +} +.post .body code { +max-width: 100%; +white-space: pre-wrap; +} + +} + +/* Fix publish bar */ +@media screen and (max-width: 410px) { +.publishbar small { +display: none; +} +} From 7d3865430c8aa8541a35ee3e3210f92597f1aee7 Mon Sep 17 00:00:00 2001 From: BinChan Date: Wed, 15 Nov 2017 01:09:36 +0800 Subject: [PATCH 05/27] Update readme --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d7e726a..ccfef6e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -# ZeroBlog -Demo for decentralized, self publishing blogging platform. +# ZeroBlog Plus +There is [a ZeroBlog that supports tag and date index](https://github.com/zeronetscript/ZeroBlog/tree/toc_by_tag), but it's based on an old version, which doesn't support alloy-editor and image inserting yet. I use the awesome [meld tool](http://meldmerge.org/) and merge the code base, also add some mobile support. -## Screenshot +You can clone it from [here](/15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f/). -![Screenshot](http://i.imgur.com/diTYHcm.png) - -ZeroNet address: http://127.0.0.1:43110/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8 +If you want to upgrade your present ZeroBlog to this one. Backup your blog first, then edit the `content.json` in your blog root directory and change the `"cloned_from": "..."` to `"cloned_from": "15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f"`, then go to ZeroHello, from the site option (click the 3-dot button near your blog) and choose `Upgrade code`. That's all. To change the avatar replace the image /img/avatar.png with a new png, 60 by 60 pixels is recommended. \ No newline at end of file From c68b6fb18d3dbc53681423d68ec9d139a7fdaf4c Mon Sep 17 00:00:00 2001 From: BinChan Date: Wed, 15 Nov 2017 01:37:35 +0800 Subject: [PATCH 06/27] Remove and recover some files that don't need to have or change in PR. --- .gitignore | 12 - README.md | 10 +- content.json | 242 +++++++++--- css/all.css | 160 +------- data/data.json | 17 - data/data.json-old | 17 - data/users/content.json | 27 -- js/all.js | 807 +++++++++++++--------------------------- 8 files changed, 476 insertions(+), 816 deletions(-) delete mode 100644 .gitignore delete mode 100644 data/data.json delete mode 100644 data/data.json-old delete mode 100644 data/users/content.json diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0671370..0000000 --- a/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -# Hidden files -.* -!/.gitignore -!/.travis.yml - - -# Database -*.db - -data/users/* -!/data/users/content.json -!/data/data.json \ No newline at end of file diff --git a/README.md b/README.md index ccfef6e..d7e726a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -# ZeroBlog Plus -There is [a ZeroBlog that supports tag and date index](https://github.com/zeronetscript/ZeroBlog/tree/toc_by_tag), but it's based on an old version, which doesn't support alloy-editor and image inserting yet. I use the awesome [meld tool](http://meldmerge.org/) and merge the code base, also add some mobile support. +# ZeroBlog +Demo for decentralized, self publishing blogging platform. -You can clone it from [here](/15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f/). +## Screenshot -If you want to upgrade your present ZeroBlog to this one. Backup your blog first, then edit the `content.json` in your blog root directory and change the `"cloned_from": "..."` to `"cloned_from": "15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f"`, then go to ZeroHello, from the site option (click the 3-dot button near your blog) and choose `Upgrade code`. That's all. +![Screenshot](http://i.imgur.com/diTYHcm.png) + +ZeroNet address: http://127.0.0.1:43110/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8 To change the avatar replace the image /img/avatar.png with a new png, 60 by 60 pixels is recommended. \ No newline at end of file diff --git a/content.json b/content.json index d268d17..e2350d6 100644 --- a/content.json +++ b/content.json @@ -1,45 +1,201 @@ { - "address": "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW", + "address": "1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8", "background-color": "white", - "clone_root": "template-new", "cloneable": true, "description": "Blogging platform Demo", + "domain": "Blog.ZeroNetwork.bit", "files": { - "LICENSE": { - "sha512": "d281feecb7d1218e1aea8269f288fcd63385da1a130681fadae77262637cb65f", - "size": 18027 - }, - "README.md": { - "sha512": "07dbb7b8386b600d7eea237f237269ed705cf3d97a46edc02c8ba43fa63b59c2", - "size": 312 - }, "alloy-editor/all.css": { - "sha512": "7f92b9206df4994b119df0123734193ad95c5961c2b5190aa1e60f394026d150", - "size": 63384 + "sha512": "c1e2049d304f77ad078fd4546a62c1456ba5459ef169fe82394a090a22487b8e", + "size": 63344 }, "alloy-editor/all.js": { "sha512": "0c917acb6b3f7397d37263a8ee01100929e7aed3c752b2103cb884f65aef7b23", "size": 737537 }, "css/all.css": { - "sha512": "5cae062efef2761952cd3d594b662b70c59bd6771cde1c6f7508917324f681fd", - "size": 132908 + "sha512": "b5426b2cc41ca837fea4f0c72b21d4cd456739d794404504d2dbbbf486c3c725", + "size": 130050 }, "data-default/data.json": { - "sha512": "c8952629acf0c47ac1a53c7b8910e3aae2eda34371cb5182b9c9a50e483a297c", - "size": 437 + "sha512": "aff6accbac7e950ff567105666ddf29b70ca7c2dcd9d90f9a969509a42a9b195", + "size": 352 }, "data-default/users/content-default.json": { "sha512": "0603ce08f7abb92b3840ad0cf40e95ea0b3ed3511b31524d4d70e88adba83daa", "size": 679 }, "data/data.json": { - "sha512": "e1c05f2052558fa9dbdb1e254fe44cecdea2e7212bfa7e09ba4d623342d6a899", - "size": 439 + "sha512": "5f419fff6baaf3ee1c41ba5d3b396f0d5d406136f5aa681376889f4fb7380243", + "size": 123877 + }, + "data/files/ZeroFrame.coffee": { + "sha512": "e9d440c26e858ff524313e60881714bcaf292470ce63d2b33b93d9920a21a7c4", + "size": 1467 + }, + "data/img/allony.png": { + "sha512": "2cf2ef70d1dbf2395384581ffb0e1cc9e8dfa5a64441e5ab7c08477127fb6d9a", + "size": 1572 + }, + "data/img/autoupdate.png": { + "sha512": "d2b4dc8e0da2861ea051c0c13490a4eccf8933d77383a5b43de447c49d816e71", + "size": 24460 + }, + "data/img/clone.png": { + "sha512": "07df9f39af99b2a4348f1f0984b0e8667add7821a689e0a737df49bd68411def", + "size": 11539 + }, + "data/img/decentralized_web_summit.png": { + "sha512": "90f83d91ea366eeb13c5874c0d25ef6efa6d20cc6e3f556fdc4de949d58248a4", + "size": 25428 + }, + "data/img/direct_domains.png": { + "sha512": "5f14b30c1852735ab329b22496b1e2ea751cb04704789443ad73a70587c59719", + "size": 16185 + }, + "data/img/domain.png": { + "sha512": "ce87e0831f4d1e95a95d7120ca4d33f8273c6fce9f5bbedf7209396ea0b57b6a", + "size": 11881 + }, + "data/img/getd.png": { + "sha512": "22987f498e2dd6e5dee9f6367fec22fa1d2ad3538b2455d1d9e3fc400d1933db", + "size": 36735 + }, + "data/img/memory.png": { + "sha512": "dd56515085b4a79b5809716f76f267ec3a204be3ee0d215591a77bf0f390fa4e", + "size": 12775 + }, + "data/img/multiuser.png": { + "sha512": "88e3f795f9b86583640867897de6efc14e1aa42f93e848ed1645213e6cc210c6", + "size": 29480 + }, + "data/img/new_zeronet_logos.png": { + "sha512": "a8685d5d8d9d84a83710a1316ee7b8f998f14918cef32e14217d5e45f156aa20", + "size": 59816 + }, + "data/img/optional.png": { + "sha512": "84df27a2ee59f18bc646ed4e6610a6ca7569fad2e85198ba9aa278a3258f35c3", + "size": 104799 + }, + "data/img/optional_manager.png": { + "sha512": "f0df2c1df5106f63e922ac0b65388d97bab1e7c26f6bf06469b44eae8b798cec", + "size": 29008 + }, + "data/img/peers.jpg": { + "sha512": "3142ae89ed2347953033068fd789ac316692a3bdcbbf01257326685fc1402be9", + "size": 67768 + }, + "data/img/pocketchip.jpg": { + "sha512": "05ddad3659e71dfbc6afbba3faaf680c810636ea2319e1e9950ed462cfa75d01", + "size": 131607 + }, + "data/img/post_101_ezgif.com-f1dae34e05.gif": { + "sha512": "ee45043be1c79a1ef952f2ab030d24b63592790b572750b8bf42544d80a228e3", + "size": 15609 + }, + "data/img/post_101_plus.png": { + "sha512": "e8d3bd6fe509e79389385389d66874a388a8474218c3ef5b3cf9339196d0633d", + "size": 243 + }, + "data/img/post_102_1484303724.jpg": { + "sha512": "1e75a71128f3675389ccef9748d071b779ef8635db826f933dffdccf2e6fed61", + "size": 90260 + }, + "data/img/post_102_peers.jpg": { + "sha512": "37c064e0b8fafa801a6264e9495d515b7468fa387566d329debd80e66cc7ebcf", + "size": 79172 + }, + "data/img/post_103_publish.png": { + "sha512": "ace77f3163cd0de7dc560d18cecd73b3e6cd8a5b32751d4038c65c400521e88c", + "size": 1087 + }, + "data/img/post_104_mute.png": { + "sha512": "6bdad39da3dfbc3db3a57e52fc10d9205cf0729a6cd124e7e5c8704a130161b4", + "size": 15562 + }, + "data/img/progressbar.png": { + "sha512": "23d592ae386ce14158cec34d32a3556771725e331c14d5a4905c59e0fe980ebf", + "size": 13294 + }, + "data/img/search.png": { + "sha512": "b5adf6562b0078bdda257d216a07b43fa6f81e0989fcabf83817ef072cbeb1f1", + "size": 18735 + }, + "data/img/sidebar.png": { + "sha512": "e5fdafcc7226f830eb27a1296236aa985625e27480e6829660db978ceae0bba9", + "size": 98641 + }, + "data/img/slides.png": { + "sha512": "1933db3b90ab93465befa1bd0843babe38173975e306286e08151be9992f767e", + "size": 14439 + }, + "data/img/slots_memory.png": { + "sha512": "82a250e6da909d7f66341e5b5c443353958f86728cd3f06e988b6441e6847c29", + "size": 9488 + }, + "data/img/startup.png": { + "sha512": "d9f4d652396bbb89f0508e3e3908bd03408e99681f33e47f790b53a9b1c4fafc", + "size": 4257 + }, + "data/img/trayicon.png": { + "sha512": "e7ae65bf280f13fb7175c1293dad7d18f1fcb186ebc9e1e33850cdaccb897b8f", + "size": 19040 + }, + "data/img/tutorial-1.png": { + "sha512": "885d322f4e189775cbacb6e7d4f9ee89554d5709077e3777f0d382b0e9d315f1", + "size": 18729 + }, + "data/img/uipassword.png": { + "sha512": "2f7ddb406cb318da51c36dc4e30e79aca17ef6730b9ba1fa5a9768127d3d0f02", + "size": 5383 + }, + "data/img/xmas_tree.jpg": { + "sha512": "fec017f87867f43d0f2b98e0b275b59a1997746e6cae9d322c551d7ab357488c", + "size": 43706 + }, + "data/img/zeroblog-comments.png": { + "sha512": "efe4e815a260e555303e5c49e550a689d27a8361f64667bd4a91dbcccb83d2b4", + "size": 24001 + }, + "data/img/zerochat.png": { + "sha512": "b1512ad6514a87d8052dac880b3ef0d9f2e70cf2e4605bfebd4a6c792d1c2ba9", + "size": 12029 + }, + "data/img/zeroid.png": { + "sha512": "b46d541a9e51ba2ddc8a49955b7debbc3b45fd13467d3c20ef104e9d938d052b", + "size": 18875 + }, + "data/img/zeromail.png": { + "sha512": "f2ced47d30bbf76549ae990b63dab00f3764ad48b6085464b122b108f31da368", + "size": 34638 + }, + "data/img/zerome.png": { + "sha512": "2b97eadf18d93c52c3316d14d8d54b1564a058e332fbf7bbb107bf24ad07e302", + "size": 21698 + }, + "data/img/zeroname.png": { + "sha512": "bab45a1bb2087b64e4f69f756b2ffa5ad39b7fdc48c83609cdde44028a7a155d", + "size": 36031 + }, + "data/img/zerotalk-mark.png": { + "sha512": "a335b2fedeb8d291ca68d3091f567c180628e80f41de4331a5feb19601d078af", + "size": 44862 + }, + "data/img/zerotalk-upvote.png": { + "sha512": "b1ffd7f948b4f99248dde7efe256c2efdfd997f7e876fb9734f986ef2b561732", + "size": 41092 + }, + "data/img/zerotalk.png": { + "sha512": "54d10497a1ffca9a4780092fd1bd158c15f639856d654d2eb33a42f9d8e33cd8", + "size": 26606 + }, + "data/pdf/zeronet_presentation.pdf": { + "sha512": "70274438cf2fbb63e1d3c75a74250ca5d968d63cadbb4426305b3b51f2608a01", + "size": 472084 }, "dbschema.json": { - "sha512": "01300937662ec84f6bc18b57e650d8f03dfe6888e89b669022ee91c4c44ed0c1", - "size": 2908 + "sha512": "fa70ee2fce3f8342c6909e0e9b853bca71fa996f23f85739f94c086f2bda5ceb", + "size": 2571 }, "img/avatar.png": { "sha512": "a656c470967e27c2b385182a361db8bab1696fe3b2d79c86394236d02ce42eb8", @@ -50,35 +206,19 @@ "size": 723 }, "index.html": { - "sha512": "24c864ff5d2b8a2bc0363c0132c19bfe32ab537c824119314f605895bfab9bc8", - "size": 7615 + "sha512": "503623af793ba3d4209a08b7c94b06db410804bdf7089fed040c471c459a71a5", + "size": 6382 }, "js/all.js": { - "sha512": "61d103f38f39f3e64144a2473e9c9da109df5404768960f9dc6b9eeefdd8da85", - "size": 259843 - }, - "languages/es.json": { - "sha512": "9005bf63e41b2670af8eba0103badfe9ba24ae94b6cac64d00193cfbb2624d85", - "size": 871 - }, - "languages/fr.json": { - "sha512": "6e87d27a3ee084c8300642ac83133d9b967d8ba3997d7bb0dfbe104ee3e1b327", - "size": 1773 - }, - "languages/nl.json": { - "sha512": "1844365e54a2a5b53fcff4f36ad2e870fe738ba033dbae77172de3126e72bcb7", - "size": 912 + "sha512": "2e75e1eddde295bc99ce54f87b987219caed30d0828fe361c900ffb9a9fe1905", + "size": 247867 }, "languages/pl.json": { "sha512": "f84ea772597afc947fb0e759318aaa3371a36efe542abdbd6b6411ea99468826", "size": 864 - }, - "languages/zh.json": { - "sha512": "b8ae541464d09451f2d0e9af32dabc0b7ed2474576f721e2bd592ba4de22e231", - "size": 761 } }, - "ignore": "((js|css|alloy-editor)/(?!all.(js|css))|data/.*db|data/users/.*/.*|.git|.gitignore)", + "ignore": "((js|css|alloy-editor)/(?!all.(js|css))|data/.*db|data/users/.*/.*)", "includes": { "data/users/content.json": { "signers": [], @@ -86,14 +226,22 @@ } }, "inner_path": "content.json", - "modified": 1510675619, + "modified": 1486949114, "postmessage_nonce_security": true, - "signers_sign": "GwcX6fQSYco45YGEw0Tr7h8TE8UqLlz4HM/2NLzbfdPRcorFKi9IO2P5ZznLBLbTQK+11D3zZjAK/MQmSaSoSpA=", + "sign": [ + 46220524892014274189597736846232592807986501080175547419624109664319912543976, + 48261414791532551873927752970010534526261073351836499372694272435238865271264 + ], + "signers_sign": "G7W/oNvczE5nPTFYVOqv8+GOpQd23LS/Dc1Q6xQ1NRDDHlYzmoSE63UQ7Za05kD0rwIYXbuUSr8z8p6RhZmnUs8=", "signs": { - "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW": "G/PbRQq63Pw1gMsaRi6f8s7U9weBXU09rAu8GLqWXq6sTqmJW48UNwOevRIFzxiBRobZiwsFLkbyzhvQvYwojsE=" + "1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8": "G4MrVTYetIomtruNF7KyB5VNSynx4oy/IEZJzNz84XwTcW1GQNkXuRHLFVK0YLtVxmTyX8Jm3AscS4e2+0QG/wg=" }, "signs_required": 1, - "title": "ZeroBlog Plus", - "translate": ["index.html", "js/all.js", "alloy-editor/all.js"], - "zeronet_version": "0.6.0" + "title": "ZeroBlog", + "translate": [ + "index.html", + "js/all.js", + "alloy-editor/all.js" + ], + "zeronet_version": "0.5.2" } \ No newline at end of file diff --git a/css/all.css b/css/all.css index 357ae60..206b982 100644 --- a/css/all.css +++ b/css/all.css @@ -1,6 +1,6 @@ -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/Comments.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/Comments.css ---- */ .comments { margin-bottom: 60px } @@ -56,7 +56,7 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/Follow.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/Follow.css ---- */ .icon-feed { @@ -74,7 +74,7 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro .feed-follow { font-size: 14px; display: inline-block; padding: 7px 14px; font-weight: normal; display: none; - -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px ; border: 1px solid #333; border-bottom: 1px solid #333; transition: all 0.3s + -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px ; border: 1px solid #EEE; border-bottom: 1px solid #DDD; transition: all 0.3s } .feed-follow .text-follow, .feed-follow .text-following { max-width: 0px; opacity: 0; overflow: hidden; display: inline-block; vertical-align: bottom; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; -o-transition: all 0.3s; -ms-transition: all 0.3s; transition: all 0.3s ; white-space: nowrap; @@ -90,14 +90,14 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/Menu.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/Menu.css ---- */ .menu { background-color: white; padding: 10px 0px; position: absolute; top: 0px; left: 0px; max-height: 0px; overflow: hidden; -webkit-transform: translate(0px, -30px); -moz-transform: translate(0px, -30px); -o-transform: translate(0px, -30px); -ms-transform: translate(0px, -30px); transform: translate(0px, -30px) ; pointer-events: none; -webkit-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); -moz-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); -o-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); -ms-box-shadow: 0px 2px 8px rgba(0,0,0,0.3); box-shadow: 0px 2px 8px rgba(0,0,0,0.3) ; -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; border-radius: 2px ; opacity: 0; -webkit-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; -moz-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; -o-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; -ms-transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out; transition: opacity 0.2s ease-out, transform 1s ease-out, max-height 0.2s ease-in-out ; } -.menu.visible { opacity: 1; max-height: 350px; -webkit-transform: translate(0px, 0px); -moz-transform: translate(0px, 0px); -o-transform: translate(0px, 0px); -ms-transform: translate(0px, 0px); transform: translate(0px, 0px) ; -webkit-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -moz-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -o-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -ms-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out ; pointer-events: all; z-index: 110; } +.menu.visible { opacity: 1; max-height: 350px; -webkit-transform: translate(0px, 0px); -moz-transform: translate(0px, 0px); -o-transform: translate(0px, 0px); -ms-transform: translate(0px, 0px); transform: translate(0px, 0px) ; -webkit-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -moz-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -o-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; -ms-transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out; transition: opacity 0.1s ease-out, transform 0.3s ease-out, max-height 0.3s ease-in-out ; pointer-events: all } .menu-item { display: block; text-decoration: none; color: black; padding: 6px 24px; -webkit-transition: all 0.2s; -moz-transition: all 0.2s; -o-transition: all 0.2s; -ms-transition: all 0.2s; transition: all 0.2s ; border-bottom: none; font-weight: normal; padding-left: 30px; } .menu-item-separator { margin-top: 5px; border-top: 1px solid #eee } @@ -110,8 +110,7 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro } - -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/ZeroBlog.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/ZeroBlog.css ---- */ /* Design based on medium */ @@ -128,7 +127,7 @@ p { margin-top: 0.9em; margin-bottom: 0.9em } hr { margin: 20px 0px; border: none; border-bottom: 1px solid #eee; margin-left: auto; margin-right: auto; width: 120px; } small { font-size: 80%; color: #999; } -a { text-decoration: none; color: #3498db; font-weight: bold; word-wrap: break-word; } +a { border-bottom: 1px solid #3498db; text-decoration: none; color: black; font-weight: bold } a.nolink { border-bottom: none } a:hover { color: #3498db } @@ -204,12 +203,9 @@ a:hover { color: #3498db } } .left h1 a.nolink { font-family: Tinos; display: inline-block; padding: 1px } .left h1 a.editable-edit { float: none } -.left h2 { font-size: 15px; font-family: Tinos; line-height: 1.6em; color: #AAA; margin-top: 14px; letter-spacing: 0.2px; color: #000; } -.left p { - word-wrap: break-word; -} +.left h2 { font-size: 15px; font-family: Tinos; line-height: 1.6em; color: #AAA; margin-top: 14px; letter-spacing: 0.2px } .left ul, .left li { padding: 0px; margin: 0px; list-style-type: none; line-height: 2em } -.left hr { margin-left: 100px; margin-right: 0px; width: auto; border-bottom: 1px solid #333 } +.left hr { margin-left: 100px; margin-right: 0px; width: auto } /*.left .links { width: 230px; margin-left: -60px }*/ .left .links.editor { text-align: left !important } @@ -264,11 +260,9 @@ a:hover { color: #3498db } code { background-color: #f5f5f5; border: 1px solid #ccc; padding: 0px 5px; overflow: auto; -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; border-radius: 2px ; display: inline-block; color: #444; font-weight: normal; font-size: 13px; vertical-align: text-bottom; border-bottom-width: 2px; - max-width: 660px; - overflow: auto; } .post .body pre { table-layout: fixed; width: auto; display: table; white-space: normal; } -.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 660px; display: block; overflow: auto } +.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 850px; display: block } blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } /*.post .more { @@ -333,7 +327,7 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/fonts.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/fonts.css ---- */ /* Base64 encoder: http://www.motobit.com/util/base64-decoder-encoder.asp */ @@ -370,7 +364,7 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/github.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/github.css ---- */ /* @@ -500,7 +494,7 @@ github.com style (c) Vasily Polovnyov -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/icons.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/icons.css ---- */ .icon { display: inline-block; vertical-align: text-bottom; background-repeat: no-repeat; } @@ -527,133 +521,7 @@ github.com style (c) Vasily Polovnyov .icon-up { font-weight: normal !important; font-size: 15px; font-family: Tahoma; vertical-align: -4px; padding-right: 5px; display: inline; height: 1px; } -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/mobile.css ---- */ - - -.left .nav-trigger { -display: none; } -.left .menu-icon { -display: none; } -@media screen and (max-width: 1000px) { -.right { -max-width: 650px; -} -.post .body pre code { -max-width: 600px; -} -} -@media screen and (max-width: 750px) { -body, html {height: 100%;} -code {max-width: 100%;} -.right { -width: 95%; -max-width: 100%; -margin-left: 0px; -padding-right: 10px; -padding-left: 10px; -} -.editable-edit { -position: absolute; -margin-left: -40px; -padding: 8px 40px; -} -.post { -min-width: 300px; -} -.editable { -width: 100% !important; -} -.left { -position: fixed; -left: -300px; -height: 100%; -z-index: 1; -margin-left: -20px; -margin-top: 0px; -} - -.left label[for="nav-trigger"] { -display: block; -cursor: pointer; -position: absolute; -z-index: 24; -margin-top: 10px; -margin-left: 310px; -} -.left .menu-icon { -background-color: #333; -display: block; -float: left; -border: 1px solid #e8e8e8; --webkit-border-radius: 5px; -moz-border-radius: 5px; -o-border-radius: 5px; -ms-border-radius: 5px; border-radius: 5px ; -width: 36px; -height: 26px; -line-height: 0; -padding-top: 10px; -text-align: center; } -.left .menu-icon > svg path { - fill: #ccc; } -.left input ~ .trigger { -background-color: #eee; -overflow: auto; -position: absolute; -width: 100%; -left: 0px; -padding-top: 100px; -margin-top: -100px; -z-index: 20; -clear: both; -display: block; -height: 100%; -padding-left: 25px; -padding-right: 30px; --webkit-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); -moz-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); -o-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); -ms-transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1); transition: 0.3s all cubic-bezier(0.77, 0, 0.175, 1) ; -border-right: 2px solid #eee; -} -.left input:checked ~ .trigger { --webkit-box-shadow: 0px 0px 30px #999; -moz-box-shadow: 0px 0px 30px #999; -o-box-shadow: 0px 0px 30px #999; -ms-box-shadow: 0px 0px 30px #999; box-shadow: 0px 0px 30px #999 ; -left: 310px; -} -.lastcomments { -background-color: transparent; -} -html, body, p, th, td, li { -font-size: medium !important; -} -.lastcomments .lastcomment { -font-size: 85% !important; -} -.editbg { -z-index: 0 !important; -} -.ae-ui .ae-toolbar-add { -left: 0px !important; -} -.post .body pre { -width: 100%; -} -.post .body pre code { -max-width: 100%; -padding: 5px 5px; -white-space: pre-wrap; -} -.post .body code { -max-width: 100%; -white-space: pre-wrap; -} - -} - -/* Fix publish bar */ -@media screen and (max-width: 410px) { -.publishbar small { -display: none; -} -} - - - -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/zoom.css ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/css/zoom.css ---- */ img[data-action="zoom"] { diff --git a/data/data.json b/data/data.json deleted file mode 100644 index 638b8a0..0000000 --- a/data/data.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "title": "ZeroBlog Plus", - "description": "My ZeroBlog.", - "links": "- [Source code](https://github.com/HelloZeroNet)", - "next_post_id": 2, - "demo": false, - "footer": "Powered by [ZeroNet](https://zeronet.io) [open, free, and uncensored]", - "modified": 1510673351, - "post": [ - { - "post_id": 1, - "title": "Congratulations!", - "date_published": 1433033779.604, - "body": "Your zeronet blog has been successfully created!" - } - ] -} \ No newline at end of file diff --git a/data/data.json-old b/data/data.json-old deleted file mode 100644 index c440bef..0000000 --- a/data/data.json-old +++ /dev/null @@ -1,17 +0,0 @@ -{ - "title": "MyZeroBlog", - "description": "My ZeroBlog.", - "links": "- [Source code](https://github.com/HelloZeroNet)", - "next_post_id": 2, - "demo": false, - "footer": "Powered by [ZeroNet](https://zeronet.io) [open, free, and uncensored]", - "modified": 1432515193, - "post": [ - { - "post_id": 1, - "title": "Congratulations!", - "date_published": 1433033779.604, - "body": "Your zeronet blog has been successfully created!" - } - ] -} diff --git a/data/users/content.json b/data/users/content.json deleted file mode 100644 index a895830..0000000 --- a/data/users/content.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "address": "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW", - "files": {}, - "ignore": ".*", - "inner_path": "data/users/content.json", - "modified": 1510673085, - "signs": { - "1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW": "G7jsSZej1HHS1yhjkgN1WucanZG0No9XCtIW5JQgb26/fjaU/fr0owPGxuNP+9wNsDjYwrQSfeoYnccS/Bo+nsg=" - }, - "user_contents": { - "cert_signers": { - "zeroid.bit": ["1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz"] - }, - "permission_rules": { - ".*": { - "files_allowed": "data.json", - "max_size": 10000 - }, - "bitid/.*@zeroid.bit": {"max_size": 40000}, - "bitmsg/.*@zeroid.bit": {"max_size": 15000} - }, - "permissions": { - "banexample@zeroid.bit": false, - "nofish@zeroid.bit": {"max_size": 20000} - } - } -} \ No newline at end of file diff --git a/js/all.js b/js/all.js index 8c825dc..782e97f 100644 --- a/js/all.js +++ b/js/all.js @@ -1,6 +1,6 @@ -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/00-jquery.min.js ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/00-jquery.min.js ---- */ /*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ @@ -10,13 +10,13 @@ -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/highlight.pack.js ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/highlight.pack.js ---- */ !function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){var n=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return n=n.map(function(e){return e.replace(/^lang(uage)?-/,"")}),n.filter(function(e){return N(e)||/no(-?)highlight/.test(e)})[0]}function o(e,n){var t={};for(var r in e)t[r]=e[r];if(n)for(var r in n)t[r]=n[r];return t}function i(e){var n=[];return function r(e,a){for(var o=e.firstChild;o;o=o.nextSibling)3==o.nodeType?a+=o.nodeValue.length:1==o.nodeType&&(n.push({event:"start",offset:a,node:o}),a=r(o,a),t(o).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:o}));return a}(e,0),n}function c(e,r,a){function o(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function c(e){l+=""}function u(e){("start"==e.event?i:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=o();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=o();while(g==e&&g.length&&g[0].offset==s);f.reverse().forEach(i)}else"start"==g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function u(e){function n(e){return e&&e.source||e}function t(t,r){return RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var c={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");c[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):Object.keys(a.k).forEach(function(e){u(e,a.k[e])}),a.k=c}a.lR=t(a.l||/\b[A-Za-z0-9_]+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function s(e,t,a,o){function i(e,n){for(var t=0;t";return o+=e+'">',o+n+i}function d(){if(!w.k)return n(y);var e="",t=0;w.lR.lastIndex=0;for(var r=w.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(w,r);a?(B+=a[1],e+=p(a[0],n(r[0]))):e+=n(r[0]),t=w.lR.lastIndex,r=w.lR.exec(y)}return e+n(y.substr(t))}function h(){if(w.sL&&!R[w.sL])return n(y);var e=w.sL?s(w.sL,y,!0,L[w.sL]):l(y);return w.r>0&&(B+=e.r),"continuous"==w.subLanguageMode&&(L[w.sL]=e.top),p(e.language,e.value,!1,!0)}function v(){return void 0!==w.sL?h():d()}function b(e,t){var r=e.cN?p(e.cN,"",!0):"";e.rB?(M+=r,y=""):e.eB?(M+=n(t)+r,y=""):(M+=r,y=t),w=Object.create(e,{parent:{value:w}})}function m(e,t){if(y+=e,void 0===t)return M+=v(),0;var r=i(t,w);if(r)return M+=v(),b(r,t),r.rB?0:t.length;var a=c(w,t);if(a){var o=w;o.rE||o.eE||(y+=t),M+=v();do w.cN&&(M+=""),B+=w.r,w=w.parent;while(w!=a.parent);return o.eE&&(M+=n(t)),y="",a.starts&&b(a.starts,""),o.rE?0:t.length}if(f(t,w))throw new Error('Illegal lexeme "'+t+'" for mode "'+(w.cN||"")+'"');return y+=t,t.length||1}var x=N(e);if(!x)throw new Error('Unknown language: "'+e+'"');u(x);for(var w=o||x,L={},M="",k=w;k!=x;k=k.parent)k.cN&&(M=p(k.cN,"",!0)+M);var y="",B=0;try{for(var C,j,I=0;;){if(w.t.lastIndex=I,C=w.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}m(t.substr(I));for(var k=w;k.parent;k=k.parent)k.cN&&(M+="");return{r:B,value:M,language:e,top:w}}catch(A){if(-1!=A.message.indexOf("Illegal"))return{r:0,value:n(t)};throw A}}function l(e,t){t=t||E.languages||Object.keys(R);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(N(n)){var t=s(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function f(e){return E.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,E.tabReplace)})),E.useBR&&(e=e.replace(/\n/g,"
    ")),e}function g(e,n,t){var r=n?x[n]:t,a=[e.trim()];return e.match(/(\s|^)hljs(\s|$)/)||a.push("hljs"),r&&a.push(r),a.join(" ").trim()}function p(e){var n=a(e);if(!/no(-?)highlight/.test(n)){var t;E.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;var r=t.textContent,o=n?s(n,r,!0):l(r),u=i(t);if(u.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(u,i(p),r)}o.value=f(o.value),e.innerHTML=o.value,e.className=g(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){E=o(E,e)}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",h,!1),addEventListener("load",h,!1)}function b(n,t){var r=R[n]=t(e);r.aliases&&r.aliases.forEach(function(e){x[e]=n})}function m(){return Object.keys(R)}function N(e){return R[e]||R[x[e]]}var E={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},R={},x={};return e.highlight=s,e.highlightAuto=l,e.fixMarkup=f,e.highlightBlock=p,e.configure=d,e.initHighlighting=h,e.initHighlightingOnLoad=v,e.registerLanguage=b,e.listLanguages=m,e.getLanguage=N,e.inherit=o,e.IR="[a-zA-Z][a-zA-Z0-9_]*",e.UIR="[a-zA-Z_][a-zA-Z0-9_]*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.CLCM={cN:"comment",b:"//",e:"$",c:[e.PWM]},e.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[e.PWM]},e.HCM={cN:"comment",b:"#",e:"$",c:[e.PWM]},e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("cpp",function(t){var i={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginaryintmax_t uintmax_t int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_tint_least8_t uint_least8_t int_least16_t uint_least16_t int_least32_t uint_least32_tint_least64_t uint_least64_t int_fast8_t uint_fast8_t int_fast16_t uint_fast16_t int_fast32_tuint_fast32_t int_fast64_t uint_fast64_t intptr_t uintptr_t atomic_bool atomic_char atomic_scharatomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llongatomic_ullong atomic_wchar_t atomic_char16_t atomic_char32_t atomic_intmax_t atomic_uintmax_tatomic_intptr_t atomic_uintptr_t atomic_size_t atomic_ptrdiff_t atomic_int_least8_t atomic_int_least16_tatomic_int_least32_t atomic_int_least64_t atomic_uint_least8_t atomic_uint_least16_t atomic_uint_least32_tatomic_uint_least64_t atomic_int_fast8_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_tatomic_uint_fast8_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c","h","c++","h++"],k:i,i:""]',k:"include",i:"\\n"},t.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:i,c:["self"]},{b:t.IR+"::"},{bK:"new throw return",r:0},{cN:"function",b:"("+t.IR+"\\s+)+"+t.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:t.IR+"\\s*\\(",rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:i,r:0,c:[t.CBCM]},t.CLCM,t.CBCM]}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",c={cN:"yardoctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},s={cN:"comment",v:[{b:"#",e:"$",c:[c]},{b:"^\\=begin",e:"^\\=end",c:[c],r:10},{b:"^__END__",e:"\\n$"}]},n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},i={cN:"params",b:"\\(",e:"\\)",k:r},d=[t,a,s,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},s]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:b}),i,s]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,s,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];n.c=d,i.c=d;var l="[>?]>",u="[\\w#]+\\(\\w+\\):\\d+:\\d+>",N="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",o=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:d}},{cN:"prompt",b:"^("+l+"|"+u+"|"+N+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:[s].concat(o).concat(d)}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"tag",b:""},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("python",function(e){var r={cN:"prompt",b:/^(>>>|\.\.\.) /},b={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},l={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},c={cN:"params",b:/\(/,e:/\)/,c:["self",r,l,b]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[r,l,b,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n]/,c:[e.UTM,c]},{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("javascript",function(r){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",r:10,v:[{b:/^\s*('|")use strict('|")/},{b:/^\s*('|")use asm('|")/}]},r.ASM,r.QSM,r.CLCM,r.CBCM,r.CNM,{b:"("+r.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[r.CLCM,r.CBCM,r.RM,{b:/;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[r.inherit(r.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[r.CLCM,r.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+r.IR,r:0}]}});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",t={cN:"subst",b:/#\{/,e:/}/,k:c},r=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,t]},{b:/"/,e:/"/,c:[e.BE,t]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[t,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{cN:"property",b:"@"+n},{b:"`",e:"`",eB:!0,eE:!0,sL:"javascript"}];t.c=r;var i=e.inherit(e.TM,{b:n}),s="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(r)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:r.concat([{cN:"comment",b:"###",e:"###",c:[e.PWM]},e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+s,e:"[-=]>",rB:!0,c:[i,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:s,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[i]},i]},{cN:"attribute",b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("http",function(){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("};return{cI:!0,i:"[=/|']",c:[e.CBCM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[e.CBCM,{cN:"rule",b:"[^\\s]",rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});hljs.registerLanguage("ini",function(e){return{cI:!0,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:!0,k:"on off true false yes no",c:[e.QSM,e.NM],r:0}]}]}});hljs.registerLanguage("objectivec",function(e){var t={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSData NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView NSView NSViewController NSWindow NSWindowController NSSet NSUUID NSIndexSet UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection NSURLSession NSURLSessionDataTask NSURLSessionDownloadTask NSURLSessionUploadTask NSURLResponseUIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,a="@interface @class @protocol @implementation";return{aliases:["m","mm","objc","obj-c"],k:t,l:o,i:""}]}]},{cN:"class",b:"("+a.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:a,l:o,c:[e.UTM]},{cN:"variable",b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});hljs.registerLanguage("markdown",function(){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]}});hljs.registerLanguage("java",function(e){var a=e.UIR+"(<"+e.UIR+">)?",t="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",c="(\\b(0b[01_]+)|\\b0[xX][a-fA-F0-9_]+|(\\b[\\d_]+(\\.[\\d_]*)?|\\.[\\d_]+)([eE][-+]?\\d+)?)[lLfF]?",r={cN:"number",b:c,r:0};return{aliases:["jsp"],k:t,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return",r:0},{cN:"function",b:"("+a+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:t,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},r,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("diff",function(){return{aliases:["patch"],c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@][^\s\w{]/,r:0}]},o={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5},i=[e.BE,r,n],c=[n,e.HCM,o,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:!0},s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,o,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];return r.c=c,s.c=c,{aliases:["pl"],k:t,c:c}});hljs.registerLanguage("makefile",function(e){var a={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[a]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[e.QSM,a]}]}});hljs.registerLanguage("cs",function(e){var r="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long null object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async protected public private internal ascending descending from get group into join let orderby partial select set value var where yield",t=e.IR+"(<"+e.IR+">)?";return{aliases:["csharp"],k:r,i:/::/,c:[{cN:"comment",b:"///",e:"$",rB:!0,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:""},{b:""}]}]},e.CLCM,e.CBCM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},e.ASM,e.QSM,e.CNM,{bK:"class namespace interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"new return throw await",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("json",function(e){var t={literal:"true false null"},i=[e.QSM,e.CNM],l={cN:"value",e:",",eW:!0,eE:!0,c:i,k:t},c={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:l}],i:"\\S"},n={b:"\\[",e:"\\]",c:[e.inherit(l,{cN:null})],i:"\\S"};return i.splice(i.length,0,c,n),{c:i,k:t,i:"\\S"}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"title",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("sql",function(e){var t={cN:"comment",b:"--",e:"$"};return{cI:!0,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup",e:/;/,eW:!0,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage("xml",function(){var t="[A-Za-z0-9\\._:-]+",e={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},c={eW:!0,i:/]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[c],starts:{e:"",rE:!0,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[c],starts:{e:"",rE:!0,sL:"javascript"}},e,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},c]}]}});hljs.registerLanguage("php",function(e){var c={cN:"variable",b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"preprocessor",b:/<\?(php)?|\?>/},a={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},i]},{cN:"comment",b:"__halt_compiler.+?;",eW:!0,k:"__halt_compiler",l:e.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},i,c,{b:/->+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,a,n]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},a,n]}}); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/identicon.js ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/identicon.js ---- */ /** @@ -113,7 +113,7 @@ })(); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/jquery.cssanim.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/jquery.cssanim.coffee ---- */ (function() { @@ -186,7 +186,7 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/jquery.csslater.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/jquery.csslater.coffee ---- */ (function() { @@ -221,7 +221,7 @@ }; jQuery.fn.addClassLater = function(class_name, time, mode) { - var base, elem, timers; + var elem, timers, _base; if (time == null) { time = 5; } @@ -229,8 +229,8 @@ mode = "clear"; } elem = this; - if ((base = elem[0]).timers == null) { - base.timers = {}; + if ((_base = elem[0]).timers == null) { + _base.timers = {}; } timers = elem[0].timers; if (timers[class_name] && mode === "clear") { @@ -243,7 +243,7 @@ }; jQuery.fn.removeClassLater = function(class_name, time, mode) { - var base, elem, timers; + var elem, timers, _base; if (time == null) { time = 500; } @@ -251,8 +251,8 @@ mode = "clear"; } elem = this; - if ((base = elem[0]).timers == null) { - base.timers = {}; + if ((_base = elem[0]).timers == null) { + _base.timers = {}; } timers = elem[0].timers; if (timers[class_name] && mode === "clear") { @@ -265,7 +265,7 @@ }; jQuery.fn.cssLater = function(name, val, time, mode) { - var base, elem, timers; + var elem, timers, _base; if (time == null) { time = 500; } @@ -273,8 +273,8 @@ mode = "clear"; } elem = this; - if ((base = elem[0]).timers == null) { - base.timers = {}; + if ((_base = elem[0]).timers == null) { + _base.timers = {}; } timers = elem[0].timers; if (timers[name] && mode === "clear") { @@ -291,7 +291,7 @@ }; jQuery.fn.toggleClassLater = function(name, val, time, mode) { - var base, elem, timers; + var elem, timers, _base; if (time == null) { time = 10; } @@ -299,8 +299,8 @@ mode = "clear"; } elem = this; - if ((base = elem[0]).timers == null) { - base.timers = {}; + if ((_base = elem[0]).timers == null) { + _base.timers = {}; } timers = elem[0].timers; if (timers[name] && mode === "clear") { @@ -315,7 +315,7 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/marked.min.js ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/marked.min.js ---- */ /** @@ -326,7 +326,7 @@ (function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
    "+(escaped?code:escape(code,true))+"\n
    "}return'
    '+(escaped?code:escape(code,true))+"\n
    \n"};Renderer.prototype.blockquote=function(quote){return"
    \n"+quote+"
    \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/pnglib.js ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/pnglib.js ---- */ /** @@ -539,7 +539,7 @@ -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/lib/zoom.min.js ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/zoom.min.js ---- */ /** @@ -825,12 +825,12 @@ -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Class.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Class.coffee ---- */ (function() { var Class, - slice = [].slice; + __slice = [].slice; Class = (function() { function Class() {} @@ -839,7 +839,7 @@ Class.prototype.log = function() { var args; - args = 1 <= arguments.length ? slice.call(arguments, 0) : []; + args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; if (!this.trace) { return; } @@ -853,23 +853,23 @@ Class.prototype.logStart = function() { var args, name; - name = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; + name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; if (!this.trace) { return; } this.logtimers || (this.logtimers = {}); this.logtimers[name] = +(new Date); if (args.length > 0) { - this.log.apply(this, ["" + name].concat(slice.call(args), ["(started)"])); + this.log.apply(this, ["" + name].concat(__slice.call(args), ["(started)"])); } return this; }; Class.prototype.logEnd = function() { var args, ms, name; - name = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; + name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; ms = +(new Date) - this.logtimers[name]; - this.log.apply(this, ["" + name].concat(slice.call(args), ["(Done in " + ms + "ms)"])); + this.log.apply(this, ["" + name].concat(__slice.call(args), ["(Done in " + ms + "ms)"])); return this; }; @@ -882,28 +882,28 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/CustomAlloyEditor.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/CustomAlloyEditor.coffee ---- */ (function() { var CustomAlloyEditor, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; - CustomAlloyEditor = (function(superClass) { - extend(CustomAlloyEditor, superClass); + CustomAlloyEditor = (function(_super) { + __extends(CustomAlloyEditor, _super); - function CustomAlloyEditor(tag) { + function CustomAlloyEditor(_at_tag) { var editor, el, height_added, height_before, style; - this.tag = tag; - this.handleSelectionChange = bind(this.handleSelectionChange, this); - this.handleChange = bind(this.handleChange, this); - this.handleCommand = bind(this.handleCommand, this); - this.handleAction = bind(this.handleAction, this); - this.handleImageAdd = bind(this.handleImageAdd, this); - this.getExtension = bind(this.getExtension, this); - this.resizeImage = bind(this.resizeImage, this); + this.tag = _at_tag; + this.handleSelectionChange = __bind(this.handleSelectionChange, this); + this.handleChange = __bind(this.handleChange, this); + this.handleCommand = __bind(this.handleCommand, this); + this.handleAction = __bind(this.handleAction, this); + this.handleImageAdd = __bind(this.handleImageAdd, this); + this.getExtension = __bind(this.getExtension, this); + this.resizeImage = __bind(this.resizeImage, this); editor = AlloyEditor.editable(this.tag); el = editor._editor.element.$; height_before = el.getClientRects()[0].height; @@ -961,10 +961,10 @@ }; CustomAlloyEditor.prototype.resizeImage = function(image, width, height) { - var canvas, ctx, image_base64uri, image_resized, ref; + var canvas, ctx, image_base64uri, image_resized, _ref; canvas = document.createElement("canvas"); if (this.image_preverse_ratio) { - ref = this.calcSize(image.width, image.height, width, height), canvas.width = ref[0], canvas.height = ref[1]; + _ref = this.calcSize(image.width, image.height, width, height), canvas.width = _ref[0], canvas.height = _ref[1]; } else { canvas.width = width; canvas.height = height; @@ -1006,7 +1006,7 @@ }; CustomAlloyEditor.prototype.handleImageAdd = function(e) { - var height, image_base64uri, name, ref, width; + var height, image_base64uri, name, width, _ref; if (e.data.file.name) { name = e.data.file.name.replace(/[^\w\.-]/gi, "_"); } else { @@ -1015,7 +1015,7 @@ e.data.el.$.style.maxWidth = "2400px"; if (e.data.file.size > this.image_size_limit) { this.log("File size " + e.data.file.size + " larger than allowed " + this.image_size_limit + ", resizing..."); - ref = this.resizeImage(e.data.el.$, this.image_resize_width, this.image_resize_height), image_base64uri = ref[0], width = ref[1], height = ref[2]; + _ref = this.resizeImage(e.data.el.$, this.image_resize_width, this.image_resize_height), image_base64uri = _ref[0], width = _ref[1], height = _ref[2]; e.data.el.$.src = image_base64uri; name = name.replace(/(png|gif|jpg)/, this.getExtension(image_base64uri)); } else { @@ -1137,38 +1137,39 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Follow.coffee ---- */ + +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Follow.coffee ---- */ (function() { var Follow, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Follow = (function(superClass) { - extend(Follow, superClass); - - function Follow(elem) { - this.elem = elem; - this.handleMenuClick = bind(this.handleMenuClick, this); - this.init = bind(this.init, this); + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + Follow = (function(_super) { + __extends(Follow, _super); + + function Follow(_at_elem) { + this.elem = _at_elem; + this.handleMenuClick = __bind(this.handleMenuClick, this); + this.init = __bind(this.init, this); this.menu = new Menu(this.elem); this.feeds = {}; this.follows = {}; this.elem.off("click"); this.elem.on("click", (function(_this) { return function() { - var is_default_feed, menu_item, param, query, ref, ref1, title; + var is_default_feed, menu_item, param, query, title, _ref, _ref1; if (Page.server_info.rev > 850) { if (_this.elem.hasClass("following")) { _this.showFeeds(); } else { _this.followDefaultFeeds(); - ref = _this.feeds; - for (title in ref) { - ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; + _ref = _this.feeds; + for (title in _ref) { + _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; if (!menu_item.hasClass("selected")) { _this.showFeeds(); break; @@ -1188,13 +1189,13 @@ return; } Page.cmd("feedListFollow", [], (function(_this) { - return function(follows1) { - var is_default_feed, menu_item, param, query, ref, ref1, title; - _this.follows = follows1; - ref = _this.feeds; - for (title in ref) { - ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; - if (_this.follows[title] && indexOf.call(_this.follows[title][1], param) >= 0) { + return function(_at_follows) { + var is_default_feed, menu_item, param, query, title, _ref, _ref1; + _this.follows = _at_follows; + _ref = _this.feeds; + for (title in _ref) { + _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; + if (_this.follows[title] && __indexOf.call(_this.follows[title][1], param) >= 0) { menu_item.addClass("selected"); } else { menu_item.removeClass("selected"); @@ -1237,10 +1238,10 @@ }; Follow.prototype.followDefaultFeeds = function() { - var is_default_feed, menu_item, param, query, ref, ref1, title; - ref = this.feeds; - for (title in ref) { - ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; + var is_default_feed, menu_item, param, query, title, _ref, _ref1; + _ref = this.feeds; + for (title in _ref) { + _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; if (is_default_feed) { menu_item.addClass("selected"); this.log("Following", title, menu_item); @@ -1261,23 +1262,23 @@ Follow.prototype.saveFeeds = function() { return Page.cmd("feedListFollow", [], (function(_this) { return function(follows) { - var is_default_feed, item, menu_item, param, params, query, ref, ref1, title; + var is_default_feed, item, menu_item, param, params, query, title, _ref, _ref1; _this.follows = follows; - ref = _this.feeds; - for (title in ref) { - ref1 = ref[title], query = ref1[0], menu_item = ref1[1], is_default_feed = ref1[2], param = ref1[3]; + _ref = _this.feeds; + for (title in _ref) { + _ref1 = _ref[title], query = _ref1[0], menu_item = _ref1[1], is_default_feed = _ref1[2], param = _ref1[3]; if (follows[title]) { params = (function() { - var i, len, ref2, results; - ref2 = follows[title][1]; - results = []; - for (i = 0, len = ref2.length; i < len; i++) { - item = ref2[i]; + var _i, _len, _ref2, _results; + _ref2 = follows[title][1]; + _results = []; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + item = _ref2[_i]; if (item !== param) { - results.push(item); + _results.push(item); } } - return results; + return _results; })(); } else { params = []; @@ -1305,25 +1306,25 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/InlineEditor.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/InlineEditor.coffee ---- */ (function() { var InlineEditor, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; InlineEditor = (function() { - function InlineEditor(elem1, getContent, saveContent, getObject) { - this.elem = elem1; - this.getContent = getContent; - this.saveContent = saveContent; - this.getObject = getObject; - this.cancelEdit = bind(this.cancelEdit, this); - this.deleteObject = bind(this.deleteObject, this); - this.saveEdit = bind(this.saveEdit, this); - this.stopEdit = bind(this.stopEdit, this); - this.handleImageSave = bind(this.handleImageSave, this); - this.startEdit = bind(this.startEdit, this); + function InlineEditor(_at_elem, _at_getContent, _at_saveContent, _at_getObject) { + this.elem = _at_elem; + this.getContent = _at_getContent; + this.saveContent = _at_saveContent; + this.getObject = _at_getObject; + this.cancelEdit = __bind(this.cancelEdit, this); + this.deleteObject = __bind(this.deleteObject, this); + this.saveEdit = __bind(this.saveEdit, this); + this.stopEdit = __bind(this.stopEdit, this); + this.handleImageSave = __bind(this.handleImageSave, this); + this.startEdit = __bind(this.startEdit, this); this.edit_button = $("
    "); this.edit_button.on("click", this.startEdit); this.elem.addClass("editable").before(this.edit_button); @@ -1352,7 +1353,7 @@ } InlineEditor.prototype.startEdit = function() { - var j, results; + var _i, _results; this.content_before = this.elem.html(); if (this.elem.data("editable-mode") === "meditor") { this.editor = new Meditor(this.elem[0], this.getContent(this.elem, "raw")); @@ -1363,9 +1364,9 @@ this.editor.val(this.getContent(this.elem, "raw")); this.elem.after(this.editor); this.elem.html((function() { - results = []; - for (j = 1; j <= 50; j++){ results.push(j); } - return results; + _results = []; + for (_i = 1; _i <= 50; _i++){ _results.push(_i); } + return _results; }).apply(this).join("fill the width")); this.copyStyle(this.elem, this.editor); this.elem.html(this.content_before); @@ -1525,26 +1526,26 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Meditor.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Meditor.coffee ---- */ (function() { var Meditor, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - - Meditor = (function(superClass) { - extend(Meditor, superClass); - - function Meditor(tag_original, body) { - this.tag_original = tag_original; - this.val = bind(this.val, this); - this.remove = bind(this.remove, this); - this.save = bind(this.save, this); - this.handleEditmodeChange = bind(this.handleEditmodeChange, this); - this.handleEditorLoad = bind(this.handleEditorLoad, this); - this.load = bind(this.load, this); + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; + + Meditor = (function(_super) { + __extends(Meditor, _super); + + function Meditor(_at_tag_original, body) { + this.tag_original = _at_tag_original; + this.val = __bind(this.val, this); + this.remove = __bind(this.remove, this); + this.save = __bind(this.save, this); + this.handleEditmodeChange = __bind(this.handleEditmodeChange, this); + this.handleEditorLoad = __bind(this.handleEditorLoad, this); + this.load = __bind(this.load, this); this.log("Create", this); this.tag_original.insertAdjacentHTML('beforeBegin', "
    "); this.tag_container = this.tag_original.previousSibling; @@ -1685,16 +1686,16 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Menu.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Menu.coffee ---- */ (function() { var Menu, - slice = [].slice; + __slice = [].slice; Menu = (function() { - function Menu(button) { - this.button = button; + function Menu(_at_button) { + this.button = _at_button; this.elem = $(".menu.template").clone().removeClass("template"); this.elem.appendTo("body"); this.items = []; @@ -1745,8 +1746,8 @@ Menu.prototype.log = function() { var args; - args = 1 <= arguments.length ? slice.call(arguments, 0) : []; - return console.log.apply(console, ["[Menu]"].concat(slice.call(args))); + args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + return console.log.apply(console, ["[Menu]"].concat(__slice.call(args))); }; return Menu; @@ -1764,7 +1765,7 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/RateLimit.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/RateLimit.coffee ---- */ (function() { @@ -1793,17 +1794,17 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Text.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Text.coffee ---- */ (function() { var Renderer, Text, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty, + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - Renderer = (function(superClass) { - extend(Renderer, superClass); + Renderer = (function(_super) { + __extends(Renderer, _super); function Renderer() { return Renderer.__super__.constructor.apply(this, arguments); @@ -1819,13 +1820,13 @@ Text = (function() { function Text() { - this.toUrl = bind(this.toUrl, this); + this.toUrl = __bind(this.toUrl, this); } Text.prototype.toColor = function(text) { - var color, hash, i, j, ref; + var color, hash, i, _i, _ref; hash = 0; - for (i = j = 0, ref = text.length - 1; 0 <= ref ? j <= ref : j >= ref; i = 0 <= ref ? ++j : --j) { + for (i = _i = 0, _ref = text.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) { hash = text.charCodeAt(i) + ((hash << 5) - hash); } color = '#'; @@ -1878,7 +1879,7 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/Time.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Time.coffee ---- */ (function() { @@ -1950,23 +1951,23 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/utils/ZeroFrame.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/ZeroFrame.coffee ---- */ (function() { var ZeroFrame, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; - ZeroFrame = (function(superClass) { - extend(ZeroFrame, superClass); + ZeroFrame = (function(_super) { + __extends(ZeroFrame, _super); function ZeroFrame(url) { - this.onCloseWebsocket = bind(this.onCloseWebsocket, this); - this.onOpenWebsocket = bind(this.onOpenWebsocket, this); - this.onRequest = bind(this.onRequest, this); - this.onMessage = bind(this.onMessage, this); + this.onCloseWebsocket = __bind(this.onCloseWebsocket, this); + this.onOpenWebsocket = __bind(this.onOpenWebsocket, this); + this.onRequest = __bind(this.onRequest, this); + this.onMessage = __bind(this.onMessage, this); this.url = url; this.waiting_cb = {}; this.wrapper_nonce = document.location.href.replace(/.*wrapper_nonce=([A-Za-z0-9]+).*/, "$1"); @@ -2063,16 +2064,16 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/Comments.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/Comments.coffee ---- */ (function() { var Comments, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; - Comments = (function(superClass) { - extend(Comments, superClass); + Comments = (function(_super) { + __extends(Comments, _super); function Comments() { return Comments.__super__.constructor.apply(this, arguments); @@ -2115,10 +2116,10 @@ query = "SELECT comment.*, json_content.json_id AS content_json_id, keyvalue.value AS cert_user_id, json.directory, (SELECT COUNT(*) FROM comment_vote WHERE comment_vote.comment_uri = comment.comment_id || '@' || json.directory)+1 AS votes FROM comment LEFT JOIN json USING (json_id) LEFT JOIN json AS json_content ON (json_content.directory = json.directory AND json_content.file_name='content.json') LEFT JOIN keyvalue ON (keyvalue.json_id = json_content.json_id AND key = 'cert_user_id') WHERE post_id = " + this.post_id + " ORDER BY date_added DESC"; return Page.cmd("dbQuery", query, (function(_this) { return function(comments) { - var comment, comment_address, elem, i, len, user_address; + var comment, comment_address, elem, user_address, _i, _len; $("#Comments").text(comments.length + (comments.length > 1 ? " Comments:" : " Comment:")); - for (i = 0, len = comments.length; i < len; i++) { - comment = comments[i]; + for (_i = 0, _len = comments.length; _i < _len; _i++) { + comment = comments[_i]; user_address = comment.directory.replace("users/", ""); comment_address = comment.comment_id + "_" + user_address; elem = $("#comment_" + comment_address); @@ -2142,8 +2143,8 @@ }; Comments.prototype.applyCommentData = function(elem, comment) { - var cert_domain, ref, user_address, user_name; - ref = comment.cert_user_id.split("@"), user_name = ref[0], cert_domain = ref[1]; + var cert_domain, user_address, user_name, _ref; + _ref = comment.cert_user_id.split("@"), user_name = _ref[0], cert_domain = _ref[1]; user_address = comment.directory.replace("users/", ""); $(".comment-body", elem).html(Text.renderMarked(comment.body, { "sanitize": true @@ -2305,11 +2306,6 @@ } }; - Comments.prototype.hide = function() { - $(".comment").hide(); - return $("#Comments").hide(); - }; - return Comments; })(Class); @@ -2319,29 +2315,28 @@ }).call(this); -/* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/js/ZeroBlog.coffee ---- */ +/* ---- /1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/ZeroBlog.coffee ---- */ (function() { var ZeroBlog, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; - ZeroBlog = (function(superClass) { - extend(ZeroBlog, superClass); + ZeroBlog = (function(_super) { + __extends(ZeroBlog, _super); function ZeroBlog() { - this.setSiteinfo = bind(this.setSiteinfo, this); - this.actionSetSiteInfo = bind(this.actionSetSiteInfo, this); - this.submitPostVote = bind(this.submitPostVote, this); - this.saveContent = bind(this.saveContent, this); - this.getContent = bind(this.getContent, this); - this.getObject = bind(this.getObject, this); - this.onOpenWebsocket = bind(this.onOpenWebsocket, this); - this.tagToHtml = bind(this.tagToHtml, this); - this.publish = bind(this.publish, this); - this.pageLoaded = bind(this.pageLoaded, this); + this.setSiteinfo = __bind(this.setSiteinfo, this); + this.actionSetSiteInfo = __bind(this.actionSetSiteInfo, this); + this.submitPostVote = __bind(this.submitPostVote, this); + this.saveContent = __bind(this.saveContent, this); + this.getContent = __bind(this.getContent, this); + this.getObject = __bind(this.getObject, this); + this.onOpenWebsocket = __bind(this.onOpenWebsocket, this); + this.publish = __bind(this.publish, this); + this.pageLoaded = __bind(this.pageLoaded, this); return ZeroBlog.__super__.constructor.apply(this, arguments); } @@ -2404,11 +2399,11 @@ } return this.cmd("dbQuery", [query], (function(_this) { return function(res) { - var j, len, row; + var row, _i, _len; _this.data = {}; if (res) { - for (j = 0, len = res.length; j < len; j++) { - row = res[j]; + for (_i = 0, _len = res.length; _i < _len; _i++) { + row = res[_i]; _this.data[row.key] = row.value; } if (_this.data.title) { @@ -2418,10 +2413,7 @@ $(".left h2").html(Text.renderMarked(_this.data.description)).data("content", _this.data.description); } if (_this.data.links) { - $(".left .links").html(Text.renderMarked(_this.data.links)).data("content", _this.data.links); - } - if (_this.data.footer) { - return $(".footer h4").html(Text.renderMarked(_this.data.footer)).data("content", _this.data.footer); + return $(".left .links").html(Text.renderMarked(_this.data.links)).data("content", _this.data.links); } } }; @@ -2439,13 +2431,13 @@ query = "SELECT comment.*, json_content.json_id AS content_json_id, keyvalue.value AS cert_user_id, json.directory, post.title AS post_title FROM comment LEFT JOIN json USING (json_id) LEFT JOIN json AS json_content ON (json_content.directory = json.directory AND json_content.file_name='content.json') LEFT JOIN keyvalue ON (keyvalue.json_id = json_content.json_id AND key = 'cert_user_id') LEFT JOIN post ON (comment.post_id = post.post_id) WHERE post.title IS NOT NULL ORDER BY date_added DESC LIMIT 3"; return this.cmd("dbQuery", [query], (function(_this) { return function(res) { - var elem, j, lastcomment, len; + var elem, lastcomment, _i, _len; if (res.length) { $(".lastcomments").css("display", "block"); res.reverse(); } - for (j = 0, len = res.length; j < len; j++) { - lastcomment = res[j]; + for (_i = 0, _len = res.length; _i < _len; _i++) { + lastcomment = res[_i]; elem = $("#lastcomment_" + lastcomment.json_id + "_" + lastcomment.comment_id); if (elem.length === 0) { elem = $(".lastcomment.template").clone().removeClass("template").attr("id", "lastcomment_" + lastcomment.json_id + "_" + lastcomment.comment_id); @@ -2496,8 +2488,6 @@ $("body").addClass("page-post"); this.post_id = parseInt(match[1]); return this.pagePost(); - } else if (match = url.match(/Toc=(.*)/)) { - return this.pageToc(match[1]); } else { $("body").addClass("page-main"); if (match = url.match(/page=([0-9]+)/)) { @@ -2507,175 +2497,16 @@ } }; - ZeroBlog.prototype.pageToc = function(tocType) { - $("body").addClass("page-post"); - if (tocType.match(/^dateDesc/)) { - this.pageTocDateDesc(); - } else if (tocType.match(/^tagAll/)) { - this.pageTocTagAll(); - } else if (tocType.match(/^tag/)) { - this.pageTocByTag(tocType.split("&")[0].substring(3)); - } - this.pageLoaded(); - $(".post .details").hide(); - $(".editable-edit").hide(); - return Comments.hide(); - }; - - ZeroBlog.prototype.emptyTocPage = function(title, body) { - return this.applyPostdata($(".post-full"), { - title: title, - post_id: -1, - votes: -1, - comments: -1, - body: body - }, true); - }; - - ZeroBlog.prototype.pageTocByTag = function(tagType) { - var queryString, tag; - queryString = ""; - tag = ""; - if (tagType.match(/^None/)) { - tag = "all untagged"; - queryString = "SELECT date_published,title,post_id FROM post\nWHERE post_id NOT IN (SELECT DISTINCT (post_id) FROM tag)\nORDER BY date_published DESC"; - } else { - tag = decodeURIComponent(tagType.substring(1)); - this.log("Toc by tag:", tag); - queryString = "SELECT post.date_published AS date_published,\npost_id,post.title AS title FROM tag\nJOIN (SELECT date_published,title,post_id FROM post) AS post\nUSING (post_id) WHERE value=\"" + tag + "\"\nORDER BY date_published DESC"; - } - return this.cmd("dbQuery", [queryString], (function(_this) { - return function(res) { - var parse_res; - parse_res = function(res) { - var date, i, j, len, markdown; - if (res.length === 0) { - _this.emptyTocPage("" + tag, "no posts found"); - return; - } - markdown = ""; - for (j = 0, len = res.length; j < len; j++) { - i = res[j]; - date = new Date(i.date_published * 1000); - markdown += "- [" + (date.getFullYear()) + "-" + (date.getMonth() + 1) + "-" + (date.getDate()) + ":" + i.title + "](?Post:" + i.post_id + ")\n"; - } - return _this.applyPostdata($(".post-full"), { - title: "posts of tag:" + tag, - post_id: -1, - votes: -1, - comments: -1, - body: markdown - }, true); - }; - if (res.error) { - return _this.emptyTocPage("error when getting index", "error when getting index"); - } else { - return parse_res(res); - } - }; - })(this)); - }; - - ZeroBlog.prototype.pageTocTagAll = function() { - return this.cmd("dbQuery", ["SELECT \"all\" AS value,COUNT(*) AS count FROM post\nUNION ALL\nSELECT \"tagged\" AS value,COUNT(DISTINCT post_id) AS count\nFROM tag\nUNION ALL\nSELECT value, COUNT(post_id)\nFROM tag GROUP BY value ORDER BY count DESC"], (function(_this) { - return function(res) { - var parse_res; - parse_res = function(res) { - var escaped, j, len, markdown, one, tagged, total_post, untagged; - total_post = res[0].count; - if (total_post === 0) { - emptyTocPage("no post", "no post at all"); - return; - } - markdown = ""; - tagged = res.slice(2); - if (tagged.length > 0) { - markdown += "Tagged:\n\n"; - } - for (j = 0, len = tagged.length; j < len; j++) { - one = tagged[j]; - escaped = encodeURIComponent(one.value); - markdown += "[" + one.value + ": " + one.count + " post(s)](?Toc=tag:" + escaped + ")\n"; - } - untagged = total_post - res[1].count; - if (untagged !== 0) { - markdown += "\n[Untagged: " + untagged + " post(s)](?Toc=tagNone)"; - } - return _this.applyPostdata($(".post-full"), { - title: "index by tag", - post_id: -1, - votes: -1, - comments: -1, - body: markdown - }, true); - }; - if (res.error) { - return _this.emptyTocPage("error when getting index", "sorry, error happened"); - } else { - return parse_res(res); - } - }; - })(this)); - }; - - ZeroBlog.prototype.pageTocDateDesc = function() { - this.log("Toc by date desc"); - return this.cmd("dbQuery", ["SELECT post_id,date_published,title FROM post ORDER BY date_published DESC"], (function(_this) { - return function(res) { - var parse_res; - parse_res = function(res) { - var j, len, markdown, month, post, post_date; - if (res.length === 0) { - _this.emptyTocPage("no post", "no post at all"); - return; - } - month = new Date(new Date().getTime() + 31 * 24 * 60 * 60 * 1000); - markdown = ""; - for (j = 0, len = res.length; j < len; j++) { - post = res[j]; - post_date = new Date(post.date_published * 1000); - if (post_date < month) { - month = new Date(post_date); - month.setDate(1); - month.setHours(0); - month.setMinutes(0); - month.setSeconds(0); - markdown += "\n" + month.getFullYear() + " " + (month.getMonth() + 1) + "\n"; - } - markdown += "- [" + post_date.getDate() + " :" + post.title + ("](?Post:" + post.post_id + ")\n"); - } - return _this.applyPostdata($(".post-full"), { - title: "index by date", - post_id: -1, - votes: -1, - comments: -1, - body: markdown - }, true); - }; - if (res.error) { - return _this.emptyTocPage("error", "error while getting index"); - } else { - return parse_res(res); - } - }; - })(this)); - }; - ZeroBlog.prototype.pagePost = function() { var s; s = +(new Date); return this.cmd("dbQuery", ["SELECT *, (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes FROM post WHERE post_id = " + this.post_id + " LIMIT 1"], (function(_this) { return function(res) { - var deal_post, parse_res, tag_query; - parse_res = function(res, tag_res) { - var j, len, post, tag; + var parse_res; + parse_res = function(res) { + var post; if (res.length) { post = res[0]; - post.tag = []; - for (j = 0, len = tag_res.length; j < len; j++) { - tag = tag_res[j]; - post.tag.push(tag.value); - } _this.applyPostdata($(".post-full"), post, true); $(".post-full").css("display", "block"); $(".post-full .like").attr("id", "post_like_" + post.post_id).off("click").off("click").on("click", _this.submitPostVote); @@ -2688,23 +2519,11 @@ _this.pageLoaded(); return Comments.checkCert(); }; - tag_query = "SELECT value FROM tag\nWHERE post_id=" + _this.post_id; - deal_post = function(post_res, tag_res) { - if (res.error) { - return _this.cmd("dbQuery", ["SELECT *, -1 AS votes FROM post WHERE post_id = " + _this.post_id + " LIMIT 1"], function(res) { - return parse_res(res, tag_res); - }); - } else { - return parse_res(res, tag_res); - } - }; - return _this.cmd("dbQuery", [tag_query], function(tag_res) { - if (tag_res.error) { - return deal_post(res, []); - } else { - return deal_post(res, tag_res); - } - }); + if (res.error) { + return _this.cmd("dbQuery", ["SELECT *, -1 AS votes FROM post WHERE post_id = " + _this.post_id + " LIMIT 1"], parse_res); + } else { + return parse_res(res); + } }; })(this)); }; @@ -2715,9 +2534,9 @@ query = "SELECT\n post.*, COUNT(comment_id) AS comments,\n (SELECT COUNT(*) FROM post_vote WHERE post_vote.post_id = post.post_id) AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((this.page - 1) * limit) + ", " + (limit + 1); return this.cmd("dbQuery", [query], (function(_this) { return function(res) { - var deal_post, parse_res, tag_query; - parse_res = function(res, tags) { - var elem, j, l, len, len1, post, s, tag; + var parse_res; + parse_res = function(res) { + var elem, post, s, _i, _len; s = +(new Date); if (res.length > limit) { res.pop(); @@ -2726,15 +2545,8 @@ _this.applyPagerdata(_this.page, limit, false); } res.reverse(); - for (j = 0, len = res.length; j < len; j++) { - post = res[j]; - post.tag = []; - for (l = 0, len1 = tags.length; l < len1; l++) { - tag = tags[l]; - if (post.post_id === tag.post_id) { - post.tag.push(tag.value); - } - } + for (_i = 0, _len = res.length; _i < _len; _i++) { + post = res[_i]; elem = $("#post_" + post.post_id); if (elem.length === 0) { elem = $(".post.template").clone().removeClass("template").attr("id", "post_" + post.post_id); @@ -2766,24 +2578,12 @@ return false; }); }; - tag_query = "SELECT tag.* FROM tag\nLEFT JOIN (\nSELECT post_id FROM post\nORDER BY date_published DESC\nLIMIT " + ((_this.page - 1) * limit) + ", " + (limit + 1) + "\n) AS post USING (post_id)"; - deal_post = function(post_res, tag_res) { - if (res.error) { - query = "SELECT\n post.*, COUNT(comment_id) AS comments,\n -1 AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((this.page - 1) * limit) + ", " + (limit + 1); - return this.cmd("dbQuery", [query], function(res) { - return parse_res(res, tag_res); - }); - } else { - return parse_res(res, tag_res); - } - }; - return _this.cmd("dbQuery", [tag_query], function(tag_res) { - if (tag_res.error) { - return deal_post(res, []); - } else { - return deal_post(res, tag_res); - } - }); + if (res.error) { + query = "SELECT\n post.*, COUNT(comment_id) AS comments,\n -1 AS votes\nFROM post\nLEFT JOIN comment USING (post_id)\nGROUP BY post_id\nORDER BY date_published DESC\nLIMIT " + ((_this.page - 1) * limit) + ", " + (limit + 1); + return _this.cmd("dbQuery", [query], parse_res); + } else { + return parse_res(res); + } }; })(this)); }; @@ -2798,11 +2598,11 @@ }; ZeroBlog.prototype.addInlineEditors = function(parent) { - var editor, elem, elems, j, len; + var editor, elem, elems, _i, _len; this.logStart("Adding inline editors"); elems = $("[data-editable]:visible", parent); - for (j = 0, len = elems.length; j < len; j++) { - elem = elems[j]; + for (_i = 0, _len = elems.length; _i < _len; _i++) { + elem = elems[_i]; elem = $(elem); if (!elem.data("editor") && !elem.hasClass("editor")) { editor = new InlineEditor(elem, this.getContent, this.saveContent, this.getObject); @@ -2816,9 +2616,9 @@ return $("img", parent).each((function(_this) { return function(i, img_elem) { img_elem.onload = function() { - var ref, size; + var size, _ref; img_elem = $(img_elem); - size = (ref = img_elem.attr("alt")) != null ? ref.match("([0-9]+)x([0-9]+)") : void 0; + size = (_ref = img_elem.attr("alt")) != null ? _ref.match("([0-9]+)x([0-9]+)") : void 0; if (!size) { return; } @@ -2863,33 +2663,11 @@ return false; }; - ZeroBlog.prototype.tagToHtml = function(tag) { - var i, j, len, ret; - if (typeof tag === 'string') { - tag = tag.split(" "); - } - if (tag.length === 0) { - ret = "not tagged"; - } else { - ret = " "; - for (j = 0, len = tag.length; j < len; j++) { - i = tag[j]; - ret += "" + i + " "; - } - } - return ret; - }; - ZeroBlog.prototype.applyPostdata = function(elem, post, full) { - var body, date_published, tag, title_hash; + var body, date_published, title_hash; if (full == null) { full = false; } - tag = post.tag; - if (!tag) { - tag = []; - } - delete post.tag; title_hash = post.title.replace(/[#?& ]/g, "+").replace(/[+]+/g, "+"); elem.data("object", "Post:" + post.post_id); $(".title .editable", elem).html(post.title).attr("href", "?Post:" + post.post_id + ":" + title_hash).data("content", post.title); @@ -2900,11 +2678,6 @@ $(".more", elem).css("display", "inline-block").attr("href", "?Post:" + post.post_id + ":" + title_hash); } $(".details .published", elem).html(date_published).data("content", post.date_published); - if (!$(".details .tag", elem).hasClass("tagged")) { - $(".details .tag", elem).addClass("tagged"); - $(".details .tag", elem).append(this.tagToHtml(tag)); - } - $(".details .tag", elem).data("content", tag.join(" ")); if (post.comments > 0) { $(".details .comments-num", elem).css("display", "inline").attr("href", "?Post:" + post.post_id + ":" + title_hash + "#Comments"); if (post.comments > 1) { @@ -2959,9 +2732,9 @@ _this.setSiteinfo(site_info); query_my_votes = "SELECT\n 'post_vote' AS type,\n post_id AS uri\nFROM json\nLEFT JOIN post_vote USING (json_id)\nWHERE directory = 'users/" + _this.site_info.auth_address + "' AND file_name = 'data.json'"; _this.cmd("dbQuery", [query_my_votes], function(res) { - var j, len, row; - for (j = 0, len = res.length; j < len; j++) { - row = res[j]; + var row, _i, _len; + for (_i = 0, _len = res.length; _i < _len; _i++) { + row = res[_i]; _this.my_post_votes[row["uri"]] = 1; } return _this.routeUrl(window.location.search.substring(1)); @@ -2982,11 +2755,11 @@ }; ZeroBlog.prototype.getContent = function(elem, raw) { - var content, id, ref, type; + var content, id, type, _ref; if (raw == null) { raw = false; } - ref = this.getObject(elem).data("object").split(":"), type = ref[0], id = ref[1]; + _ref = this.getObject(elem).data("object").split(":"), type = _ref[0], id = _ref[1]; id = parseInt(id); content = elem.data("content"); if (elem.data("editable-mode") === "timestamp") { @@ -3000,7 +2773,7 @@ }; ZeroBlog.prototype.saveContent = function(elem, content, cb) { - var id, ref, type; + var id, type, _ref; if (cb == null) { cb = false; } @@ -3012,7 +2785,7 @@ } else { elem.data("content", content); } - ref = this.getObject(elem).data("object").split(":"), type = ref[0], id = ref[1]; + _ref = this.getObject(elem).data("object").split(":"), type = _ref[0], id = _ref[1]; id = parseInt(id); if (type === "Post" || type === "Site") { return this.saveSite(elem, type, id, content, cb); @@ -3024,65 +2797,25 @@ ZeroBlog.prototype.saveSite = function(elem, type, id, content, cb) { return this.cmd("fileGet", ["data/data.json"], (function(_this) { return function(res) { - var changeKey, data, dedup, idx, j, k, l, len, len1, post, ref, tag, tag_index, temp, v, val; + var data, post; data = JSON.parse(res); if (type === "Post") { - changeKey = elem.data("editable"); - if (changeKey !== "tag") { - post = ((function() { - var j, len, ref, results; - ref = data.post; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - post = ref[j]; - if (post.post_id === id) { - results.push(post); - } + post = ((function() { + var _i, _len, _ref, _results; + _ref = data.post; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + post = _ref[_i]; + if (post.post_id === id) { + _results.push(post); } - return results; - })())[0]; - if (elem.data("editable-mode") === "timestamp") { - content = Time.timestamp(content); - } - post[changeKey] = content; - } else { - temp = {}; - dedup = []; - ref = content.split(" "); - for (idx = j = 0, len = ref.length; j < len; idx = ++j) { - val = ref[idx]; - if (val !== "") { - temp[val] = idx; - } - } - for (k in temp) { - v = temp[k]; - dedup.push(k); - } - if (!data.tag) { - data.tag = []; - } - tag_index = (function() { - var l, len1, ref1, results; - ref1 = data.tag; - results = []; - for (l = 0, len1 = ref1.length; l < len1; l++) { - tag = ref1[l]; - if (tag.post_id !== id) { - results.push(tag); - } - } - return results; - })(); - data["tag"] = tag_index; - for (l = 0, len1 = dedup.length; l < len1; l++) { - tag = dedup[l]; - data["tag"].push({ - value: tag, - post_id: id - }); } + return _results; + })())[0]; + if (elem.data("editable-mode") === "timestamp") { + content = Time.timestamp(content); } + post[elem.data("editable")] = content; } else if (type === "Site") { data[elem.data("editable")] = content; } @@ -3090,9 +2823,7 @@ if (cb) { if (res === true) { _this.cleanupImages(); - if (elem.data("editable") === "tag") { - return cb($(".post.template span.tag").text() + _this.tagToHtml(dedup)); - } else if (elem.data("editable-mode") === "simple") { + if (elem.data("editable-mode") === "simple") { return cb(content); } else if (elem.data("editable-mode") === "timestamp") { return cb(Time.since(content)); @@ -3121,16 +2852,16 @@ var comment, json_raw; data = JSON.parse(data); comment = ((function() { - var j, len, ref, results; - ref = data.comment; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - comment = ref[j]; + var _i, _len, _ref, _results; + _ref = data.comment; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + comment = _ref[_i]; if (comment.comment_id === id) { - results.push(comment); + _results.push(comment); } } - return results; + return _results; })())[0]; comment[elem.data("editable")] = content; json_raw = unescape(encodeURIComponent(JSON.stringify(data, void 0, '\t'))); @@ -3154,49 +2885,33 @@ }; ZeroBlog.prototype.deleteObject = function(elem, cb) { - var id, inner_path, ref, type; + var id, inner_path, type, _ref; if (cb == null) { cb = False; } - ref = elem.data("object").split(":"), type = ref[0], id = ref[1]; + _ref = elem.data("object").split(":"), type = _ref[0], id = _ref[1]; id = parseInt(id); if (type === "Post") { return this.cmd("fileGet", ["data/data.json"], (function(_this) { return function(res) { - var data, post, tag, tag_index; + var data, post; data = JSON.parse(res); if (type === "Post") { post = ((function() { - var j, len, ref1, results; - ref1 = data.post; - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - post = ref1[j]; + var _i, _len, _ref1, _results; + _ref1 = data.post; + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + post = _ref1[_i]; if (post.post_id === id) { - results.push(post); + _results.push(post); } } - return results; + return _results; })())[0]; if (!post) { return false; } - if (!data.tag) { - data.tag = []; - } - tag_index = (function() { - var j, len, ref1, results; - ref1 = data.tag; - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - tag = ref1[j]; - if (tag.post_id !== id) { - results.push(tag); - } - } - return results; - })(); - data["tag"] = tag_index; data.post.splice(data.post.indexOf(post), 1); return _this.writeData(data, function(res) { if (cb) { @@ -3219,16 +2934,16 @@ var comment, json_raw; data = JSON.parse(data); comment = ((function() { - var j, len, ref1, results; - ref1 = data.comment; - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - comment = ref1[j]; + var _i, _len, _ref1, _results; + _ref1 = data.comment; + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + comment = _ref1[_i]; if (comment.comment_id === id) { - results.push(comment); + _results.push(comment); } } - return results; + return _results; })())[0]; data.comment.splice(data.comment.indexOf(comment), 1); json_raw = unescape(encodeURIComponent(JSON.stringify(data, void 0, '\t'))); @@ -3366,21 +3081,21 @@ return this.cmd("fileGet", ["data/data.json"], (function(_this) { return function(data) { return Page.cmd("fileList", "data/img", function(files) { - var file, j, len, results; - results = []; - for (j = 0, len = files.length; j < len; j++) { - file = files[j]; + var file, _i, _len, _results; + _results = []; + for (_i = 0, _len = files.length; _i < _len; _i++) { + file = files[_i]; if (file.indexOf("post_") !== 0) { continue; } if (data.indexOf(file) === -1) { _this.log("Deleting image", file, "..."); - results.push(_this.cmd("fileDelete", "data/img/" + file)); + _results.push(_this.cmd("fileDelete", "data/img/" + file)); } else { - results.push(void 0); + _results.push(void 0); } } - return results; + return _results; }); }; })(this)); @@ -3400,13 +3115,13 @@ }; ZeroBlog.prototype.setSiteinfo = function(site_info) { - var mentions_menu_elem, ref, ref1, ref2; + var mentions_menu_elem, _ref, _ref1, _ref2; this.site_info = site_info; this.event_site_info.resolve(site_info); if ($("body").hasClass("page-post")) { Comments.checkCert(); } - if (((ref = site_info.event) != null ? ref[0] : void 0) === "file_done" && site_info.event[1].match(/.*users.*data.json$/)) { + if (((_ref = site_info.event) != null ? _ref[0] : void 0) === "file_done" && site_info.event[1].match(/.*users.*data.json$/)) { if ($("body").hasClass("page-post")) { this.pagePost(); Comments.loadComments(); @@ -3420,7 +3135,7 @@ }; })(this)); } - } else if (((ref1 = site_info.event) != null ? ref1[0] : void 0) === "file_done" && site_info.event[1] === "data/data.json") { + } else if (((_ref1 = site_info.event) != null ? _ref1[0] : void 0) === "file_done" && site_info.event[1] === "data/data.json") { this.loadData(); if ($("body").hasClass("page-main")) { this.pageMain(); @@ -3428,7 +3143,7 @@ if ($("body").hasClass("page-post")) { return this.pagePost(); } - } else if (((ref2 = site_info.event) != null ? ref2[0] : void 0) === "cert_changed" && site_info.cert_user_id) { + } else if (((_ref2 = site_info.event) != null ? _ref2[0] : void 0) === "cert_changed" && site_info.cert_user_id) { this.initFollowButton(); mentions_menu_elem = this.follow.feeds["Username mentions"][1]; return setTimeout(((function(_this) { @@ -3447,4 +3162,4 @@ window.Page = new ZeroBlog(); -}).call(this); +}).call(this); \ No newline at end of file From 790f1cc35077c7e0dde1b88b623e9833718ac4f6 Mon Sep 17 00:00:00 2001 From: BinChan Date: Fri, 1 Dec 2017 18:00:14 +0800 Subject: [PATCH 07/27] Change font-size --- css/ZeroBlog.css | 6 +++--- css/all.css | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 126b771..d3ecc13 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -4,8 +4,8 @@ body { background-color: white; color: #333332; margin: 10px; padding: 0px; font body.loaded { height: auto; overflow: auto } h1, h2, h3, h4 { font-family: 'Roboto Light', sans-serif; font-weight: normal; margin: 0px; padding: 0px } h1 { font-size: 32px; line-height: 1.2em; font-weight: bold; letter-spacing: -0.5px; margin-bottom: 5px } -h2 { margin-top: 2em } -h3 { font-size: 24px; margin-top: 2em } +h2 { font-size: 24px; margin-top: 2em } +h3 { font-size: 18px; margin-top: 2em } h1 + h2, h2 + h3 { margin-top: inherit } p { margin-top: 0.9em; margin-bottom: 0.9em } @@ -131,7 +131,7 @@ a:hover { color: #3498db } .post .details .like .num { margin-left: 21px; color: #CCC; transition: all 0.3s } .post .details .like:hover .num { color: #FA6C8D } .post .details .like.loading { pointer-events: none; animation: bounce .3s infinite alternate ease-out; animation-delay: 1s; } -.post .body { font-size: 21.5px; line-height: 1.6; font-family: Tinos; margin-top: 20px } +.post .body { font-size: 15px; line-height: 1.6; font-family: Tinos; margin-top: 20px } .post .body h1 { text-align: center; margin-top: 50px } .post .body h1:before { content: " "; border-top: 1px solid #EEE; width: 120px; display: block; margin-left: auto; margin-right: auto; margin-bottom: 50px; } diff --git a/css/all.css b/css/all.css index 357ae60..3edbb4d 100644 --- a/css/all.css +++ b/css/all.css @@ -120,8 +120,8 @@ body { background-color: white; color: #333332; margin: 10px; padding: 0px; font body.loaded { height: auto; overflow: auto } h1, h2, h3, h4 { font-family: 'Roboto Light', sans-serif; font-weight: normal; margin: 0px; padding: 0px } h1 { font-size: 32px; line-height: 1.2em; font-weight: bold; letter-spacing: -0.5px; margin-bottom: 5px } -h2 { margin-top: 2em } -h3 { font-size: 24px; margin-top: 2em } +h2 { font-size: 24px; margin-top: 2em } +h3 { font-size: 18px; margin-top: 2em } h1 + h2, h2 + h3 { margin-top: inherit } p { margin-top: 0.9em; margin-bottom: 0.9em } @@ -247,7 +247,7 @@ a:hover { color: #3498db } .post .details .like .num { margin-left: 21px; color: #CCC; -webkit-transition: all 0.3s ; -moz-transition: all 0.3s ; -o-transition: all 0.3s ; -ms-transition: all 0.3s ; transition: all 0.3s } .post .details .like:hover .num { color: #FA6C8D } .post .details .like.loading { pointer-events: none; -webkit-animation: bounce .3s infinite alternate ease-out; -moz-animation: bounce .3s infinite alternate ease-out; -o-animation: bounce .3s infinite alternate ease-out; -ms-animation: bounce .3s infinite alternate ease-out; animation: bounce .3s infinite alternate ease-out ; -webkit-animation-delay: 1s; -moz-animation-delay: 1s; -o-animation-delay: 1s; -ms-animation-delay: 1s; animation-delay: 1s ; } -.post .body { font-size: 21.5px; line-height: 1.6; font-family: Tinos; margin-top: 20px } +.post .body { font-size: 15px; line-height: 1.6; font-family: Tinos; margin-top: 20px } .post .body h1 { text-align: center; margin-top: 50px } .post .body h1:before { content: " "; border-top: 1px solid #EEE; width: 120px; display: block; margin-left: auto; margin-right: auto; margin-bottom: 50px; } @@ -545,6 +545,9 @@ max-width: 600px; @media screen and (max-width: 750px) { body, html {height: 100%;} code {max-width: 100%;} +html, body, p, th, td, li { +font-size: medium !important; +} .right { width: 95%; max-width: 100%; @@ -557,12 +560,12 @@ position: absolute; margin-left: -40px; padding: 8px 40px; } -.post { -min-width: 300px; -} .editable { width: 100% !important; } +.editbg { +z-index: 0 !important; +} .left { position: fixed; left: -300px; @@ -571,7 +574,6 @@ z-index: 1; margin-left: -20px; margin-top: 0px; } - .left label[for="nav-trigger"] { display: block; cursor: pointer; @@ -617,18 +619,15 @@ left: 310px; .lastcomments { background-color: transparent; } -html, body, p, th, td, li { -font-size: medium !important; -} .lastcomments .lastcomment { font-size: 85% !important; } -.editbg { -z-index: 0 !important; -} .ae-ui .ae-toolbar-add { left: 0px !important; } +.post { +min-width: 300px; +} .post .body pre { width: 100%; } From d6d9e80d959b8b9937c26a6d4b2b70f443fd84a8 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 16 Dec 2017 11:13:48 +0800 Subject: [PATCH 08/27] UI improvement, now the width of container (left & right panel) is 960px, and the container will stay in center if the window is wider than 960px. --- css/ZeroBlog.css | 9 +++++---- css/all.css | 15 ++++++++++----- css/mobile.css | 6 +++++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index d3ecc13..0ddb04b 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -1,7 +1,7 @@ /* Design based on medium */ body { background-color: white; color: #333332; margin: 10px; padding: 0px; font-family: 'Roboto Light', sans-serif; height: 15000px; overflow: hidden; backface-visibility: hidden } -body.loaded { height: auto; overflow: auto } +body.loaded { height: auto; overflow: auto; max-width: 960px; margin-left: auto; margin-right: auto; } h1, h2, h3, h4 { font-family: 'Roboto Light', sans-serif; font-weight: normal; margin: 0px; padding: 0px } h1 { font-size: 32px; line-height: 1.2em; font-weight: bold; letter-spacing: -0.5px; margin-bottom: 5px } h2 { font-size: 24px; margin-top: 2em } @@ -79,9 +79,10 @@ a:hover { color: #3498db } /* -- Left -- */ -.left { float: left; position: absolute; width: 220px; padding-left: 20px; padding-right: 20px; margin-top: 60px; text-align: right } -.right { float: left; padding-left: 60px; margin-left: 240px; max-width: 700px; padding-right: 60px; padding-top: 60px } - +.left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } +.right { display: inline-block; width: 75%; padding-top: 60px } +.left .trigger { padding-left: 20px; } +.right .posts, .right .pager, .right .footer { padding-left: 60px; } .left .avatar { background-color: #F0F0F0; width: 60px; height: 60px; border-radius: 100%; margin-bottom: 10px; background-position: center center; background-size: 70%; display: inline-block; image-rendering: pixelated; diff --git a/css/all.css b/css/all.css index 3edbb4d..29dc5eb 100644 --- a/css/all.css +++ b/css/all.css @@ -117,7 +117,7 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro /* Design based on medium */ body { background-color: white; color: #333332; margin: 10px; padding: 0px; font-family: 'Roboto Light', sans-serif; height: 15000px; overflow: hidden; -webkit-backface-visibility: hidden ; -moz-backface-visibility: hidden ; -o-backface-visibility: hidden ; -ms-backface-visibility: hidden ; backface-visibility: hidden } -body.loaded { height: auto; overflow: auto } +body.loaded { height: auto; overflow: auto; max-width: 960px; margin-left: auto; margin-right: auto; } h1, h2, h3, h4 { font-family: 'Roboto Light', sans-serif; font-weight: normal; margin: 0px; padding: 0px } h1 { font-size: 32px; line-height: 1.2em; font-weight: bold; letter-spacing: -0.5px; margin-bottom: 5px } h2 { font-size: 24px; margin-top: 2em } @@ -195,9 +195,10 @@ a:hover { color: #3498db } /* -- Left -- */ -.left { float: left; position: absolute; width: 220px; padding-left: 20px; padding-right: 20px; margin-top: 60px; text-align: right } -.right { float: left; padding-left: 60px; margin-left: 240px; max-width: 700px; padding-right: 60px; padding-top: 60px } - +.left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } +.right { display: inline-block; width: 75%; padding-top: 60px } +.left .trigger { padding-left: 20px; } +.right .posts, .right .pager, .right .footer { padding-left: 60px; } .left .avatar { background-color: #F0F0F0; width: 60px; height: 60px; -webkit-border-radius: 100%; -moz-border-radius: 100%; -o-border-radius: 100%; -ms-border-radius: 100%; border-radius: 100% ; margin-bottom: 10px; background-position: center center; background-size: 70%; display: inline-block; image-rendering: pixelated; @@ -573,6 +574,10 @@ height: 100%; z-index: 1; margin-left: -20px; margin-top: 0px; +width: 240px; +} +.left .trigger { + padding-left: 0; } .left label[for="nav-trigger"] { display: block; @@ -580,7 +585,7 @@ cursor: pointer; position: absolute; z-index: 24; margin-top: 10px; -margin-left: 310px; +margin-left: 340px; } .left .menu-icon { background-color: #333; diff --git a/css/mobile.css b/css/mobile.css index d31cf79..214f8c3 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -41,6 +41,10 @@ height: 100%; z-index: 1; margin-left: -20px; margin-top: 0px; +width: 240px; +} +.left .trigger { + padding-left: 0; } .left label[for="nav-trigger"] { display: block; @@ -48,7 +52,7 @@ cursor: pointer; position: absolute; z-index: 24; margin-top: 10px; -margin-left: 310px; +margin-left: 340px; } .left .menu-icon { background-color: #333; From a444699b99a1c7261b25b9280986635122ec7614 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 16 Dec 2017 11:24:19 +0800 Subject: [PATCH 09/27] Add dark theme support. --- README.md | 10 ++ css/ZeroBlog.css | 2 +- css/all.css | 2 +- dark.css | 336 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 348 insertions(+), 2 deletions(-) create mode 100644 dark.css diff --git a/README.md b/README.md index ccfef6e..a547ce9 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,14 @@ You can clone it from [here](/15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f/). If you want to upgrade your present ZeroBlog to this one. Backup your blog first, then edit the `content.json` in your blog root directory and change the `"cloned_from": "..."` to `"cloned_from": "15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f"`, then go to ZeroHello, from the site option (click the 3-dot button near your blog) and choose `Upgrade code`. That's all. +If you want to use the dark theme, open `index.html` in the zite root folder and add this line: + +```diff +... + ++ +... +``` +Then sign and publish your zite. + To change the avatar replace the image /img/avatar.png with a new png, 60 by 60 pixels is recommended. \ No newline at end of file diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 0ddb04b..1dbc332 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -82,7 +82,7 @@ a:hover { color: #3498db } .left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } .right { display: inline-block; width: 75%; padding-top: 60px } .left .trigger { padding-left: 20px; } -.right .posts, .right .pager, .right .footer { padding-left: 60px; } +.right .posts, .right .post-full, .right .pager, .right .footer { padding-left: 60px; } .left .avatar { background-color: #F0F0F0; width: 60px; height: 60px; border-radius: 100%; margin-bottom: 10px; background-position: center center; background-size: 70%; display: inline-block; image-rendering: pixelated; diff --git a/css/all.css b/css/all.css index 29dc5eb..60c5425 100644 --- a/css/all.css +++ b/css/all.css @@ -198,7 +198,7 @@ a:hover { color: #3498db } .left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } .right { display: inline-block; width: 75%; padding-top: 60px } .left .trigger { padding-left: 20px; } -.right .posts, .right .pager, .right .footer { padding-left: 60px; } +.right .posts, .right .post-full, .right .pager, .right .footer { padding-left: 60px; } .left .avatar { background-color: #F0F0F0; width: 60px; height: 60px; -webkit-border-radius: 100%; -moz-border-radius: 100%; -o-border-radius: 100%; -ms-border-radius: 100%; border-radius: 100% ; margin-bottom: 10px; background-position: center center; background-size: 70%; display: inline-block; image-rendering: pixelated; diff --git a/dark.css b/dark.css new file mode 100644 index 0000000..7f98298 --- /dev/null +++ b/dark.css @@ -0,0 +1,336 @@ +/* general */ + +* { +border-color: #333 !important; +text-shadow: none !important; +} +a { +border-bottom: none; +color: #8899A6 !important; +} +a:hover { +color: #ccc !important; +} +strong { +color: #ccc; +} +textarea { +outline: 1px solid #333 !important; +background-color: #161616 !important; +color: #ccc !important; +} +select { +color: #ccc !important; +} +body { +background-color: #1b1b1b !important; +color: #ccc; +} + +h1, h2, h3, h4, h5, h6 { +color: #ccc; +} +hr { +background-color: #333; +border-bottom: 1px solid #333; +border-right: 1px solid #333; +} +:root { +background-color: transparent; +} + th { + background-color: #303030 !important; + color: #ccc !important; +} + tr { + background-color: #242424 !important; + color: #ccc !important; +} + tr:hover { + background-color: #333 !important; +} +li:nth-child(2n+1) { +background-color: transparent !important; +} +button { +background: #333; +color: #ccc; +} + ::-moz-selection { + background: rgba(200,200,200,0.2) !important; + color: #ddd !important; + } + ::selection { + background: rgba(200,200,200,0.2) !important; + color: #ddd !important; + } +::-webkit-input-placeholder { +color: #999 !important; +} +::-moz-placeholder { +color: #999 !important; +opacity: 1; +} + +/* notification */ + +.notification > .body > .message > div { +background-color: #444 !important; +} +.notification .body { +background-color: #333; +} +.notification { +color: #ccc; +} +.notification .input { +background-color: #161616 !important; +} +.notification .select:hover, .notification .select.active { +background-color: #444; +} + +/* noscript page */ +.unsupported { +background-color: #242424; +box-shadow: 0px 0px 5px #888; +} + +/* blacklist page */ +.content #details { +background-color: #303030; +box-shadow: none; +} +.content { +color: #ccc; +} + +/* code theme */ + +.hljs-tag, .hljs-name, .hljs-attribute { +color: #F0E68C; +} +.hljs-keyword, .hljs-selector-tag, .hljs-subst { +color: #F0E68C; +} +.hljs-built_in, .hljs-builtin-name { +color: #98FB98; +} +pre { +color: #ddd; +background-color: #333; /* '!important' affects NullPaste selected text color */ +border: 0px solid #060606 !important; +overflow: auto; +} +pre code { +color: #ddd; +background-color: #333 !important; +border: 0px solid #060606 !important; +} +.hljs { +color: #ddd; +background-color: #333 !important; +border: 0px solid #060606 !important; +} +code { +color: #FFA0A0; +background-color: #333 !important; +} +.hljs-title, .hljs-section, .hljs-selector-id, .hljs-selector-class { +color: #98FB98; +} +.hljs-meta { +color: #98FB98; +} +.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-tag .hljs-attr { +color: #FFA0A0; +} +.hljs-string, .hljs-doctag { +color: #FFA0A0; +} +.hljs-comment, .hljs-quote, .hljs-link { +color: #87CEEB; +} +.hljs-symbol, .hljs-bullet { +color: #FFA858; +} +.hljs-tag .hljs-title, .hljs-rules .hljs-property, .django .hljs-tag .hljs-keyword { +color: #FFA0A0; +} +.hljs-string, .hljs-tag .hljs-value, .hljs-phpdoc, .hljs-dartdoc, .tex .hljs-formula { +color: #ddd; +} +.hljs-title, .hljs-id, .scss .hljs-preprocessor { +color: #F0E68C; +} +.hljs-number, .hljs-hexcolor, .ruby .hljs-constant { +color: #FFA0A0; +} +.hljs-deletion { +background: #422; +} +.hljs-addition { +background: #242; +} +.hljs-winutils, .nginx .hljs-title, .hljs-subst, .hljs-request, .hljs-status { +color: #ddd; +} + +/* ZeroBlog */ + +.comment-new .button-submit { +background-color: #333; +} +.post { +background-color: transparent; +} +.main a { +color: #8899a6; +} +.feed-follow { +background-color: #333; +color: #ccc !important; +} +.feed-follow:hover { +background-color: #444; +} +.feed-follow.following .text-following { +color: #ccc; +} +.icon-feed { +background-color: #999 !important; +} +.icon-feed::before { +border-top: 2px solid #999 !important; +border-right: 2px solid #999 !important; +} +.icon-feed::after { +border-top: 2px solid #999 !important; +border-right: 2px solid #999 !important; +} +.feed-follow .text-follow, .feed-follow .text-following { +font-family: Roboto, Helvetica, Arial; +} +.post .body h1::before { +border-top: 1px solid #333; +} +.ae-ui .ae-container-input input, .ae-ui .ae-container-input .ae-input { +color: #ccc !important; +} +.ae-ui .ae-container-input { +background-color: #242424 !important; +} +.ae-ui .ae-toolbar, .ae-ui [class^="ae-toolbar-"] { +background-color: #333 !important; +color: #ccc !important; +} +.post .body { +font-size: 15px; +color: #ccc; +font-family: Helvetica,Arial,sans-serif; +} +.post table th { +background-color: #242424; +} +.zoom-overlay { +background: #101010; +} +.zoom-overlay-open .zoom-overlay { +opacity: 0.9; +} +.left h2 { +color: #ccc; +} +.comment, .lastcomments { +background-color: #1b1b1b; +} +.lastcomments .lastcomment .details .postlink { +border-bottom: 0px solid #BBB; +} +.post .details .comments-num .num { +border-bottom: 0px solid #eee; +color: #8899A6; +} +.bottombar { +background-color: rgba(255,255,255,0.2); +} +.button.publish { +background-color: #333; +color: #bbb; +} +.button.publish:hover { +background-color: #222; +} +.button { +background-color: #333; +color: #ccc; +} + .button.is-hovered, .button:hover { + color: #ccc; +background-color: #444; +} + +.editbg { +background-color: transparent; +} +.markdown-help { +background-color: #242424; +} +@media screen and (max-width: 750px) { +.left input ~ .trigger { +background-color: #242424; +box-shadow: none; +} +.left input:checked ~ .trigger { +box-shadow: 0px 0px 30px #555; +} +.trigger .lastcomments { +background-color: transparent; +} +} + +/* chromium scrollbar */ + +::-webkit-scrollbar + { + width: 6px !important; + height: 6px !important; + } + body::-webkit-scrollbar { + width: 6px !important; +} + ::-webkit-scrollbar-button + { + background-color: #666 !important; + } + + ::-webkit-scrollbar-track + { + background-color: #999 !important; + } + + ::-webkit-scrollbar-track-piece + { + background-color: #333 !important; + } + + ::-webkit-scrollbar-thumb + { + height: 50px !important; + background-color: #666 !important; + border-radius: 3px !important; + } + + ::-webkit-scrollbar-corner + { + background-color: #999 !important; + } + + ::-webkit-resizer + { + background-color: #666 !important; + } + +body::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important; +} From 8bcb876ba300b1bd181d7b0d42d474b5656e19e4 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 16 Dec 2017 13:29:05 +0800 Subject: [PATCH 10/27] UI improvement, now the width of container (left & right panel) is 960px, and the container will stay in center if the window is wider than 960px. --- css/ZeroBlog.css | 15 ++++++++------- css/mobile.css | 6 +++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 126b771..1dbc332 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -1,11 +1,11 @@ /* Design based on medium */ body { background-color: white; color: #333332; margin: 10px; padding: 0px; font-family: 'Roboto Light', sans-serif; height: 15000px; overflow: hidden; backface-visibility: hidden } -body.loaded { height: auto; overflow: auto } +body.loaded { height: auto; overflow: auto; max-width: 960px; margin-left: auto; margin-right: auto; } h1, h2, h3, h4 { font-family: 'Roboto Light', sans-serif; font-weight: normal; margin: 0px; padding: 0px } h1 { font-size: 32px; line-height: 1.2em; font-weight: bold; letter-spacing: -0.5px; margin-bottom: 5px } -h2 { margin-top: 2em } -h3 { font-size: 24px; margin-top: 2em } +h2 { font-size: 24px; margin-top: 2em } +h3 { font-size: 18px; margin-top: 2em } h1 + h2, h2 + h3 { margin-top: inherit } p { margin-top: 0.9em; margin-bottom: 0.9em } @@ -79,9 +79,10 @@ a:hover { color: #3498db } /* -- Left -- */ -.left { float: left; position: absolute; width: 220px; padding-left: 20px; padding-right: 20px; margin-top: 60px; text-align: right } -.right { float: left; padding-left: 60px; margin-left: 240px; max-width: 700px; padding-right: 60px; padding-top: 60px } - +.left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } +.right { display: inline-block; width: 75%; padding-top: 60px } +.left .trigger { padding-left: 20px; } +.right .posts, .right .post-full, .right .pager, .right .footer { padding-left: 60px; } .left .avatar { background-color: #F0F0F0; width: 60px; height: 60px; border-radius: 100%; margin-bottom: 10px; background-position: center center; background-size: 70%; display: inline-block; image-rendering: pixelated; @@ -131,7 +132,7 @@ a:hover { color: #3498db } .post .details .like .num { margin-left: 21px; color: #CCC; transition: all 0.3s } .post .details .like:hover .num { color: #FA6C8D } .post .details .like.loading { pointer-events: none; animation: bounce .3s infinite alternate ease-out; animation-delay: 1s; } -.post .body { font-size: 21.5px; line-height: 1.6; font-family: Tinos; margin-top: 20px } +.post .body { font-size: 15px; line-height: 1.6; font-family: Tinos; margin-top: 20px } .post .body h1 { text-align: center; margin-top: 50px } .post .body h1:before { content: " "; border-top: 1px solid #EEE; width: 120px; display: block; margin-left: auto; margin-right: auto; margin-bottom: 50px; } diff --git a/css/mobile.css b/css/mobile.css index d31cf79..214f8c3 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -41,6 +41,10 @@ height: 100%; z-index: 1; margin-left: -20px; margin-top: 0px; +width: 240px; +} +.left .trigger { + padding-left: 0; } .left label[for="nav-trigger"] { display: block; @@ -48,7 +52,7 @@ cursor: pointer; position: absolute; z-index: 24; margin-top: 10px; -margin-left: 310px; +margin-left: 340px; } .left .menu-icon { background-color: #333; From 608d0a349576b8858ec11a913967fa308d5c2481 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 16 Dec 2017 18:43:51 +0800 Subject: [PATCH 11/27] small fix --- css/ZeroBlog.css | 10 +++++----- css/mobile.css | 23 +++++++++-------------- dark.css | 26 +++++++++++++++----------- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 1dbc332..e2bc90f 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -81,8 +81,8 @@ a:hover { color: #3498db } .left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } .right { display: inline-block; width: 75%; padding-top: 60px } -.left .trigger { padding-left: 20px; } -.right .posts, .right .post-full, .right .pager, .right .footer { padding-left: 60px; } +.left .trigger { padding: 0 20px; } +.right .posts, .right .post-full, .right .pager, .right .footer { padding: 0 30px; } .left .avatar { background-color: #F0F0F0; width: 60px; height: 60px; border-radius: 100%; margin-bottom: 10px; background-position: center center; background-size: 70%; display: inline-block; image-rendering: pixelated; @@ -143,7 +143,7 @@ a:hover { color: #3498db } .post .body a img { margin-bottom: -8px } .post .body img { max-width: 100% } -.post .body table { border-collapse: collapse; margin-bottom: 10px; margin: auto } +.post .body table { display: block; width: 100%; overflow: auto; border-spacing: 0; border-collapse: collapse; margin-bottom: 10px; margin: auto } .post .body td, .post .body th { padding: 5px 10px; border: 1px solid #EEE; border-collapse: collapse; text-align: left } code { @@ -152,8 +152,8 @@ code { max-width: 660px; overflow: auto; } -.post .body pre { table-layout: fixed; width: auto; display: table; white-space: normal; } -.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 660px; display: block; overflow: auto } +.post .body pre { table-layout: fixed; width: auto; max-width: 100%; overflow: auto; white-space: normal; } +.post .body pre code { padding: 10px 20px; white-space: pre; display: block; overflow: auto } blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } /*.post .more { diff --git a/css/mobile.css b/css/mobile.css index 214f8c3..f6f2908 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -2,26 +2,20 @@ display: none; } .left .menu-icon { display: none; } -@media screen and (max-width: 1000px) { -.right { -max-width: 650px; -} -.post .body pre code { -max-width: 600px; -} -} @media screen and (max-width: 750px) { body, html {height: 100%;} -code {max-width: 100%;} +code {max-width: calc(100% 10px);} html, body, p, th, td, li { font-size: medium !important; } .right { -width: 95%; -max-width: 100%; +width: 100%; margin-left: 0px; -padding-right: 10px; -padding-left: 10px; +max-width: 750px; +} +.left .trigger { padding: 0 10px; } +.right .posts, .right .post-full, .right .pager, .right .footer { +padding: 0 10px; } .editable-edit { position: absolute; @@ -109,8 +103,9 @@ padding: 5px 5px; white-space: pre-wrap; } .post .body code { -max-width: 100%; +max-width: calc(100% - 10px); white-space: pre-wrap; +word-wrap: break-word; } } diff --git a/dark.css b/dark.css index 7f98298..da0799f 100644 --- a/dark.css +++ b/dark.css @@ -291,6 +291,7 @@ background-color: transparent; /* chromium scrollbar */ +@media screen and (min-width: 750px) { ::-webkit-scrollbar { width: 6px !important; @@ -299,11 +300,23 @@ background-color: transparent; body::-webkit-scrollbar { width: 6px !important; } - ::-webkit-scrollbar-button + + ::-webkit-scrollbar-thumb { + height: 50px !important; background-color: #666 !important; + border-radius: 3px !important; + } + + ::-webkit-scrollbar-button + { + display: none !important; } +body::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important; +} + ::-webkit-scrollbar-track { background-color: #999 !important; @@ -314,13 +327,6 @@ background-color: transparent; background-color: #333 !important; } - ::-webkit-scrollbar-thumb - { - height: 50px !important; - background-color: #666 !important; - border-radius: 3px !important; - } - ::-webkit-scrollbar-corner { background-color: #999 !important; @@ -331,6 +337,4 @@ background-color: transparent; background-color: #666 !important; } -body::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important; -} + } From 6086e97020b5c6f0755d4578c6265046a12c4676 Mon Sep 17 00:00:00 2001 From: BinChan Date: Fri, 2 Feb 2018 21:37:10 +0800 Subject: [PATCH 12/27] Dim left panel on single post page, recover when cursor is on it, idea from a wikipedia dark theme on userstyles.org --- css/ZeroBlog.css | 10 ++++++++++ css/all.css | 43 ++++++++++++++++++++++++------------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index e2bc90f..893c83d 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -206,3 +206,13 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } 0% { transform: translateY(0); } 100% { transform: translateY(-3px); } } + +@media screen and (min-width: 750px) { +.page-post .left { + opacity: 0.1; + transition: 0.4s; +} +.page-post .left:hover { + opacity: 1; +} +} diff --git a/css/all.css b/css/all.css index 60c5425..587530e 100644 --- a/css/all.css +++ b/css/all.css @@ -197,8 +197,8 @@ a:hover { color: #3498db } .left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } .right { display: inline-block; width: 75%; padding-top: 60px } -.left .trigger { padding-left: 20px; } -.right .posts, .right .post-full, .right .pager, .right .footer { padding-left: 60px; } +.left .trigger { padding: 0 20px; } +.right .posts, .right .post-full, .right .pager, .right .footer { padding: 0 30px; } .left .avatar { background-color: #F0F0F0; width: 60px; height: 60px; -webkit-border-radius: 100%; -moz-border-radius: 100%; -o-border-radius: 100%; -ms-border-radius: 100%; border-radius: 100% ; margin-bottom: 10px; background-position: center center; background-size: 70%; display: inline-block; image-rendering: pixelated; @@ -259,7 +259,7 @@ a:hover { color: #3498db } .post .body a img { margin-bottom: -8px } .post .body img { max-width: 100% } -.post .body table { border-collapse: collapse; margin-bottom: 10px; margin: auto } +.post .body table { display: block; width: 100%; overflow: auto; border-spacing: 0; border-collapse: collapse; margin-bottom: 10px; margin: auto } .post .body td, .post .body th { padding: 5px 10px; border: 1px solid #EEE; border-collapse: collapse; text-align: left } code { @@ -268,8 +268,8 @@ code { max-width: 660px; overflow: auto; } -.post .body pre { table-layout: fixed; width: auto; display: table; white-space: normal; } -.post .body pre code { padding: 10px 20px; white-space: pre; max-width: 660px; display: block; overflow: auto } +.post .body pre { table-layout: fixed; width: auto; max-width: 100%; overflow: auto; white-space: normal; } +.post .body pre code { padding: 10px 20px; white-space: pre; display: block; overflow: auto } blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } /*.post .more { @@ -332,6 +332,16 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } } +@media screen and (min-width: 750px) { +.page-post .left { + opacity: 0.1; + -webkit-transition: 0.4s; -moz-transition: 0.4s; -o-transition: 0.4s; -ms-transition: 0.4s; transition: 0.4s ; +} +.page-post .left:hover { + opacity: 1; +} +} + /* ---- /1NvpGge1v1DVL2q1KRrejveqXj8zrj6HBW/css/fonts.css ---- */ @@ -535,26 +545,20 @@ github.com style (c) Vasily Polovnyov display: none; } .left .menu-icon { display: none; } -@media screen and (max-width: 1000px) { -.right { -max-width: 650px; -} -.post .body pre code { -max-width: 600px; -} -} @media screen and (max-width: 750px) { body, html {height: 100%;} -code {max-width: 100%;} +code {max-width: calc(100% 10px);} html, body, p, th, td, li { font-size: medium !important; } .right { -width: 95%; -max-width: 100%; +width: 100%; margin-left: 0px; -padding-right: 10px; -padding-left: 10px; +max-width: 750px; +} +.left .trigger { padding: 0 10px; } +.right .posts, .right .post-full, .right .pager, .right .footer { +padding: 0 10px; } .editable-edit { position: absolute; @@ -642,8 +646,9 @@ padding: 5px 5px; white-space: pre-wrap; } .post .body code { -max-width: 100%; +max-width: calc(100% - 10px); white-space: pre-wrap; +word-wrap: break-word; } } From 449a3b752d28945a63d070b80cbcf830ee7467db Mon Sep 17 00:00:00 2001 From: BinChan Date: Fri, 2 Feb 2018 22:11:38 +0800 Subject: [PATCH 13/27] Fix left panel not in the correct position when page loading is not complete. --- css/ZeroBlog.css | 6 ++++-- css/all.css | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 893c83d..6f0a184 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -1,7 +1,9 @@ /* Design based on medium */ -body { background-color: white; color: #333332; margin: 10px; padding: 0px; font-family: 'Roboto Light', sans-serif; height: 15000px; overflow: hidden; backface-visibility: hidden } -body.loaded { height: auto; overflow: auto; max-width: 960px; margin-left: auto; margin-right: auto; } +body { + background-color: white; color: #333332; margin: 10px; padding: 0px; font-family: 'Roboto Light', sans-serif; backface-visibility: hidden; + height: auto; overflow: auto; max-width: 960px; margin-left: auto; margin-right: auto +} h1, h2, h3, h4 { font-family: 'Roboto Light', sans-serif; font-weight: normal; margin: 0px; padding: 0px } h1 { font-size: 32px; line-height: 1.2em; font-weight: bold; letter-spacing: -0.5px; margin-bottom: 5px } h2 { font-size: 24px; margin-top: 2em } diff --git a/css/all.css b/css/all.css index 587530e..cca7a2c 100644 --- a/css/all.css +++ b/css/all.css @@ -116,8 +116,10 @@ input.text:focus, textarea:focus { border-color: #5FC0EA; outline: none; backgro /* Design based on medium */ -body { background-color: white; color: #333332; margin: 10px; padding: 0px; font-family: 'Roboto Light', sans-serif; height: 15000px; overflow: hidden; -webkit-backface-visibility: hidden ; -moz-backface-visibility: hidden ; -o-backface-visibility: hidden ; -ms-backface-visibility: hidden ; backface-visibility: hidden } -body.loaded { height: auto; overflow: auto; max-width: 960px; margin-left: auto; margin-right: auto; } +body { + background-color: white; color: #333332; margin: 10px; padding: 0px; font-family: 'Roboto Light', sans-serif; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; + height: auto; overflow: auto; max-width: 960px; margin-left: auto; margin-right: auto +} h1, h2, h3, h4 { font-family: 'Roboto Light', sans-serif; font-weight: normal; margin: 0px; padding: 0px } h1 { font-size: 32px; line-height: 1.2em; font-weight: bold; letter-spacing: -0.5px; margin-bottom: 5px } h2 { font-size: 24px; margin-top: 2em } From 420859264bd34e95444cfe63413addf058a1e72e Mon Sep 17 00:00:00 2001 From: BinChan Date: Fri, 2 Feb 2018 22:41:25 +0800 Subject: [PATCH 14/27] Load left panel and footer only after page content is loaded. --- css/ZeroBlog.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 6f0a184..d3f24b9 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -80,8 +80,9 @@ a:hover { color: #3498db } .icon-help.active { background-color: #EEE } /* -- Left -- */ - -.left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } +.left, .footer { display: none } +body.loaded .footer { display: block } +body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } .right { display: inline-block; width: 75%; padding-top: 60px } .left .trigger { padding: 0 20px; } .right .posts, .right .post-full, .right .pager, .right .footer { padding: 0 30px; } From aae7bb934016d38f8a2dc03f143fbfba11ef1c68 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 3 Feb 2018 02:12:47 +0800 Subject: [PATCH 15/27] Fix left panel in mobile mode --- css/mobile.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/mobile.css b/css/mobile.css index f6f2908..acfecb4 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -28,7 +28,7 @@ width: 100% !important; .editbg { z-index: 0 !important; } -.left { +body.loaded .left { position: fixed; left: -300px; height: 100%; From d925243e5c552e33c7fd9fdb46d722614263d836 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 3 Feb 2018 21:24:13 +0800 Subject: [PATCH 16/27] TOC by Tag can be toggled on left panel now --- css/ZeroBlog.css | 3 +++ css/all.css | 10 +++++++--- index.html | 7 +++++-- js/ZeroBlog.coffee | 27 ++++++++++++--------------- js/all.js | 27 +++++++++++++-------------- 5 files changed, 40 insertions(+), 34 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index d3f24b9..c327eb2 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -215,6 +215,9 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } opacity: 0.1; transition: 0.4s; } +.page-post .left.tag-page { + opacity: 1; +} .page-post .left:hover { opacity: 1; } diff --git a/css/all.css b/css/all.css index cca7a2c..61d4df7 100644 --- a/css/all.css +++ b/css/all.css @@ -196,8 +196,9 @@ a:hover { color: #3498db } .icon-help.active { background-color: #EEE } /* -- Left -- */ - -.left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } +.left, .footer { display: none } +body.loaded .footer { display: block } +body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } .right { display: inline-block; width: 75%; padding-top: 60px } .left .trigger { padding: 0 20px; } .right .posts, .right .post-full, .right .pager, .right .footer { padding: 0 30px; } @@ -339,6 +340,9 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } opacity: 0.1; -webkit-transition: 0.4s; -moz-transition: 0.4s; -o-transition: 0.4s; -ms-transition: 0.4s; transition: 0.4s ; } +.page-post .left.tag-page { + opacity: 1; +} .page-post .left:hover { opacity: 1; } @@ -573,7 +577,7 @@ width: 100% !important; .editbg { z-index: 0 !important; } -.left { +body.loaded .left { position: fixed; left: -300px; height: 100%; diff --git a/index.html b/index.html index 0f99875..8446e86 100644 --- a/index.html +++ b/index.html @@ -67,7 +67,10 @@


    TOC by date
    - TOC by tag +
    + TOC by tag +
    +

    @@ -125,7 +128,7 @@

    Not found

    -

    Title

    +

    21 hours ago · 2 min read diff --git a/js/ZeroBlog.coffee b/js/ZeroBlog.coffee index a666fce..ae8379f 100644 --- a/js/ZeroBlog.coffee +++ b/js/ZeroBlog.coffee @@ -179,11 +179,13 @@ class ZeroBlog extends ZeroFrame ,true) pageTocByTag:(tagType) -> + @pageTocTagAll() + $(".left").addClass("tag-page") queryString = "" tag ="" #query untagged if tagType.match /^None/ - tag="all untagged" + tag="untagged" queryString = """SELECT date_published,title,post_id FROM post WHERE post_id NOT IN (SELECT DISTINCT (post_id) FROM tag) ORDER BY date_published DESC""" @@ -213,7 +215,7 @@ class ZeroBlog extends ZeroFrame @applyPostdata($(".post-full"), - title:"posts of tag:"+tag + title:tag post_id:-1 votes:-1 comments:-1 @@ -247,28 +249,23 @@ class ZeroBlog extends ZeroFrame markdown = "" tagged = res[2..] - if tagged.length > 0 - markdown += "Tagged:\n\n" - for one in tagged escaped = encodeURIComponent(one.value) - markdown += "[#{one.value}: #{one.count} post(s)]\ + markdown += "[#{one.value} (#{one.count})]\ (?Toc=tag:#{escaped})\n" untagged=total_post - res[1].count if untagged != 0 - markdown += "\n[Untagged: #{untagged} post(s)]\ + markdown += "\n[untagged (#{untagged})]\ (?Toc=tagNone)" - - @applyPostdata($(".post-full"), - title:"index by tag" - post_id:-1 - votes:-1 - comments:-1 - body:markdown - ,true) + if $(".left .tags").attr('class') == "tags" + $(".left .tags").show() + $(".left .tags").html(Text.renderMarked(markdown)) + else + $(".left .tags").hide() + $(".left .tags").toggleClass("show") if res.error @emptyTocPage("error when getting index","sorry, error happened") else diff --git a/js/all.js b/js/all.js index 8c825dc..ad4595f 100644 --- a/js/all.js +++ b/js/all.js @@ -2534,10 +2534,12 @@ ZeroBlog.prototype.pageTocByTag = function(tagType) { var queryString, tag; + this.pageTocTagAll(); + $(".left").addClass("tag-page"); queryString = ""; tag = ""; if (tagType.match(/^None/)) { - tag = "all untagged"; + tag = "untagged"; queryString = "SELECT date_published,title,post_id FROM post\nWHERE post_id NOT IN (SELECT DISTINCT (post_id) FROM tag)\nORDER BY date_published DESC"; } else { tag = decodeURIComponent(tagType.substring(1)); @@ -2560,7 +2562,7 @@ markdown += "- [" + (date.getFullYear()) + "-" + (date.getMonth() + 1) + "-" + (date.getDate()) + ":" + i.title + "](?Post:" + i.post_id + ")\n"; } return _this.applyPostdata($(".post-full"), { - title: "posts of tag:" + tag, + title: tag, post_id: -1, votes: -1, comments: -1, @@ -2589,25 +2591,22 @@ } markdown = ""; tagged = res.slice(2); - if (tagged.length > 0) { - markdown += "Tagged:\n\n"; - } for (j = 0, len = tagged.length; j < len; j++) { one = tagged[j]; escaped = encodeURIComponent(one.value); - markdown += "[" + one.value + ": " + one.count + " post(s)](?Toc=tag:" + escaped + ")\n"; + markdown += "[" + one.value + " (" + one.count + ")](?Toc=tag:" + escaped + ")\n"; } untagged = total_post - res[1].count; if (untagged !== 0) { - markdown += "\n[Untagged: " + untagged + " post(s)](?Toc=tagNone)"; + markdown += "\n[untagged (" + untagged + ")](?Toc=tagNone)"; } - return _this.applyPostdata($(".post-full"), { - title: "index by tag", - post_id: -1, - votes: -1, - comments: -1, - body: markdown - }, true); + if ($(".left .tags").attr('class') === "tags") { + $(".left .tags").show(); + $(".left .tags").html(Text.renderMarked(markdown)); + } else { + $(".left .tags").hide(); + } + return $(".left .tags").toggleClass("show"); }; if (res.error) { return _this.emptyTocPage("error when getting index", "sorry, error happened"); From 390053746850e5e07749e566a932ecbae7bf035c Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 3 Feb 2018 23:06:43 +0800 Subject: [PATCH 17/27] Change TOC by tag from link to div, or when address doesn't end with '/', TOC by tag won't work at the first click --- css/ZeroBlog.css | 2 ++ css/all.css | 2 ++ dark.css | 2 ++ index.html | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index c327eb2..0522a64 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -101,6 +101,8 @@ body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: /*.left .links { width: 230px; margin-left: -60px }*/ .left .links.editor { text-align: left !important } +.tags-label { cursor: pointer; font-size: bold; color: #3498db; font-weight: bold; } + .lastcomments { background-color: #FAFAFA; margin-left: -25px; padding-right: 15px; padding-bottom: 5px; padding-top: 3px; margin-top: 40px; margin-right: -15px; display: none } .lastcomments h3 { margin-top: 20px; } .lastcomments .lastcomment { font-size: 85%; margin-top: 20px; margin-bottom: 30px; margin-left: 20px; overflow: hidden } diff --git a/css/all.css b/css/all.css index 61d4df7..eac733b 100644 --- a/css/all.css +++ b/css/all.css @@ -217,6 +217,8 @@ body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: /*.left .links { width: 230px; margin-left: -60px }*/ .left .links.editor { text-align: left !important } +.tags-label { cursor: pointer; font-size: bold; color: #3498db; font-weight: bold; } + .lastcomments { background-color: #FAFAFA; margin-left: -25px; padding-right: 15px; padding-bottom: 5px; padding-top: 3px; margin-top: 40px; margin-right: -15px; display: none } .lastcomments h3 { margin-top: 20px; } .lastcomments .lastcomment { font-size: 85%; margin-top: 20px; margin-bottom: 30px; margin-left: 20px; overflow: hidden } diff --git a/dark.css b/dark.css index da0799f..52f3d9c 100644 --- a/dark.css +++ b/dark.css @@ -224,6 +224,8 @@ background-color: #242424 !important; background-color: #333 !important; color: #ccc !important; } +.tags-label { color: #8899a6; } +.tags-label:hover { color: #ccc; } .post .body { font-size: 15px; color: #ccc; diff --git a/index.html b/index.html index 8446e86..4e2b249 100644 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@

    TOC by date
    - TOC by tag +
    TOC by tag

    From 0c2ee70c60fc37c2e05114de0e4e88ced1ffc384 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 3 Feb 2018 23:45:05 +0800 Subject: [PATCH 18/27] Change TOC by tag from link to div, or when address doesn't end with '/', TOC by tag won't work at the first click --- css/ZeroBlog.css | 2 ++ css/all.css | 2 ++ dark.css | 2 ++ index.html | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 62a9a8b..3d4c8cb 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -114,6 +114,8 @@ body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: /*.left .links { width: 230px; margin-left: -60px }*/ .left .links.editor { text-align: left !important } +.tags-label { cursor: pointer; font-size: bold; color: #3498db; font-weight: bold; } + .lastcomments { background-color: #FAFAFA; margin-left: -25px; padding-right: 15px; padding-bottom: 5px; padding-top: 3px; margin-top: 40px; margin-right: -15px; display: none } .lastcomments h3 { margin-top: 20px; } .lastcomments .lastcomment { font-size: 85%; margin-top: 20px; margin-bottom: 30px; margin-left: 20px; overflow: hidden } diff --git a/css/all.css b/css/all.css index 4d0d463..ac142bf 100644 --- a/css/all.css +++ b/css/all.css @@ -213,6 +213,8 @@ body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: /*.left .links { width: 230px; margin-left: -60px }*/ .left .links.editor { text-align: left !important } +.tags-label { cursor: pointer; font-size: bold; color: #3498db; font-weight: bold; } + .lastcomments { background-color: #FAFAFA; margin-left: -25px; padding-right: 15px; padding-bottom: 5px; padding-top: 3px; margin-top: 40px; margin-right: -15px; display: none } .lastcomments h3 { margin-top: 20px; } .lastcomments .lastcomment { font-size: 85%; margin-top: 20px; margin-bottom: 30px; margin-left: 20px; overflow: hidden } diff --git a/dark.css b/dark.css index da0799f..52f3d9c 100644 --- a/dark.css +++ b/dark.css @@ -224,6 +224,8 @@ background-color: #242424 !important; background-color: #333 !important; color: #ccc !important; } +.tags-label { color: #8899a6; } +.tags-label:hover { color: #ccc; } .post .body { font-size: 15px; color: #ccc; diff --git a/index.html b/index.html index 8446e86..4e2b249 100644 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@

    TOC by date
    - TOC by tag +
    TOC by tag

    From f9b2a5a628cef99ed84903d1cfadf9ab8e611e4c Mon Sep 17 00:00:00 2001 From: BinChan Date: Tue, 6 Feb 2018 16:24:20 +0800 Subject: [PATCH 19/27] small fix --- css/mobile.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/css/mobile.css b/css/mobile.css index acfecb4..3a4feca 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -63,7 +63,8 @@ text-align: center; } fill: #ccc; } .left input ~ .trigger { background-color: #eee; -overflow: auto; +overflow-y: auto; +overflow-x: hidden; position: absolute; width: 100%; left: 0px; From 7d93e72c370e748a38e28ba6d6d6d74f7272c6a6 Mon Sep 17 00:00:00 2001 From: BinChan Date: Tue, 6 Feb 2018 16:30:05 +0800 Subject: [PATCH 20/27] Add banner on left panel. --- img/banner-s-dark.png | Bin 0 -> 7943 bytes img/banner-s.png | Bin 0 -> 5538 bytes index.html | 8 ++++++++ 3 files changed, 8 insertions(+) create mode 100644 img/banner-s-dark.png create mode 100644 img/banner-s.png diff --git a/img/banner-s-dark.png b/img/banner-s-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..a89ecba320c09bb099ff37ba8f386076d32d4ebb GIT binary patch literal 7943 zcmaJ`by!qiw7rCYgi6Vf0wSG~f^>&NONS^R(p}Qs-BME0AU(9wAw4vRf|PXkJN~}+ z?|XN?J9oZ2x6ZkHuf5jVVJdK0JZv&-2!inB<)qZWb|0*ASQy~DZ^$hiY%oj|Wu>5@ zf1l+}BQmh(zMY(oBRFIF--;r^nBfL?VmisclE(anih+g4fRqZxfgq|xc`0!Xx49hy zS22xVq^M&9b*sE8wg3A>7dWg#JhbT2fzF*Lo@8CC z5i&*}RYO%ZA~6EWRQZ`{AFF7jvyaa@tY3XM&`&PsQQX~&f$g?B{uvs|@-+LguuK7A z6EUjfi20%3`#*n3!~}d_S@?Bykvg*edvsJKCMz~AElp=>;`tT9?Ch+BNOlYkHnyGC z0M$#ksZfQ482a18m#-@gh3RQ%XgH{;JA4jT`=2z_*VEf9wY;F`<#iT?YMUAxt-?b?Vd59J z(}YKVhHK7+YHOzP&Zm=-dI(U<;}lu0=gK5nV>X=r&enF%w7$L`qpq&bIw&Y;GlSpOFexeNWM+Ik9)f-z zU7Y{wj(FJ8(n7Ji28KnSo{{16@@-FK<>}v9?(wB1Z!Z;<(ILeYcFpAEWV5f@WgC8I zm}FDa(~7s3+m)g=%WXHg4Gm{IaZhFE(4f`T)ob&iR4#7$_(1st`Y|Hs@UXD3Y++9q zR;Z&h0Fw|b(|vnE!NDG^hArpe>>hpD_6`nn-hXGRtFdUDwkC@k^Ying(&ySNrz>Q) zjy1GoRDHahS{&DZh*%%iThG()pPsr@mX%qtF*1fK$;;1zxA1FgXXmE5w6wH5EbKli zB;fLQMimDKhhJ1wR15N5Y0qD(5?e80ZOg1F zdH$=THx;SpK}1AEM?^w0eX>3M(BI$RB{(DmlW{2~GVjWTd6t-+u@ZY${RF*Vk|GJhM5wxjIv>t*O~2fx%!SW;J2E zr^`6JKl4~Vv^eCIj?e@?gp3(ZWF8=WRZ6NAomGEqZJl|pN&DL?ii>v&o$W4Ka`W@c zqM)F>z{PkQdfgTkHB3tug^`t&Rd2<2bue$+ZY^Cj(K$EgQO)cwk;_?}n~T!i+$!Hmyy)m?CDY!SsoQPthb;+Fq@v|+6ykZge)rdemFs!$l{Zds` zb>;)2w8X zMWNT~>faOO=zaopYkAjCK%%ENuLD61Hj9^%BnG7=CBGaU9Fjq#k)K~&7?{<}%9LbH z6o%A$)Yi2!47{IEC2{8=!y6hN)&j}F#tDKMfblqh)8F^+-*@ln>Dj|VN3FcRz6J%B zo10r!(}OW4?_XRf7EQb|<-lZ0=yz(Usxm&7$v!K=6d}?S!tYGjfqmEeIxPhCK)%o; zj1H{h{VoU!h8gox#vM6mX_jYxvdV~pHYsnF6%+*50Ys2N*Z2}cwrv-GwkIbipQI`M ziPfnwd&Y<^drC@99%ELm9U*%4w`Ms=B6sy$5YDnKKz1ysV{I_yVR~BH@XhgrvX7AG z>0b-T7lA-ngG5_d`5xk|&wlpd-Me?p(6x%Lt_KE0&C7dI<>x2fl9DoAG9r3+4fpbD zU0v-@SRWV|D6|*&r1#^;k6;LjAmM0}c+{o+AjA=Va2a@?@RpH@=_0DrxFZz*X<1}c zl%@MiLx!iw!jR8H)o*)mcQ-dL68qnwCiF{z68`PyPh&-AYptT9`rC0W*;j{OYife% z>FMR@2s%6b&_tiSaLD)6(b2I40Yw+nYpEnB=bMw0LkjKJ78Kk|NlctvZnS@@uX+|E za=Af}GFZU$Z^j7;2xv9>HErfW;v+$kjCxb8Euuv4XbXnW)zuZqWj$A`_f#g5aWCw4 z0%3sE{4NZ;bz%(bBMRKtK!>p2h+#o~e~kijZxDZ%E7(j_@x$!9YS~=Yi-+;Ci4YbY zo?5TTxTP>kALYOTtNgykmGJ*EpGHtjV$5K|q?P6C%kzVyQ11!j39vsPl%(Qkm4Y!) zqr0TPv^IZg(@q~p%GDY%hkWY$YE-{nn9=J!IqyfJ+uhL@p}dU<3ljR3Wmqg_4+MK; ze9fxz?4kA>mBytN5!A?)NTL7|<5fH??B%$qX+wGOgCrDGV%D-6p2<1T1p}KP%K{NnW9jRPM2@Ept{@mJ1jaG zthaO?NrEqUcqS#`IX~?L8Z?9_DE~w;>$DDcjnze`_z`!R)olK&Ya)P+oh?Y5DW8B}8){@N0|QkrH8u5mgdzLmSJg%C&d$!{i;D|75KW8a%EW}dLqn1KCnwUv zQ}kj9{s_%}m1m2V!<${G zbNwZTK)j#N{M_oVj)iIs1xoZ&t}U%;D=fTnCAXb(BQM`J<6j%Py%A>jX6NP{K6-g! zJ`wgfZU&rGAL@H1e<){c{Bsg8j*RZ^Zo-$s!Xq`>tPE&q0Y-P%Mpicnyk89H3W=C;Kbkv!RYXQynx{{cRV% zUmtKdpWr73BZw%?4q`z_GPJAC21=`4%EU_z?ZPVQWx_;oDI6V-9t=hbd!FJt+S&cY zKu13}YH>Rd*U_21D}I}71@2}3b zFK>GL`+}g;#%KnjDhR;e!zZ_-P)7oT@@dJ|c4TBECKngil{PDqjD&p#I%;PU zn7!W+R8dj!4A5NnQlGoqJSQfOqrT<(+SCdx7RZhq_O0uW!z|bevIa|YD_*nD zf82@>X45hW-+yZ?!Ox(*1$%b++zxQ}S-bQ7l}rd)|B>0;_O>@V1Jn=hO8q7^b$xw` z0yy$;ZLmH4rTbxRVIh4#V8ECObWCH?wwgm3fR%qn!+cP74{CJU9M3yGK28AVPH^Zq zsuaF&fe>8wPH*M`8Gcu4$sf@z5$^01LQI5@&n0Q}Ct1XbMo&*q9fGR0%MSO0pD88_ zG&VM(qd^O;o(=3kP27bOvn(Yo^K)`?#Mk_)f1Pj~RsM@b~n{9G)b6o&QF-l2E zx%(`iTvvA@3PH@w%mdG#KObOWVevsq+d2*I;o$a-60s>_r zJj*{YQf%p}wN@;lm8y3+SyXjRpR^Z6#=AAl(RTjXWTxuPgA@*<3UE+w^Jh_B4n1{)K1n-eu*oi@AQ8t<@yn)vYEHpGLQV*jE??ZMV z#CUCNY)IMJ*_jB!@~uy{rc@DZK2>lpGzBYi=N)8Sr8ws6SP5T6b1?ZQnwpxt+Pb>w z+%Q~zXrp6`nUS%P6g;nzW;VF|FuADr^)9IA3!Z1YuYMo6W#XzDxbtPa;^*Zp;OFBr zVNdbAS=;Z(KP`W1P;D;%y*G+&xEm{13gX=SYhOKtQ~HrZUy`m`Q;!manSp6QBA9X< zsAGEC6|SzX&KA>Kili&8uRqPP^4R>3ka&7tZ6c1N1pnYc9YFj27k|IO@{9=k$Z5yc zls;O7l}hv9D4fR%SccfVwwmpK_dJ9kKwyuYBX!RJNw~bpbX}UwN=f1OT0}UjzvoGx z_>n2Z0!}9+OaOu{xMTf@W1wgjs1!^QhgG>4Tc52q(SZ9M=?&4fB(;ctAnEg9L)0@$vC!cTdmh zrluwx3Q_Nm0jx9maXKaz7B9Mcd(8(TNx2mi6%=exA;7JgY-Xxfihv-BA#$GTX^9hc z1@CDJ5UB+Q<*csK4>jyc6wY3G3RxvCEYqqQ8cvAPvYZOehU2kz5XmiHzA)|s!ka-z zMRnWS+Ir*QPHi*!Mb$P-z+R%n?NeM+(}jtT&z&j+ff|2qdV6i|;&bq;8*^Y@u4DkH z3EY!|1Nm0x?bj1K^9|-FE{_z~FD!aQ^oenlxJ%`EEp3 zA(e)^QilR6l92n;y(dR<1lA}JIo;7$?LVg3dn_#B-*)zhanDi3f7->NFBjEuHBbkx zqoATgqBo1)fj}pAgW_;k0#vo2*JUlCX|l&(yL~qT=scfeYYt@4w>GPcrEGz^O1O|0 z&f-DS9S)(ln262H1K7*eiMJQbB>jK-8YMaNzH3~f(2wdKS1pSd7rZCM>uiVoHkU7C zQ)6QvC4p5s?P-t=DQ90%!$2Sgt`92oSMPKtE;tmugAs;e<2sZ1bV$MSr+K_Ixe6e@>+fRi!dCYM;D0<~D61Vm$W8OwJ{J`^k!WH|6~YrcaZ>R|b+WAr^1@ z`&ffmk4934DUlr`v_sG6{QIOydwR2!C&rpXFR{~6gABQhBOg&nVO7@heyF1j`(wl< zvo~lyb;u!-Rq2|Y@hrJK$yD8fhTcB@O?iL4viHZj4L>5rmd_ZG7ryrSNyUw+VO`tu zVu~nec>S!z4V7WU4Pn``>8AK*1W?;|HSH$qiL!JuRBWQl4&VF!+I#mR+jldN>=IB2 zSI#XK3#`J*M|Nzv-pKNy#>z71=O9c+r3w{;<(j@9KOO@-Cj(itpj2-?Zu$Zs*kjr_ zESV^>pf6couW)C2&WkPX`LWZ8JzZ6QyWqXcUF(zhEJn#y8|`gl45uM)%G>HY(;Y0p z!6Uj&ns(@P%^0L{-)g^dSfGw75`psOwZBK;Fo*=srpUKEg!pgvbB5c{8-)hl}Y zW`=TaKH*Doaj|)|c4)T=jeGQRSy@>a>tmdQi)+us&DL1nsuC?xjLBPG%@E#w)!3YU zWr4@8MyGH)JG&WGZEZ%FkV_e6MEBv_n%T!d$HI5h*7A=D8Q`li6feH2hr^u%ogO}X z=!f_UG~T@}xyx|G+S=O9pY?VA`lhC|mtL30%p@c!cHo$GP@DL(0Cy1vh^$E-c30Vc zTjK2Mx>s4kzJ`WEG?p1~FFZV)zGU0hPmHsBXz1_Jzk>bu!=)y+hlg?9Da%pYNTEH1 z^%DbcrT>X-&8Jgl7)Qo19~tl!ZSC!=ZT}f_3k#pB8X9cPg_z>UH48Q-rR1hH_=JUT z@&)7DXy3GfsW@KG_A#5En;S2LXCmqv8&hw9sj-GfDLC2H+4&~oYc!M@b`Ru)0I#H>%A^s2-8XfQPWzLN| z$m^wdRNR$oX=XO>{f4w)({{px$`GaMA3t8}Uyv!O^Gq!+dU=b9b)W+aHo)KC3>5;j z1y-ToUhxSD4NS>T<<+pCONh$XtIPB~ zAf(ph&?iQ>wszixzA~&j1$8OslHh976-w5PVg=&e_;#T~zWiZ*%S}h~r@PuS?<;Fo zeppg|GZ=NzIK5c?+4kWYP^7l9%1R$*ey7I~LF|Bc0gncd$tgh$OGJ`FZ7H3XwMx=s z&1{6nZ)3l#EpBWB9Fw|s$^tt7LNm1Y_`)o3N$rEFFiwACsHZG4$Xf3bh1-6t;frQc zN2Zk(9e&tn{9xF|Zz~+Yov46?y@CP(8QH}^Phas65AS6E;J_XO+CMyW=o=bhO_8HB zv1Srm9NZ-eUGsRBAvv*Y9A7l{c(?>TcZQrfvm@A#nPF_l|8=_;~N%B|timD%iK zHONIyd!Ll6hSYrKCaH%@LKL|BGQAFR+n>qNu8##DU0%iKFRMGNV&b%XrqX6DNAw3K`|3m^qT3u)qIV7B!R?SR2xBJ{mg~28iRm_sh8(uN}hj;$YyXS&HO5VI#PegOuMs{*=OQn7wZWw4?g9R8k)E8$RuOOCi3X>HMKN4 zcAS}*g{{29<&;w`JLG$}zWE%LE!Zghk?!rmgPOcaPG`!2Y#oOteQ{;3l*F+N2d3b} z52MZIH&|$x-Y>s-r=rPVjQOhaKrmF}g3ae@E7sN6wvoPFqv*a3FxrUW#s0c{oJ4hL zlgQlaYW$R>B;h9So6A4ILMrEQu=AiLHviX107e7fV1pUtq>NWmX(LRdMSN?6%jDJ5 zDod~j|BYvb;oG=i8goZ7rizO3@*$B#uXa-PFZhHhF4o>tsrU^h{dtiKRM{7rt5c;~ zUZ6qImd<0L_6?v%YmiKy&c8tOT3niIO*%Z1E+Uu;PESw2%*mm)gnX~BKaO{Gp##D3 zN=aE+^j~}Aw&AE_0862v0`k4+&HHeRhn|nxArx*o5BENE-w%HX3sQ#HiQLf&N%n{- zJm=;nCxpQSKqJ8Q1q3vVN=iHtL`_d`#vRce?qp}T(QC}P`V|+LIHd@OIc+#FV`7rj z?bB0JXTF$hQHXq;u^sy?O#(r>dU`8>-m`ra@u~U5R$!rEZEO34<1SDm`ta}&sa^zc zt%MgcFT!wx;|?`iSy@DrI0p%Fx;^K0H ziiY-k)`~CpgF<MS9|M6ZZFftsK3O?(W$7YJSva}BS>6xNh&C?&^P1@PDE@A z3-6|125zuD4ULdo4Sd(!8koxUiQ0}Js>9mhdjVm7DqL=&i`L}4tDLW8X=Y+7DJoyl zPFbBy6_}6RPJ)!X3r&tG-&d~df#xLVHvhr%^T4efQTSZ5TVotUx-eRswQYW8=G+Oi zae&l*yh=(+N(01$RNfdxZGTu))D7daXU{xGbHtmdsHpe=f4(-|MwX{7#xZTzu-DX1 zu9%w1F&XX++wV;=)iOsa*Oj69rmBzedSX#G(BRVE@4&u$cQxOtV+*i-;r#r($$-hy z%#2T$kJ0)i)n0$$tBm(h$wa8lT&+Bzvzm2Nw7Bq;(z7y}wLDt&-v7(?H82`wd0mEe zaCUa5Lj7nG=pN-MX?kRQ^w(xqHsR6o$x_fLiKZ!VYMt(B9l_I%zP~(^2#JjjQamyS zYyd2ZKz5;W^{8lTH{wBJ$uc}*Su#X#m7Z{$DeYbyt*-;!ajnOkxA%$m5x4ND%D z0WmQ#T5$M}V0QFI52fWcvNO1PcRP7vLmUJFCbv2-7uMh3ueUlqU9OkXX;S?dyh6@3 z3n_l9nJTfzKQDU*2U&)emX@k2D&T4=DpkTXG;azD9l|>!fsE<_O|BwCL&FD$b>?<< zRi^s-3vFl1K0fRLoxY&)mBj~AmW~4r+TUqdj$X49SWjj**b?%-KL2QGX^G}1rt>)wNo z-vWqT(o%&!wh&rL1u8T-dHH^%v{ARW7KLQ@zXSm-z>^}})Nhs%?c9>#a6Hit=03c9PRn+;%C;wa(3i%gDC;Sus5yVnm zMG<)TkCpUPW&X?HxU0VM`d2ak9|y^ET|>gYnP+SOy;5%o+P9e)qB$6D*C@^O(}jeNBnDR~#v zBqNdh;?GB_4ib?$-BQ2Y8}Yw;h|GHtz!TpTT?@dc09wqZ$S}-)N+1A`=N_KpMCAkc z5Plpu&N?|Dczxppi~v^%hokLq*2LpidsUd#mV4%3gpgkIi$??r<+POVK%&4p7hs58 z-DN2D1I7A!gz+L9BucoR3h-_?g@C%pbe51+{TAYu$6suuFWt+XzBnN7tN>~KCE>+C z63vWhMutXWp&>7~doPtJwk{U6^*roDEUuGKr{vGe$>|5rnK0a;{o249q$#49da`y_ z9QXlr6EI?!$0hCyr8wLrgguBne5|;J0E37T!cc0;6G55wnznNgKKP_4vNMPR{s5jH zu5^_{mZJXRz+0|w*+BRlcC23)61BcJlEuP(e|Gb)N zdL1~^Cg@I0L>LMB4id$et*E}!OahyVbU6;ilp)t}svr>Bm66R;C5!8*-=@}_-i*e)is zhZ?Qg14!|>fv-0BJUQa51!WEWl=t|S8>pjOGN(u_n6nFTE^rWG>_!&0MacvK!3_O+ zwvrnebN5}7mEG7zvnE6(IbZs>3<)WC2z~z4b?J&lzQcJv;=jANe5O?7=#0UiP$ilg zD47bsgg!?T0wRLR{95xR7hxX`bEqMqwwyLS;$4Bt9IU?S@imGAjDRAu>F{k{8q-HN zj#~fUmu0m@Pi=qR)oae5LtQOe%E}5qb{!pYc%uwFjGi}g8Toien2G7-H8!*EAvLsj zbp6^rZ`usIZ7#|TM`%>Z>NeaIcnMx;zoXQ0m&n1mqC(`}ylI%Q^njQnhDRE1Lnw2X9FT zl3A(!edGer^{VsoAOS<@zN4LvA6xc3sjwp^A6#)}AsTbsr`^GRXsmyD*c!i~VTwxe zJW94Gr^01w=>7a_MEoF5_D4-1^{4-j3<34nXM0EAt~yyxXs>=Ft@>EWxNw+Lq3(GH zNPVZ?)tz2|WHp&o89o$Ee3&g7f!tWxsYaN&?7ZD?_%c{K!;Jvb%?RI+i~PYiU=ezm}lyg;3{y3?gvZ^*i6(Mrz|u;IwD zG8fht>bDP&=GYEpfaAAx&QS@JBO&@UAEr1^q$+>MqplyR6b1BE303mBhuG@&V+`+`|G6 z3y4y*#fON<8wISs^#bupLQ>yA1%^3Y|Q8bd0GQS;Khk@{pI3_@9n$;s(;VnC5du` ziU-htQHBZ-J`?1`s+^uZd!)WGTf=Xqo|qr473lGJ@~sFvrE?WAOiF|AK4H7&F0K{5 z&3GK2Is=rlhRDLL7+h|-%1>VVt7K2aT+r0Y-^MZXEwH#j%0sME^&ws3);NDzJR%gA zP1aw!eb`QS*3<4zHJ+uCGC$oJl@b@4$3N~ri z7_b2wf{L7+gy2d-xc6cm+#5}n<}vN+QvQ=AH4x93-t{6P%jVI1&13jCCaGe2F#mj| z%pWj!Uvz1Lo{u~)JRWz`B{E6+!*u>b7%jh)(X!|eO03bUdiumn{5g31STc0KMK`rE zrr!W0U_#BCv2D>Fm!Zh)ZW`k~*hPVQxC~Tf58->wk~?|J{Zts6yWM!}tL^9;wove% zOpsKLz*`rqSmPeD%3o26%{ioOMcmsl$GBpT zBJ>BgW}(T8(Em6_69>}V-c_971Ysz7X)14bJ)R!^>?zx5$g%2>{I zwDkBp=Zwv8{f#z{RV7jhRGrPW7HwaK8oFJ(@fh4d3Ul_Y60?(_esI_n#KJ*WUoTI`rrSNHp_ z-KYbS{gJ!8^d(Ntk+Ft1p+M1A_+P3$VM{E7^X!L;(-$CxE_QHBr)!x*!WR%evAic6 z&S%zzyAK3U9qA0A7vUDu7pi!NL_$6RCeS<%J7h{sRwi8#GENdRA zk*eWgth<6isrUD0H7{ME_CQ7mI)xVwl5bWMeT8tTy^w?PD`nZGCJ4tU$CPcnX~KVF zW|nnEdumxR@IpBDaXXlRg6>=DYDP%JP4PO^iFMsQL*^t?|Q7PJe zIIPj{B%Shj@8Fd$#t+4?Y=6ps{&D+<$jEo^(>Lj>mu>{fjXao{#710T3j7I&-%d1N zL`dStx!=MnBhk(m+LxO~le>3MX zz?hCeOxD!J)jpcER<=6aU!5(4LG`5^xbNym-+zBoQko8e2;*;-l8oM*-xtNYlJz@* zXUx(DI=Xwyk;`*V?_)S`7)VR^GP5tQ%3W`=thg%P-gK$*dN<<3(#mjTKf2CkMulU0 z%b?ETOwts@gWR(V84Ussi3a1|{}!|8W900%d3Bs4?rxkVD}GoUk7xR=zq=zyokjut+waG8+bO^ZJ8{m0G5+fKAlqY*WSqUBk zs#LxF6<;*%hT;he+BfmGDVlw0s0aGYQ1v+$5MQMO-wzq_#yP3rx%lcwfB4h`rwUIl z`pfCM>5jlB>i5#KY$4By@o2)JlPcbwSQSB)m$)cH8KM@&73{t6HVDl7lqgPVq54`B zYtl{egaD+++S1%_P1GsKs8yu8bETiG$KSMlF{*(F`i+az8ThwMdXtU&;Le8KK9YO1 zI`dUp%IzJ~;12f|3#DEtalcL4ujSVpPNtweQ-?lyP+Bhy|HBjOmD9byCIVFt^p>Yp zj?%KX{nvHG!3qH0m@D_mTa|ottfb?!BF4~U>qiJljLc{gv=kfsRY=gK*l~=~oiN+$ z68-Be9@$qX5|S9+m|?lVAl*r1ED@yIIA^+Gp0APLT~_@C7&xw6C% zIdZn*@Gv`Nv!VIkK@^IxibXsUQqkVg+GUp3TQd!FX^loBmI>osq2^V&+=bSuX0xhT zm@0XL)%9a?FG7ShV8FV(E}}0i(DU1V)mbVb?nDRKV{93zN(Z_wt)jxuH)a#(IzA%F zLee@5Db}f^FP^Ec5ovxY8_6^j7p7Fz&v#($?|)xz^_{$0A}=}b#+jHJiW5O{3$>VL z4X@|R{v|@uh-5e1Lr>@-133F?jG~6@>J4m2BaNcF!hiM8wHaUErY`d9VjTZhxkP1~ zIT6b6+k1V}-xeD4OV{W0qi?8YfAvIM6`p-4$FEs5k_~aIS3t_dt{lQ<7()rD^hc-~ zze-<-t0uWPuv#Z_yUzc+5sylvIO&D2#zvy{?|kv83r?|S zJj;#0O|kPHR`F!g(8R-}4Zr zN1sTbl-lvd<&h-Ho-2I2OEx`bghE0Ej|p>$VhJ3fkE5C_K3+%R%P-tS)gRm5YQ>p9 z^5(Wi5TT*lMLD3Iwp;rAGx^0O=+3hzRG(i*WqAHJpA zyk#PH1-pH8*3ntVM(_SNMWYFpX+@5AR-U=bOGhMNQ+{S1C97h3gxar5jM3yyL-|0; zJHain5135zoMtkg>2g(7OX!vv=M8vpR??A_X+y*0q*%#E9c_M-#z=?bd=AVv^q)sRm8;ThW99Iyz)Hn9>KLXLQ6XGju}UFnSW>O zYDqsUMA}y2u~JrU$EJ`oZBvN7MTSmECM1qsxmXNu`QdVnuRX1<@WbVFP(P?j_(-ld zv)oeGy9DcUbo3CQW>0g#>nJVKZMc(l*mC9WdCeF}-zku(;(sB{;2Ge|P~r6ej0&Ne zw8Yh6q!l8wi+}IP81#|P1&iCF(1=B3$0oMI4Kahkvw9cdktJKJb-b%Z0+Sqd%;^ix zWk%J;W@uk`2-DOfW$d4VzxlqA}DNF{sw`hBr)3y;t38%tP^-kO%Q3;s!_3J81 z36&985N~;ho-0fEf=u9~8BgGhlS%(jcJ}1)QQhPVt2w#y^nyoMvBHp|O_*J$`lohe z_(wzWHWn@2XK*AOUsCT=Hf8`syN##V6!d6ez@%50o$-YXg!e<+f&FsgzM&s`jMGa< znnJ;S@bEOnwwyP{-$ISw__VFv3YZrv;x|%voULTaJV&|`j&iFeWFzi?8_vMN%Yk-f z-bc@@Gy>f#DXVned;rKQ1hpPELUjhRvG2*IyryjZhVMrD8%R4 z3o}`rTd80Ap4>n{X`rayPKk;*KVC`=X?st*XBM5C8bSrUIu zx27RMA@($(zPHk_?lxl=I9nvOU#f0?g?rfYaVIU1LaT<3Lv z9QQg##wgpxq@Latest comments:

    + + + + From 5b51867740fcc2604bcdd274f496c008027510d8 Mon Sep 17 00:00:00 2001 From: BinChan Date: Tue, 6 Feb 2018 16:48:37 +0800 Subject: [PATCH 21/27] Change lastcomment background color to transparent --- css/ZeroBlog.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index 0522a64..c6963ea 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -103,7 +103,7 @@ body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: .tags-label { cursor: pointer; font-size: bold; color: #3498db; font-weight: bold; } -.lastcomments { background-color: #FAFAFA; margin-left: -25px; padding-right: 15px; padding-bottom: 5px; padding-top: 3px; margin-top: 40px; margin-right: -15px; display: none } +.lastcomments { background-color: transparent; margin-left: -25px; padding-right: 15px; padding-bottom: 5px; padding-top: 3px; margin-top: 40px; margin-right: -15px; display: none } .lastcomments h3 { margin-top: 20px; } .lastcomments .lastcomment { font-size: 85%; margin-top: 20px; margin-bottom: 30px; margin-left: 20px; overflow: hidden } .lastcomments .lastcomment .user_name { font-weight: bold; } From 4e32bd7a34b40349e19ba9ea8cc6890438257cc1 Mon Sep 17 00:00:00 2001 From: BinChan Date: Tue, 6 Feb 2018 16:50:31 +0800 Subject: [PATCH 22/27] add border for banner --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index bad46b8..f0dd1b2 100644 --- a/index.html +++ b/index.html @@ -93,7 +93,7 @@

    Latest comments:

    From 4ae29cf5bae9d4a0daa836e26ab3c5b39a7d5fe3 Mon Sep 17 00:00:00 2001 From: BinChan Date: Tue, 6 Feb 2018 17:02:07 +0800 Subject: [PATCH 23/27] Set left panel width to 280px so that the banner is always in full width --- css/ZeroBlog.css | 6 +++--- css/mobile.css | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index c6963ea..a7879be 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -82,8 +82,8 @@ a:hover { color: #3498db } /* -- Left -- */ .left, .footer { display: none } body.loaded .footer { display: block } -body.loaded .left { float: left; display: inline-block; width: 25%; margin-top: 60px; text-align: right } -.right { display: inline-block; width: 75%; padding-top: 60px } +body.loaded .left { float: left; display: inline-block; width: 280px; margin-top: 60px; text-align: right } +.right { display: inline-block; width: calc(100% - 280px); padding-top: 60px } .left .trigger { padding: 0 20px; } .right .posts, .right .post-full, .right .pager, .right .footer { padding: 0 30px; } .left .avatar { @@ -212,7 +212,7 @@ blockquote { border-left: 3px solid #333; margin-left: 0px; padding-left: 1em } 100% { transform: translateY(-3px); } } -@media screen and (min-width: 750px) { +@media screen and (min-width: 840px) { .page-post .left { opacity: 0.1; transition: 0.4s; diff --git a/css/mobile.css b/css/mobile.css index 3a4feca..a605121 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -2,7 +2,7 @@ display: none; } .left .menu-icon { display: none; } -@media screen and (max-width: 750px) { +@media screen and (max-width: 840px) { body, html {height: 100%;} code {max-width: calc(100% 10px);} html, body, p, th, td, li { From 0e7ef644fe1515e5343808b4c0c5e70b99a78d13 Mon Sep 17 00:00:00 2001 From: BinChan Date: Tue, 6 Feb 2018 17:23:01 +0800 Subject: [PATCH 24/27] fix dark.css --- dark.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dark.css b/dark.css index 52f3d9c..9f9d594 100644 --- a/dark.css +++ b/dark.css @@ -278,7 +278,7 @@ background-color: transparent; .markdown-help { background-color: #242424; } -@media screen and (max-width: 750px) { +@media screen and (max-width: 840px) { .left input ~ .trigger { background-color: #242424; box-shadow: none; From 0786bc26f0f8ef86a17d691abe9ce8b236aa4998 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sat, 10 Feb 2018 18:25:45 +0800 Subject: [PATCH 25/27] Update Readme. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a547ce9..c1f22a0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # ZeroBlog Plus There is [a ZeroBlog that supports tag and date index](https://github.com/zeronetscript/ZeroBlog/tree/toc_by_tag), but it's based on an old version, which doesn't support alloy-editor and image inserting yet. I use the awesome [meld tool](http://meldmerge.org/) and merge the code base, also add some mobile support. -You can clone it from [here](/15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f/). +You can clone it from [here](zero://15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f/). -If you want to upgrade your present ZeroBlog to this one. Backup your blog first, then edit the `content.json` in your blog root directory and change the `"cloned_from": "..."` to `"cloned_from": "15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f"`, then go to ZeroHello, from the site option (click the 3-dot button near your blog) and choose `Upgrade code`. That's all. +If you want to upgrade your present ZeroBlog to this one. Backup your blog first, then edit the `content.json` in your blog root directory and change the `"cloned_from": "..."` to `"cloned_from": "15mSYzsDxzarssqtV1pFPKqoCTaLdjVB2f"` and sign it, then go to ZeroHello, from the site option (click the 3-dot button near your blog) and choose `Upgrade code`. That's all. If you want to use the dark theme, open `index.html` in the zite root folder and add this line: From 2317591271c6f9d71fc1b67584cd2ecfb3b80917 Mon Sep 17 00:00:00 2001 From: BinChan Date: Sun, 11 Feb 2018 11:09:55 +0800 Subject: [PATCH 26/27] Fix scrollbar returning to top when editing in Markdown mode --- js/utils/Meditor.coffee | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/utils/Meditor.coffee b/js/utils/Meditor.coffee index 10f41b1..028025c 100644 --- a/js/utils/Meditor.coffee +++ b/js/utils/Meditor.coffee @@ -45,8 +45,6 @@ class Meditor extends Class @tag_markdown = @tag.previousSibling @tag_markdown.innerHTML = "" @autoHeight(@tag_markdown.firstChild) - @tag_markdown.firstChild.oninput = => - @autoHeight(@tag_markdown.firstChild) @tag_markdown.style.display = "none" @@ -115,4 +113,4 @@ class Meditor extends Class val: => return @getMarkdown() -window.Meditor = Meditor \ No newline at end of file +window.Meditor = Meditor From 5f73611b6bae741a29d539dd919f12a65db5ebdf Mon Sep 17 00:00:00 2001 From: BinChan Date: Thu, 22 Feb 2018 20:09:27 +0800 Subject: [PATCH 27/27] Fix text getting hidden in Markdown mode, and small improvement for code text style. --- alloy-editor/meditor.css | 4 ++-- css/ZeroBlog.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alloy-editor/meditor.css b/alloy-editor/meditor.css index ddf2ab6..cb69106 100644 --- a/alloy-editor/meditor.css +++ b/alloy-editor/meditor.css @@ -8,7 +8,7 @@ .meditor-editmode.markdown { border-color: #9C27B0; background-color: #9C27B0; color: white; } .meditor-markdown { width: 100%; font-family: monospace; font-size: 14px; line-height: 1.6; box-sizing: border-box; padding: 10px; - border: 1px solid #bbb; border-radius: 3px; box-shadow: inset 0px 4px 5px -5px rgba(0, 0, 0, 0.4); overflow: hidden; + border: 1px solid #bbb; border-radius: 3px; box-shadow: inset 0px 4px 5px -5px rgba(0, 0, 0, 0.4); overflow: auto; } .ae-icon-h2:before { content: "T"; display: inline-block; line-height: 0px; vertical-align: 3px; font-size: 23px; font-family: serif; } @@ -27,4 +27,4 @@ h2.empty:before { content: "Heading"; color: #DDD; position: absolute; pointer-events: none; } h3.empty:before { content: "Sub-Heading"; color: #DDD; position: absolute; pointer-events: none; } -.meditor hr:first-of-type { display: block !important; position: absolute; margin: 0px; border-bottom: 1px dashed #DEDEDE; width: 100% } \ No newline at end of file +.meditor hr:first-of-type { display: block !important; position: absolute; margin: 0px; border-bottom: 1px dashed #DEDEDE; width: 100% } diff --git a/css/ZeroBlog.css b/css/ZeroBlog.css index a7879be..7bbe748 100644 --- a/css/ZeroBlog.css +++ b/css/ZeroBlog.css @@ -152,7 +152,7 @@ body.loaded .left { float: left; display: inline-block; width: 280px; margin-top .post .body td, .post .body th { padding: 5px 10px; border: 1px solid #EEE; border-collapse: collapse; text-align: left } code { - background-color: #f5f5f5; border: 1px solid #ccc; padding: 0px 5px; overflow: auto; border-radius: 2px; display: inline-block; + background-color: #f5f5f5; border: 1px solid #ccc; padding: 0px 5px; overflow: auto; border-radius: 2px; display: inline; color: #444; font-weight: normal; font-size: 13px; vertical-align: text-bottom; border-bottom-width: 2px; max-width: 660px; overflow: auto;