├── .gitignore ├── app ├── app.js ├── img │ ├── cnodejs_light.svg │ ├── icon_error.svg │ ├── icon_info.svg │ ├── icon_success.svg │ └── icon_warning.svg ├── index.html ├── lib │ ├── bower.json │ ├── code-prettify │ │ ├── lang-apollo.js │ │ ├── lang-clj.js │ │ ├── lang-css.js │ │ ├── lang-go.js │ │ ├── lang-hs.js │ │ ├── lang-lisp.js │ │ ├── lang-lua.js │ │ ├── lang-ml.js │ │ ├── lang-n.js │ │ ├── lang-proto.js │ │ ├── lang-scala.js │ │ ├── lang-sql.js │ │ ├── lang-tex.js │ │ ├── lang-vb.js │ │ ├── lang-vhdl.js │ │ ├── lang-wiki.js │ │ ├── lang-xq.js │ │ ├── lang-yaml.js │ │ └── prettify.js │ └── mditor │ │ ├── font │ │ ├── 674f50d287a8c48dc19ba404d20fe713.eot │ │ ├── 912ec66d7572ff821749319396470bde.svg │ │ ├── a48ac41620cd818c5020d0f4302489ff.ttf │ │ ├── af7ae505a9eed503f8b8e6982036873e.woff2 │ │ ├── b06871f281fee6b241d60582ae9369b9.ttf │ │ └── fee66e712a8a08eef5805a46892932ad.woff │ │ ├── index.html │ │ └── js │ │ ├── mditor.js │ │ └── mditor.min.js ├── modules │ ├── auth │ │ ├── auth.html │ │ ├── authController.js │ │ └── authService.js │ ├── common │ │ ├── editor │ │ │ └── editorDirective.js │ │ ├── message │ │ │ ├── message.html │ │ │ ├── messageDirective.js │ │ │ └── messageService.js │ │ └── requestService.js │ ├── directives │ │ ├── autofocusDirective.js │ │ ├── hoverPopupDirective.js │ │ ├── loadingButtonDirective.js │ │ └── replyTrangleDirective.js │ ├── main │ │ ├── main.html │ │ └── mainController.js │ ├── topicEdit │ │ ├── topicEdit.html │ │ ├── topicEditController.js │ │ └── topicEditService.js │ ├── topicInfo │ │ ├── topicInfo.html │ │ ├── topicInfoController.js │ │ └── topicInfoService.js │ ├── topicList │ │ ├── topicList.html │ │ ├── topicListController.js │ │ └── topicListService.js │ ├── userCard │ │ ├── userCard.html │ │ └── userCardDirective.js │ └── userInfo │ │ ├── userInfo.html │ │ ├── userInfoController.js │ │ └── userInfoService.js └── style │ ├── css │ └── .gitkeep │ └── sass │ ├── base.scss │ ├── editor.scss │ ├── login.scss │ ├── main.scss │ ├── markdown.scss │ ├── message.scss │ ├── topic.scss │ ├── user.scss │ └── userCard.scss ├── dist └── .gitkeep ├── icon.icns ├── index.js ├── menu.js ├── package.json ├── readme.md └── uikit ├── index.html ├── lib └── bower.json ├── readme.md └── style ├── .sass-cache ├── 3ba488fdfbc78971641fce13030a68c63786cf7b │ └── base.scssc ├── 668eb442b432740ea9d2399596fb6a7c064b5cbb │ ├── base.scssc │ └── index.scssc └── 8cc6fe8dfb5d7d8edbf3e9ed79f953aa78fb04c5 │ ├── _index.scssc │ ├── base.scssc │ ├── index.scssc │ └── test.scssc ├── css ├── base.css ├── base.css.map ├── index.css └── index.css.map └── scss ├── base.scss └── index.scss /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.sh 3 | src/style/*.css 4 | *.css 5 | !src/style/core.css 6 | bower_components 7 | TODOS.md 8 | node_modules 9 | package-lock.json 10 | dist/* 11 | !dist/.gitkeep 12 | *.map 13 | .sass-cache 14 | -------------------------------------------------------------------------------- /app/app.js: -------------------------------------------------------------------------------- 1 | moment.locale('zh-cn'); 2 | Mditor.$options.props.split = false; 3 | 4 | window.ipc = require("electron").ipcRenderer; 5 | window.shell = require("electron").shell; 6 | window.APP = angular.module("APP", ["ui.router", "ngSanitize", "infinite-scroll", "ngAnimate"]); 7 | window.APP.run(["$http", "$state", "$rootScope", ($http, $state, $rootScope) => { 8 | /* markdown内部的链接在浏览器中打开 */ 9 | $(document).on("click", ".markdown-text a, a[target=_blank]", function () { 10 | event.preventDefault(); 11 | let href = $(this).attr('href') || ""; 12 | if (href.startsWith("/user/")) { 13 | let loginname = href.replace(/\/user\/(.*)$/, "$1"); 14 | $state.go("main.userInfo", {loginname: loginname}); 15 | } else { 16 | window.shell.openExternal(href); 17 | } 18 | }); 19 | 20 | $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8" 21 | 22 | // 条件判断 23 | // 从localStorage或者sessionStorage中读取用户信息,如果不存在,则进入登录界面 24 | // 否则在$rootScope上挂载用户信息,进入主页面 25 | 26 | function getUser () { 27 | var user; 28 | user = localStorage.getItem("user") || sessionStorage.getItem("user"); 29 | if (user) { 30 | try { 31 | user = JSON.parse(user); 32 | } catch (error) { 33 | console.log("Invalid format for user info!"); 34 | } 35 | } 36 | return user; 37 | } 38 | 39 | var user = getUser(); 40 | 41 | if (user) { 42 | $rootScope.user = user; 43 | ipc.send("login-success"); 44 | $state.go("main.topicList"); 45 | } else { 46 | $state.go("auth"); 47 | } 48 | }]); 49 | 50 | window.APP.config(["$stateProvider", "$urlRouterProvider", ($stateProvider, $urlRouterProvider) => { 51 | $stateProvider 52 | .state("auth", { 53 | templateUrl: "modules/auth/auth.html" 54 | }).state("main", { 55 | templateUrl: "modules/main/main.html" 56 | }).state("main.topicList", { 57 | templateUrl: "modules/topicList/topicList.html" 58 | }).state("main.topicInfo", { 59 | params: { topicId: null }, 60 | templateUrl: 'modules/topicInfo/topicInfo.html' 61 | }).state("main.topicEdit", { 62 | params: { topicId: null }, 63 | templateUrl: 'modules/topicEdit/topicEdit.html' 64 | }).state("main.userInfo", { 65 | params: { loginname: null }, 66 | templateUrl: 'modules/userInfo/userInfo.html' 67 | }) 68 | }]); 69 | 70 | 71 | window.APP.filter("fromNow", function () { 72 | return function (input) { 73 | input = input || ""; 74 | return moment(input).fromNow(); 75 | }; 76 | }); 77 | 78 | window.APP.filter("topicTabFormatter", function () { 79 | return function (input) { 80 | input = input || ""; 81 | if (input == "share") { 82 | return "分享"; 83 | } else if (input == "ask") { 84 | return "问答"; 85 | } else if (input == "job") { 86 | return "招聘"; 87 | } else if (input == "dev") { 88 | return "测试"; 89 | } 90 | return input; 91 | }; 92 | }); 93 | 94 | window.APP.filter("pretty", ["$log", function ($log) { 95 | return function (input) { 96 | if (typeof prettyPrintOne !== "function") { 97 | $log.warn("code-pretty is not install!"); 98 | return input; 99 | } 100 | var container = document.createElement("div"); 101 | container.innerHTML = input; 102 | /* 修复图片路径 */ 103 | let $imgs = $(container).find("img"); 104 | $imgs.each(function () { 105 | let src = $(this).attr("src") || ""; 106 | if (src.startsWith("//")) { 107 | $(this).attr("src", "http:" + src); 108 | } 109 | }); 110 | prettyPrint(null, container); 111 | return container.innerHTML; 112 | }; 113 | }]); 114 | 115 | window.APP.filter('imgFix', () => { 116 | return input => { 117 | input = input || ""; 118 | if (input.startsWith("//")) { 119 | return "http:" + input; 120 | } 121 | return input; 122 | }; 123 | }); -------------------------------------------------------------------------------- /app/img/cnodejs_light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Created with Sketch. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/img/icon_error.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_danger 4 | Created with Sketch. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/img/icon_info.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_info 4 | Created with Sketch. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/img/icon_success.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_success 4 | Created with Sketch. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/img/icon_warning.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_warning 4 | Created with Sketch. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | CNODE 25 | 26 | 27 | 28 | Loading... 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /app/lib/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lib", 3 | "homepage": "https://github.com/P-ppc/cnodejs", 4 | "authors": [ 5 | "P-ppc " 6 | ], 7 | "description": "", 8 | "main": "", 9 | "license": "MIT", 10 | "ignore": [ 11 | "**/.*", 12 | "node_modules", 13 | "bower_components", 14 | "test", 15 | "tests" 16 | ], 17 | "dependencies": { 18 | "jquery": "^3.1.1", 19 | "angular": "1.5", 20 | "angular-route": "1.5", 21 | "normalize-css": "normalize.css#^5.0.0", 22 | "font-awesome": "fontawesome#^4.7.0", 23 | "moment": "^2.18.1", 24 | "ngInfiniteScroll": "^1.3.4", 25 | "angular-sanitize": "1.5", 26 | "lodash": "^4.17.4", 27 | "angular-ui-router": "^1.0.3" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["com", /^#[^\n\r]*/, null, "#"], 3 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"], 4 | ["str", /^"(?:[^"\\]|\\[\S\s])*(?:"|$)/, null, '"'] 5 | ], [ 6 | ["kwd", /^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 7 | null], 8 | ["typ", /^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/, null], 9 | ["lit", /^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/], 10 | ["pln", /^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/], 11 | ["pun", /^[^\w\t\n\r "'-);\\\xa0]+/] 12 | ]), ["apollo", "agc", "aea"]); 13 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a = null; 17 | PR.registerLangHandler(PR.createSimpleLexer([ 18 | ["opn", /^[([{]+/, a, "([{"], 19 | ["clo", /^[)\]}]+/, a, ")]}"], 20 | ["com", /^;[^\n\r]*/, a, ";"], 21 | ["pln", /^[\t\n\r \xa0]+/, a, "\t\n\r \xa0"], 22 | ["str", /^"(?:[^"\\]|\\[\S\s])*(?:"|$)/, a, '"'] 23 | ], [ 24 | ["kwd", /^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/, a], 25 | ["typ", /^:[\dA-Za-z-]+/] 26 | ]), ["clj"]); 27 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\f\r ]+/, null, " \t\r\n "] 3 | ], [ 4 | ["str", /^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/, null], 5 | ["str", /^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/, null], 6 | ["lang-css-str", /^url\(([^"')]*)\)/i], 7 | ["kwd", /^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i, null], 8 | ["lang-css-kw", /^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i], 9 | ["com", /^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], 10 | ["com", 11 | /^(?:<\!--|--\>)/], 12 | ["lit", /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i], 13 | ["lit", /^#[\da-f]{3,6}/i], 14 | ["pln", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i], 15 | ["pun", /^[^\s\w"']+/] 16 | ]), ["css"]); 17 | PR.registerLangHandler(PR.createSimpleLexer([], [ 18 | ["kwd", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i] 19 | ]), ["css-kw"]); 20 | PR.registerLangHandler(PR.createSimpleLexer([], [ 21 | ["str", /^[^"')]+/] 22 | ]), ["css-str"]); 23 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"], 3 | ["pln", /^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/, null, "\"'"] 4 | ], [ 5 | ["com", /^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/], 6 | ["pln", /^(?:[^"'/`]|\/(?![*/]))+/] 7 | ]), ["go"]); 8 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t-\r ]+/, null, "\t\n \r "], 3 | ["str", /^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/, null, '"'], 4 | ["str", /^'(?:[^\n\f\r'\\]|\\[^&])'?/, null, "'"], 5 | ["lit", /^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i, null, "0123456789"] 6 | ], [ 7 | ["com", /^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/], 8 | ["kwd", /^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 9 | null], 10 | ["pln", /^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/], 11 | ["pun", /^[^\d\t-\r "'A-Za-z]+/] 12 | ]), ["hs"]); 13 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a = null; 2 | PR.registerLangHandler(PR.createSimpleLexer([ 3 | ["opn", /^\(+/, a, "("], 4 | ["clo", /^\)+/, a, ")"], 5 | ["com", /^;[^\n\r]*/, a, ";"], 6 | ["pln", /^[\t\n\r \xa0]+/, a, "\t\n\r \xa0"], 7 | ["str", /^"(?:[^"\\]|\\[\S\s])*(?:"|$)/, a, '"'] 8 | ], [ 9 | ["kwd", /^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, a], 10 | ["lit", /^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i], 11 | ["lit", /^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/], 12 | ["pln", /^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i], 13 | ["pun", /^[^\w\t\n\r "'-);\\\xa0]+/] 14 | ]), ["cl", "el", "lisp", "scm"]); 15 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"], 3 | ["str", /^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/, null, "\"'"] 4 | ], [ 5 | ["com", /^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/], 6 | ["str", /^\[(=*)\[[\S\s]*?(?:]\1]|$)/], 7 | ["kwd", /^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, null], 8 | ["lit", /^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 9 | ["pln", /^[_a-z]\w*/i], 10 | ["pun", /^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/] 11 | ]), ["lua"]); 12 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-ml.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"], 3 | ["com", /^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i, null, "#"], 4 | ["str", /^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/, null, "\"'"] 5 | ], [ 6 | ["com", /^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/], 7 | ["kwd", /^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 8 | ["lit", /^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 9 | ["pln", /^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i], 10 | ["pun", /^[^\w\t\n\r "'\xa0]+/] 11 | ]), ["fs", "ml"]); 12 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a = null; 2 | PR.registerLangHandler(PR.createSimpleLexer([ 3 | ["str", /^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/, a, '"'], 4 | ["com", /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/, a, "#"], 5 | ["pln", /^\s+/, a, " \r\n\t\xa0"] 6 | ], [ 7 | ["str", /^@"(?:[^"]|"")*(?:"|$)/, a], 8 | ["str", /^<#[^#>]*(?:#>|$)/, a], 9 | ["str", /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, a], 10 | ["com", /^\/\/[^\n\r]*/, a], 11 | ["com", /^\/\*[\S\s]*?(?:\*\/|$)/, 12 | a], 13 | ["kwd", /^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 14 | a], 15 | ["typ", /^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/, a], 16 | ["lit", /^@[$_a-z][\w$@]*/i, a], 17 | ["typ", /^@[A-Z]+[a-z][\w$@]*/, a], 18 | ["pln", /^'?[$_a-z][\w$@]*/i, a], 19 | ["lit", /^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, a, "0123456789"], 20 | ["pun", /^.[^\s\w"-$'./@`]*/, a] 21 | ]), ["n", "nemerle"]); 22 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords: "bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true", types: /^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/, cStyleComments: !0}), ["proto"]); 2 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"], 3 | ["str", /^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/, null, '"'], 4 | ["lit", /^`(?:[^\n\r\\`]|\\.)*`?/, null, "`"], 5 | ["pun", /^[!#%&(--:-@[-^{-~]+/, null, "!#%&()*+,-:;<=>?@[\\]^{|}~"] 6 | ], [ 7 | ["str", /^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/], 8 | ["lit", /^'[$A-Z_a-z][\w$]*(?![\w$'])/], 9 | ["kwd", /^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 10 | ["lit", /^(?:true|false|null|this)\b/], 11 | ["lit", /^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i], 12 | ["typ", /^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/], 13 | ["pln", /^[$A-Z_a-z][\w$]*/], 14 | ["com", /^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/], 15 | ["pun", /^(?:\.+|\/)/] 16 | ]), ["scala"]); 17 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-sql.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"], 3 | ["str", /^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/, null, "\"'"] 4 | ], [ 5 | ["com", /^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/], 6 | ["kwd", /^(?:add|all|alter|and|any|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|merge|national|nocheck|nonclustered|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|percent|plan|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rule|save|schema|select|session_user|set|setuser|shutdown|some|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|union|unique|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|writetext)(?=[^\w-]|$)/i, 7 | null], 8 | ["lit", /^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 9 | ["pln", /^[_a-z][\w-]*/i], 10 | ["pun", /^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/] 11 | ]), ["sql"]); 12 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"], 3 | ["com", /^%[^\n\r]*/, null, "%"] 4 | ], [ 5 | ["kwd", /^\\[@-Za-z]+/], 6 | ["kwd", /^\\./], 7 | ["typ", /^[$&]/], 8 | ["lit", /[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i], 9 | ["pun", /^[()=[\]{}]+/] 10 | ]), ["latex", "tex"]); 11 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-vb.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0\u2028\u2029]+/, null, "\t\n\r �\xa0

"], 3 | ["str", /^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i, null, '"“”'], 4 | ["com", /^['\u2018\u2019].*/, null, "'‘’"] 5 | ], [ 6 | ["kwd", /^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, 7 | null], 8 | ["com", /^rem.*/i], 9 | ["lit", /^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i], 10 | ["pln", /^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*])/i], 11 | ["pun", /^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/], 12 | ["pun", /^(?:\[|])/] 13 | ]), ["vb", "vbs"]); 14 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\t\n\r \xa0]+/, null, "\t\n\r �\xa0"] 3 | ], [ 4 | ["str", /^(?:[box]?"(?:[^"]|"")*"|'.')/i], 5 | ["com", /^--[^\n\r]*/], 6 | ["kwd", /^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 7 | null], 8 | ["typ", /^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i, null], 9 | ["typ", /^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i, null], 10 | ["lit", /^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], 11 | ["pln", /^(?:[a-z]\w*|\\[^\\]*\\)/i], 12 | ["pun", /^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/] 13 | ]), ["vhdl", "vhd"]); 14 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["pln", /^[\d\t a-gi-z\xa0]+/, null, "\t �\xa0abcdefgijklmnopqrstuvwxyz0123456789"], 3 | ["pun", /^[*=[\]^~]+/, null, "=*~^[]"] 4 | ], [ 5 | ["lang-wiki.meta", /(?:^^|\r\n?|\n)(#[a-z]+)\b/], 6 | ["lit", /^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/], 7 | ["lang-", /^{{{([\S\s]+?)}}}/], 8 | ["lang-", /^`([^\n\r`]+)`/], 9 | ["str", /^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i], 10 | ["pln", /^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/] 11 | ]), ["wiki"]); 12 | PR.registerLangHandler(PR.createSimpleLexer([ 13 | ["kwd", /^#[a-z]+/i, null, "#"] 14 | ], []), ["wiki.meta"]); 15 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-xq.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([ 2 | ["var pln", /^\$[\w-]+/, null, "$"] 3 | ], [ 4 | ["pln", /^[\s=][<>][\s=]/], 5 | ["lit", /^@[\w-]+/], 6 | ["tag", /^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i], 7 | ["com", /^\(:[\S\s]*?:\)/], 8 | ["pln", /^[(),/;[\]{}]$/], 9 | ["str", /^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/, null, "\"'"], 10 | ["kwd", /^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], 11 | ["typ", /^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/, null], 12 | ["fun pln", /^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], 13 | ["pln", /^[\w:-]+/], 14 | ["pln", /^[\t\n\r \xa0]+/] 15 | ]), ["xq", "xquery"]); 16 | -------------------------------------------------------------------------------- /app/lib/code-prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a = null; 2 | PR.registerLangHandler(PR.createSimpleLexer([ 3 | ["pun", /^[:>?|]+/, a, ":|>?"], 4 | ["dec", /^%(?:YAML|TAG)[^\n\r#]+/, a, "%"], 5 | ["typ", /^&\S+/, a, "&"], 6 | ["typ", /^!\S*/, a, "!"], 7 | ["str", /^"(?:[^"\\]|\\.)*(?:"|$)/, a, '"'], 8 | ["str", /^'(?:[^']|'')*(?:'|$)/, a, "'"], 9 | ["com", /^#[^\n\r]*/, a, "#"], 10 | ["pln", /^\s+/, a, " \t\r\n"] 11 | ], [ 12 | ["dec", /^(?:---|\.\.\.)(?:[\n\r]|$)/], 13 | ["pun", /^-/], 14 | ["kwd", /^\w+:[\n\r ]/], 15 | ["pln", /^\w+/] 16 | ]), ["yaml", "yml"]); 17 | -------------------------------------------------------------------------------- /app/lib/code-prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q = null; 2 | window.PR_SHOULD_USE_CONTINUATION = !0; 3 | (function () { 4 | function L(a) { 5 | function m(a) { 6 | var f = a.charCodeAt(0); 7 | if (f !== 92)return f; 8 | var b = a.charAt(1); 9 | return(f = r[b]) ? f : "0" <= b && b <= "7" ? parseInt(a.substring(1), 8) : b === "u" || b === "x" ? parseInt(a.substring(2), 16) : a.charCodeAt(1) 10 | } 11 | 12 | function e(a) { 13 | if (a < 32)return(a < 16 ? "\\x0" : "\\x") + a.toString(16); 14 | a = String.fromCharCode(a); 15 | if (a === "\\" || a === "-" || a === "[" || a === "]")a = "\\" + a; 16 | return a 17 | } 18 | 19 | function h(a) { 20 | for (var f = a.substring(1, a.length - 1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g), a = 21 | [], b = [], o = f[0] === "^", c = o ? 1 : 0, i = f.length; c < i; ++c) { 22 | var j = f[c]; 23 | if (/\\[bdsw]/i.test(j))a.push(j); else { 24 | var j = m(j), d; 25 | c + 2 < i && "-" === f[c + 1] ? (d = m(f[c + 2]), c += 2) : d = j; 26 | b.push([j, d]); 27 | d < 65 || j > 122 || (d < 65 || j > 90 || b.push([Math.max(65, j) | 32, Math.min(d, 90) | 32]), d < 97 || j > 122 || b.push([Math.max(97, j) & -33, Math.min(d, 122) & -33])) 28 | } 29 | } 30 | b.sort(function (a, f) { 31 | return a[0] - f[0] || f[1] - a[1] 32 | }); 33 | f = []; 34 | j = [NaN, NaN]; 35 | for (c = 0; c < b.length; ++c)i = b[c], i[0] <= j[1] + 1 ? j[1] = Math.max(j[1], i[1]) : f.push(j = i); 36 | b = ["["]; 37 | o && b.push("^"); 38 | b.push.apply(b, a); 39 | for (c = 0; c < 40 | f.length; ++c)i = f[c], b.push(e(i[0])), i[1] > i[0] && (i[1] + 1 > i[0] && b.push("-"), b.push(e(i[1]))); 41 | b.push("]"); 42 | return b.join("") 43 | } 44 | 45 | function y(a) { 46 | for (var f = a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g), b = f.length, d = [], c = 0, i = 0; c < b; ++c) { 47 | var j = f[c]; 48 | j === "(" ? ++i : "\\" === j.charAt(0) && (j = +j.substring(1)) && j <= i && (d[j] = -1) 49 | } 50 | for (c = 1; c < d.length; ++c)-1 === d[c] && (d[c] = ++t); 51 | for (i = c = 0; c < b; ++c)j = f[c], j === "(" ? (++i, d[i] === void 0 && (f[c] = "(?:")) : "\\" === j.charAt(0) && 52 | (j = +j.substring(1)) && j <= i && (f[c] = "\\" + d[i]); 53 | for (i = c = 0; c < b; ++c)"^" === f[c] && "^" !== f[c + 1] && (f[c] = ""); 54 | if (a.ignoreCase && s)for (c = 0; c < b; ++c)j = f[c], a = j.charAt(0), j.length >= 2 && a === "[" ? f[c] = h(j) : a !== "\\" && (f[c] = j.replace(/[A-Za-z]/g, function (a) { 55 | a = a.charCodeAt(0); 56 | return"[" + String.fromCharCode(a & -33, a | 32) + "]" 57 | })); 58 | return f.join("") 59 | } 60 | 61 | for (var t = 0, s = !1, l = !1, p = 0, d = a.length; p < d; ++p) { 62 | var g = a[p]; 63 | if (g.ignoreCase)l = !0; else if (/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi, ""))) { 64 | s = !0; 65 | l = !1; 66 | break 67 | } 68 | } 69 | for (var r = 70 | {b: 8, t: 9, n: 10, v: 11, f: 12, r: 13}, n = [], p = 0, d = a.length; p < d; ++p) { 71 | g = a[p]; 72 | if (g.global || g.multiline)throw Error("" + g); 73 | n.push("(?:" + y(g) + ")") 74 | } 75 | return RegExp(n.join("|"), l ? "gi" : "g") 76 | } 77 | 78 | function M(a) { 79 | function m(a) { 80 | switch (a.nodeType) { 81 | case 1: 82 | if (e.test(a.className))break; 83 | for (var g = a.firstChild; g; g = g.nextSibling)m(g); 84 | g = a.nodeName; 85 | if ("BR" === g || "LI" === g)h[s] = "\n", t[s << 1] = y++, t[s++ << 1 | 1] = a; 86 | break; 87 | case 3: 88 | case 4: 89 | g = a.nodeValue, g.length && (g = p ? g.replace(/\r\n?/g, "\n") : g.replace(/[\t\n\r ]+/g, " "), h[s] = g, t[s << 1] = y, y += g.length, 90 | t[s++ << 1 | 1] = a) 91 | } 92 | } 93 | 94 | var e = /(?:^|\s)nocode(?:\s|$)/, h = [], y = 0, t = [], s = 0, l; 95 | a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = document.defaultView.getComputedStyle(a, q).getPropertyValue("white-space")); 96 | var p = l && "pre" === l.substring(0, 3); 97 | m(a); 98 | return{a: h.join("").replace(/\n$/, ""), c: t} 99 | } 100 | 101 | function B(a, m, e, h) { 102 | m && (a = {a: m, d: a}, e(a), h.push.apply(h, a.e)) 103 | } 104 | 105 | function x(a, m) { 106 | function e(a) { 107 | for (var l = a.d, p = [l, "pln"], d = 0, g = a.a.match(y) || [], r = {}, n = 0, z = g.length; n < z; ++n) { 108 | var f = g[n], b = r[f], o = void 0, c; 109 | if (typeof b === 110 | "string")c = !1; else { 111 | var i = h[f.charAt(0)]; 112 | if (i)o = f.match(i[1]), b = i[0]; else { 113 | for (c = 0; c < t; ++c)if (i = m[c], o = f.match(i[1])) { 114 | b = i[0]; 115 | break 116 | } 117 | o || (b = "pln") 118 | } 119 | if ((c = b.length >= 5 && "lang-" === b.substring(0, 5)) && !(o && typeof o[1] === "string"))c = !1, b = "src"; 120 | c || (r[f] = b) 121 | } 122 | i = d; 123 | d += f.length; 124 | if (c) { 125 | c = o[1]; 126 | var j = f.indexOf(c), k = j + c.length; 127 | o[2] && (k = f.length - o[2].length, j = k - c.length); 128 | b = b.substring(5); 129 | B(l + i, f.substring(0, j), e, p); 130 | B(l + i + j, c, C(b, c), p); 131 | B(l + i + k, f.substring(k), e, p) 132 | } else p.push(l + i, b) 133 | } 134 | a.e = p 135 | } 136 | 137 | var h = {}, y; 138 | (function () { 139 | for (var e = a.concat(m), 140 | l = [], p = {}, d = 0, g = e.length; d < g; ++d) { 141 | var r = e[d], n = r[3]; 142 | if (n)for (var k = n.length; --k >= 0;)h[n.charAt(k)] = r; 143 | r = r[1]; 144 | n = "" + r; 145 | p.hasOwnProperty(n) || (l.push(r), p[n] = q) 146 | } 147 | l.push(/[\S\s]/); 148 | y = L(l) 149 | })(); 150 | var t = m.length; 151 | return e 152 | } 153 | 154 | function u(a) { 155 | var m = [], e = []; 156 | a.tripleQuotedStrings ? m.push(["str", /^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, q, "'\""]) : a.multiLineStrings ? m.push(["str", /^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 157 | q, "'\"`"]) : m.push(["str", /^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/, q, "\"'"]); 158 | a.verbatimStrings && e.push(["str", /^@"(?:[^"]|"")*(?:"|$)/, q]); 159 | var h = a.hashComments; 160 | h && (a.cStyleComments ? (h > 1 ? m.push(["com", /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, q, "#"]) : m.push(["com", /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/, q, "#"]), e.push(["str", /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, q])) : m.push(["com", /^#[^\n\r]*/, 161 | q, "#"])); 162 | a.cStyleComments && (e.push(["com", /^\/\/[^\n\r]*/, q]), e.push(["com", /^\/\*[\S\s]*?(?:\*\/|$)/, q])); 163 | a.regexLiterals && e.push(["lang-regex", /^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]); 164 | (h = a.types) && e.push(["typ", h]); 165 | a = ("" + a.keywords).replace(/^ | $/g, 166 | ""); 167 | a.length && e.push(["kwd", RegExp("^(?:" + a.replace(/[\s,]+/g, "|") + ")\\b"), q]); 168 | m.push(["pln", /^\s+/, q, " \r\n\t\xa0"]); 169 | e.push(["lit", /^@[$_a-z][\w$@]*/i, q], ["typ", /^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/, q], ["pln", /^[$_a-z][\w$@]*/i, q], ["lit", /^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, q, "0123456789"], ["pln", /^\\[\S\s]?/, q], ["pun", /^.[^\s\w"-$'./@\\`]*/, q]); 170 | return x(m, e) 171 | } 172 | 173 | function D(a, m) { 174 | function e(a) { 175 | switch (a.nodeType) { 176 | case 1: 177 | if (k.test(a.className))break; 178 | if ("BR" === a.nodeName)h(a), 179 | a.parentNode && a.parentNode.removeChild(a); else for (a = a.firstChild; a; a = a.nextSibling)e(a); 180 | break; 181 | case 3: 182 | case 4: 183 | if (p) { 184 | var b = a.nodeValue, d = b.match(t); 185 | if (d) { 186 | var c = b.substring(0, d.index); 187 | a.nodeValue = c; 188 | (b = b.substring(d.index + d[0].length)) && a.parentNode.insertBefore(s.createTextNode(b), a.nextSibling); 189 | h(a); 190 | c || a.parentNode.removeChild(a) 191 | } 192 | } 193 | } 194 | } 195 | 196 | function h(a) { 197 | function b(a, d) { 198 | var e = d ? a.cloneNode(!1) : a, f = a.parentNode; 199 | if (f) { 200 | var f = b(f, 1), g = a.nextSibling; 201 | f.appendChild(e); 202 | for (var h = g; h; h = g)g = h.nextSibling, f.appendChild(h) 203 | } 204 | return e 205 | } 206 | 207 | for (; !a.nextSibling;)if (a = a.parentNode, !a)return; 208 | for (var a = b(a.nextSibling, 0), e; (e = a.parentNode) && e.nodeType === 1;)a = e; 209 | d.push(a) 210 | } 211 | 212 | var k = /(?:^|\s)nocode(?:\s|$)/, t = /\r\n?|\n/, s = a.ownerDocument, l; 213 | a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = s.defaultView.getComputedStyle(a, q).getPropertyValue("white-space")); 214 | var p = l && "pre" === l.substring(0, 3); 215 | for (l = s.createElement("LI"); a.firstChild;)l.appendChild(a.firstChild); 216 | for (var d = [l], g = 0; g < d.length; ++g)e(d[g]); 217 | m === (m | 0) && d[0].setAttribute("value", 218 | m); 219 | var r = s.createElement("OL"); 220 | r.className = "linenums"; 221 | for (var n = Math.max(0, m - 1 | 0) || 0, g = 0, z = d.length; g < z; ++g)l = d[g], l.className = "L" + (g + n) % 10, l.firstChild || l.appendChild(s.createTextNode("\xa0")), r.appendChild(l); 222 | a.appendChild(r) 223 | } 224 | 225 | function k(a, m) { 226 | for (var e = m.length; --e >= 0;) { 227 | var h = m[e]; 228 | A.hasOwnProperty(h) ? window.console && console.warn("cannot override language handler %s", h) : A[h] = a 229 | } 230 | } 231 | 232 | function C(a, m) { 233 | if (!a || !A.hasOwnProperty(a))a = /^\s*= o && (h += 2); 272 | e >= c && (a += 2) 273 | } 274 | } catch (w) { 275 | "console"in window && console.log(w && w.stack ? w.stack : w) 276 | } 277 | } 278 | 279 | var v = ["break,continue,do,else,for,if,return,while"], w = [ 280 | [v, "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 281 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof" 282 | ], F = [w, "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"], G = [w, "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 283 | H = [G, "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"], w = [w, "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"], I = [v, "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 284 | J = [v, "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"], v = [v, "case,done,elif,esac,eval,fi,function,in,local,set,then,until"], K = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/, N = /\S/, O = u({keywords: [F, H, w, "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END" + 285 | I, J, v], hashComments: !0, cStyleComments: !0, multiLineStrings: !0, regexLiterals: !0}), A = {}; 286 | k(O, ["default-code"]); 287 | k(x([], [ 288 | ["pln", /^[^]*(?:>|$)/], 290 | ["com", /^<\!--[\S\s]*?(?:--\>|$)/], 291 | ["lang-", /^<\?([\S\s]+?)(?:\?>|$)/], 292 | ["lang-", /^<%([\S\s]+?)(?:%>|$)/], 293 | ["pun", /^(?:<[%?]|[%?]>)/], 294 | ["lang-", /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i], 295 | ["lang-js", /^]*>([\S\s]*?)(<\/script\b[^>]*>)/i], 296 | ["lang-css", /^]*>([\S\s]*?)(<\/style\b[^>]*>)/i], 297 | ["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i] 298 | ]), 299 | ["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"]); 300 | k(x([ 301 | ["pln", /^\s+/, q, " \t\r\n"], 302 | ["atv", /^(?:"[^"]*"?|'[^']*'?)/, q, "\"'"] 303 | ], [ 304 | ["tag", /^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i], 305 | ["atn", /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i], 306 | ["lang-uq.val", /^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/], 307 | ["pun", /^[/<->]+/], 308 | ["lang-js", /^on\w+\s*=\s*"([^"]+)"/i], 309 | ["lang-js", /^on\w+\s*=\s*'([^']+)'/i], 310 | ["lang-js", /^on\w+\s*=\s*([^\s"'>]+)/i], 311 | ["lang-css", /^style\s*=\s*"([^"]+)"/i], 312 | ["lang-css", /^style\s*=\s*'([^']+)'/i], 313 | ["lang-css", 314 | /^style\s*=\s*([^\s"'>]+)/i] 315 | ]), ["in.tag"]); 316 | k(x([], [ 317 | ["atv", /^[\S\s]+/] 318 | ]), ["uq.val"]); 319 | k(u({keywords: F, hashComments: !0, cStyleComments: !0, types: K}), ["c", "cc", "cpp", "cxx", "cyc", "m"]); 320 | k(u({keywords: "null,true,false"}), ["json"]); 321 | k(u({keywords: H, hashComments: !0, cStyleComments: !0, verbatimStrings: !0, types: K}), ["cs"]); 322 | k(u({keywords: G, cStyleComments: !0}), ["java"]); 323 | k(u({keywords: v, hashComments: !0, multiLineStrings: !0}), ["bsh", "csh", "sh"]); 324 | k(u({keywords: I, hashComments: !0, multiLineStrings: !0, tripleQuotedStrings: !0}), 325 | ["cv", "py"]); 326 | k(u({keywords: "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END", hashComments: !0, multiLineStrings: !0, regexLiterals: !0}), ["perl", "pl", "pm"]); 327 | k(u({keywords: J, hashComments: !0, multiLineStrings: !0, regexLiterals: !0}), ["rb"]); 328 | k(u({keywords: w, cStyleComments: !0, regexLiterals: !0}), ["js"]); 329 | k(u({keywords: "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 330 | hashComments: 3, cStyleComments: !0, multilineStrings: !0, tripleQuotedStrings: !0, regexLiterals: !0}), ["coffee"]); 331 | k(x([], [ 332 | ["str", /^[\S\s]+/] 333 | ]), ["regex"]); 334 | window.prettyPrintOne = function (a, m, e) { 335 | var h = document.createElement("PRE"); 336 | h.innerHTML = a; 337 | e && D(h, e); 338 | E({g: m, i: e, h: h}); 339 | return h.innerHTML 340 | }; 341 | window.prettyPrint = function (a) { 342 | function m() { 343 | for (var e = window.PR_SHOULD_USE_CONTINUATION ? l.now() + 250 : Infinity; p < h.length && l.now() < e; p++) { 344 | var n = h[p], k = n.className; 345 | if (k.indexOf("prettyprint") >= 0) { 346 | var k = k.match(g), f, b; 347 | if (b = !k) { 348 | b = n; 349 | for (var o = void 0, c = b.firstChild; c; c = c.nextSibling)var i = c.nodeType, o = i === 1 ? o ? b : c : i === 3 ? N.test(c.nodeValue) ? b : o : o; 350 | b = (f = o === b ? void 0 : o) && "CODE" === f.tagName 351 | } 352 | b && (k = f.className.match(g)); 353 | k && (k = k[1]); 354 | b = !1; 355 | for (o = n.parentNode; o; o = o.parentNode)if ((o.tagName === "pre" || o.tagName === "code" || o.tagName === "xmp") && o.className && o.className.indexOf("prettyprint") >= 0) { 356 | b = !0; 357 | break 358 | } 359 | b || ((b = (b = n.className.match(/\blinenums\b(?::(\d+))?/)) ? b[1] && b[1].length ? +b[1] : !0 : !1) && D(n, b), d = {g: k, h: n, i: b}, E(d)) 360 | } 361 | } 362 | p < h.length ? setTimeout(m, 363 | 250) : a && a() 364 | } 365 | 366 | for (var e = [document.getElementsByTagName("pre"), document.getElementsByTagName("code"), document.getElementsByTagName("xmp")], h = [], k = 0; k < e.length; ++k)for (var t = 0, s = e[k].length; t < s; ++t)h.push(e[k][t]); 367 | var e = q, l = Date; 368 | l.now || (l = {now: function () { 369 | return+new Date 370 | }}); 371 | var p = 0, d, g = /\blang(?:uage)?-([\w.]+)(?!\S)/; 372 | m() 373 | }; 374 | window.PR = {createSimpleLexer: x, registerLangHandler: k, sourceDecorator: u, PR_ATTRIB_NAME: "atn", PR_ATTRIB_VALUE: "atv", PR_COMMENT: "com", PR_DECLARATION: "dec", PR_KEYWORD: "kwd", PR_LITERAL: "lit", 375 | PR_NOCODE: "nocode", PR_PLAIN: "pln", PR_PUNCTUATION: "pun", PR_SOURCE: "src", PR_STRING: "str", PR_TAG: "tag", PR_TYPE: "typ"} 376 | })(); 377 | -------------------------------------------------------------------------------- /app/lib/mditor/font/674f50d287a8c48dc19ba404d20fe713.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/app/lib/mditor/font/674f50d287a8c48dc19ba404d20fe713.eot -------------------------------------------------------------------------------- /app/lib/mditor/font/a48ac41620cd818c5020d0f4302489ff.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/app/lib/mditor/font/a48ac41620cd818c5020d0f4302489ff.ttf -------------------------------------------------------------------------------- /app/lib/mditor/font/af7ae505a9eed503f8b8e6982036873e.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/app/lib/mditor/font/af7ae505a9eed503f8b8e6982036873e.woff2 -------------------------------------------------------------------------------- /app/lib/mditor/font/b06871f281fee6b241d60582ae9369b9.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/app/lib/mditor/font/b06871f281fee6b241d60582ae9369b9.ttf -------------------------------------------------------------------------------- /app/lib/mditor/font/fee66e712a8a08eef5805a46892932ad.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/app/lib/mditor/font/fee66e712a8a08eef5805a46892932ad.woff -------------------------------------------------------------------------------- /app/lib/mditor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mditor 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 |
22 | 25 |
26 | 27 | 28 | 29 | 30 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /app/modules/auth/auth.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/modules/auth/authController.js: -------------------------------------------------------------------------------- 1 | window.APP.controller("AuthCtrl", [ 2 | "$rootScope", 3 | "$scope", 4 | "$state", 5 | "$timeout", 6 | "MessageService", 7 | "AuthService", 8 | ($rootScope, $scope, $state, $timeout, MessageService, AuthService) => { 9 | 10 | $scope.auth = () => { 11 | $scope.busy = true; 12 | AuthService.auth($scope.accessToken).then(data => { 13 | data.accessToken = $scope.accessToken; 14 | localStorage.setItem("user", JSON.stringify(data)); 15 | $rootScope.user = data; 16 | ipc.send("login-success"); 17 | $state.go("main.topicList"); 18 | }).catch(error => { 19 | MessageService.error("登录出错,请输入正确的AccessToken"); 20 | }).finally(() => { 21 | $timeout(() => { 22 | $scope.busy = false; 23 | }, 500); 24 | }); 25 | }; 26 | }]); -------------------------------------------------------------------------------- /app/modules/auth/authService.js: -------------------------------------------------------------------------------- 1 | window.APP.factory("AuthService", ["RequestService", (RequestService) => { 2 | var service = {}; 3 | 4 | service.auth = accessToken => { 5 | return RequestService.post( 6 | "https://cnodejs.org/api/v1/accesstoken", 7 | { accesstoken: accessToken } 8 | ).then(data => { 9 | return data; 10 | }); 11 | }; 12 | 13 | return service; 14 | }]); -------------------------------------------------------------------------------- /app/modules/common/editor/editorDirective.js: -------------------------------------------------------------------------------- 1 | window.APP.directive("mEditor", [ 2 | "$log", 3 | ($log) => { 4 | 5 | return { 6 | restrict: 'EA', 7 | require: '?ngModel', 8 | link: ($scope, $element, $attrs, ngModel) => { 9 | $element.append(``); 10 | let mditor = Mditor.fromTextarea($element.find("textarea")[0]); 11 | mditor.on("ready", () => { 12 | mditor.toolbar.removeItem("help"); 13 | mditor.toolbar.removeItem("toggleSplit"); 14 | 15 | if (!ngModel) { 16 | return ; 17 | } 18 | 19 | ngModel.$render = () => { 20 | mditor.value = ngModel.$viewValue || ""; 21 | }; 22 | ngModel.$render(); 23 | 24 | // 直接监控元素,更加流畅 25 | let $textarea = $element.find(".textarea"); 26 | $textarea.on("blur keydown keyup change", () => { 27 | $scope.$apply(() => { 28 | ngModel.$setViewValue($textarea.val()); 29 | }); 30 | }); 31 | }); 32 | } 33 | }; 34 | }]); -------------------------------------------------------------------------------- /app/modules/common/message/message.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

5 |
8 |
9 |
-------------------------------------------------------------------------------- /app/modules/common/message/messageDirective.js: -------------------------------------------------------------------------------- 1 | window.APP.directive("mMessage", [ 2 | "$timeout", 3 | "$animate", 4 | ($timeout, $animate) => { 5 | 6 | return { 7 | restrict: 'EA', 8 | replace: true, 9 | scope: { 10 | mImgSrc: '@', 11 | mMessageContent: '@', 12 | mMessageClose: '@', 13 | mDuration: '@' 14 | }, 15 | templateUrl: 'modules/common/message/message.html', 16 | link: ($scope, $element, $attrs, $transclude) => { 17 | let $body = $element.parent(); 18 | $animate.enter($element, $body, $body.children(':last')); 19 | 20 | $scope.showClose = () => $scope.mMessageClose === "true"; 21 | $scope.close = () => $animate.leave($element); 22 | 23 | let duration = parseInt($scope.mDuration); 24 | if (duration > 0) { 25 | $timeout(() => $scope.close(), duration); 26 | } 27 | } 28 | } 29 | }]); -------------------------------------------------------------------------------- /app/modules/common/message/messageService.js: -------------------------------------------------------------------------------- 1 | window.APP.factory("MessageService", [ 2 | "$rootScope", 3 | "$compile", 4 | ($rootScope, $compile) => { 5 | 6 | let service = {}, 7 | $body = $('body'), 8 | imgs = { 9 | success: 'img/icon_success.svg', 10 | info: 'img/icon_info.svg', 11 | warning: 'img/icon_warning.svg', 12 | error: 'img/icon_error.svg' 13 | }, 14 | defaultOptions = { 15 | showClose: false, 16 | message: '', 17 | duration: 3000, 18 | type: 'success' 19 | }; 20 | 21 | service.message = (options) => { 22 | options = $.extend({}, defaultOptions, options); 23 | let imgSrc = imgs[options.type] || imgs.success, 24 | html = `
28 |
`; 29 | $body.append($compile(html)($rootScope)); 30 | }; 31 | 32 | service.success = (msg) => { 33 | return service.message({ 34 | type: "success", 35 | message: msg 36 | }); 37 | }; 38 | 39 | service.error = (msg) => { 40 | return service.message({ 41 | type: "error", 42 | message: msg 43 | }); 44 | }; 45 | 46 | return service; 47 | }]); -------------------------------------------------------------------------------- /app/modules/common/requestService.js: -------------------------------------------------------------------------------- 1 | window.APP.factory("RequestService", ["$q", "$http", ($q, $http) => { 2 | var service = {}; 3 | 4 | service.post = (url, data, timeout) => { 5 | var defer = $q.defer(); 6 | $http.post(url, $.param(data), { 7 | timeout: timeout || 5000 8 | }).success(resp => { 9 | if (resp.success) { 10 | defer.resolve(resp); 11 | } else { 12 | defer.reject(resp); 13 | } 14 | }).error((msg, code) => { 15 | defer.reject(code); 16 | }); 17 | return defer.promise; 18 | }; 19 | 20 | service.get = (url, data, timeout) => { 21 | var defer = $q.defer(); 22 | if (data && !angular.equals({}, data)) { 23 | url = url + "?" + $.param(data); 24 | } 25 | $http.get(url, { 26 | timeout: timeout || 5000 27 | }).success(resp => { 28 | if (resp.success) { 29 | defer.resolve(resp); 30 | } else { 31 | defer.reject(resp); 32 | } 33 | }).error((msg, code) => { 34 | defer.reject(code); 35 | }); 36 | return defer.promise; 37 | }; 38 | 39 | return service; 40 | }]); -------------------------------------------------------------------------------- /app/modules/directives/autofocusDirective.js: -------------------------------------------------------------------------------- 1 | window.APP.directive('mAutofocus', [ 2 | () => { 3 | 4 | return { 5 | restrict: 'A', 6 | scope: { 7 | mAutofocus: '=', 8 | mFocusTarget: '@' 9 | }, 10 | link: ($scope, $element, $attrs) => { 11 | var $target = $element; 12 | if ($scope.mFocusTarget) { 13 | $target = $element.find($scope.mFocusTarget); 14 | } 15 | $scope.$watch('mAutofocus', (newValue, oldValue) => { 16 | if (newValue === true) $target.focus(); 17 | }); 18 | } 19 | }; 20 | }]); -------------------------------------------------------------------------------- /app/modules/directives/hoverPopupDirective.js: -------------------------------------------------------------------------------- 1 | window.APP.directive("mHoverPopup", [ 2 | () => { 3 | /* 返回元素是否位于Body左侧 */ 4 | function isAtLeft ($ele) { 5 | let bodyWidth = $("body").width(); 6 | let offset = $ele.offset(); 7 | return (offset.left <= bodyWidth / 2); 8 | }; 9 | /* 对于位于Body左侧的指令 添加left类, 右侧的指令 添加right类 */ 10 | return { 11 | restrict: 'A', 12 | scope: { 13 | mHoverPopup: '@' 14 | }, 15 | link: ($scope, $element, $attrs) => { 16 | $element.prepend(``) 17 | .append(`${$scope.mHoverPopup}`); 18 | if (isAtLeft($element)) { 19 | $element.addClass("left"); 20 | } else { 21 | $element.addClass("right"); 22 | } 23 | let paddingBottom = $element.css("padding-bottom"); 24 | $element.find(".after, .before").css("margin-top", "-" + paddingBottom); 25 | 26 | $scope.$watch("mHoverPopup", (newValue, oldValue) => { 27 | $element.find(".after").text(newValue); 28 | }); 29 | } 30 | }; 31 | }]); -------------------------------------------------------------------------------- /app/modules/directives/loadingButtonDirective.js: -------------------------------------------------------------------------------- 1 | window.APP.directive("mButtonLoading", [ 2 | () => { 3 | 4 | return { 5 | restrict: 'A', 6 | scope: { 7 | mLoading: '=', 8 | mNormalText: '@', 9 | mLoadingText: '@', 10 | mLoadingClass: '@' 11 | }, 12 | link: ($scope, $element, $attrs) => { 13 | $scope.$watch("mLoading", (newValue, oldValue) => { 14 | if (newValue) { 15 | $element.text($scope.mLoadingText); 16 | $element.addClass($scope.mLoadingClass); 17 | } else { 18 | $element.text($scope.mNormalText); 19 | $element.removeClass($scope.mLoadingClass); 20 | } 21 | }) 22 | } 23 | } 24 | }]); -------------------------------------------------------------------------------- /app/modules/directives/replyTrangleDirective.js: -------------------------------------------------------------------------------- 1 | /* this directive is just for a css trangle for a textarea */ 2 | window.APP.directive("mReplyTrangle", [ 3 | () => { 4 | 5 | return { 6 | restrict: 'A', 7 | link: ($scope, $element, $attrs) => { 8 | let $parent = $element.parent(); 9 | $element.hover(() => { 10 | if (!$element.is(':focus')) $parent.addClass('focused'); 11 | }, () => { 12 | if (!$element.is(':focus')) $parent.removeClass('focused'); 13 | }).focus(() => { 14 | $parent.addClass('focused'); 15 | }).blur(() => { 16 | $parent.removeClass('focused'); 17 | }); 18 | } 19 | }; 20 | }]); -------------------------------------------------------------------------------- /app/modules/main/main.html: -------------------------------------------------------------------------------- 1 |
2 | 20 | 21 | there will load some content! 22 | 23 |
-------------------------------------------------------------------------------- /app/modules/main/mainController.js: -------------------------------------------------------------------------------- 1 | window.APP.controller("mainCtrl", [ 2 | "$rootScope", 3 | "$state", 4 | ($rootScope, $state) => { 5 | 6 | $rootScope.logout = () => { 7 | $rootScope.user = undefined; 8 | localStorage.removeItem("user"); 9 | ipc.send("logout"); 10 | $state.go("auth"); 11 | }; 12 | }]); -------------------------------------------------------------------------------- /app/modules/topicEdit/topicEdit.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 9 |
10 |
11 | 12 |
13 |
14 |
15 |
16 | 17 |
18 |
19 | 25 |
26 |
27 |
28 |
29 | 30 |
31 |
32 |
33 |
34 |
35 | 44 |
45 |
46 |
47 |
48 |
-------------------------------------------------------------------------------- /app/modules/topicEdit/topicEditController.js: -------------------------------------------------------------------------------- 1 | window.APP.controller("topicEditCtrl", [ 2 | "$scope", 3 | "$state", 4 | "$stateParams", 5 | "TopicInfoService", 6 | "TopicEditService", 7 | "MessageService", 8 | ($scope, $state, $stateParams, TopicInfoService, TopicEditService, MessageService) => { 9 | 10 | let topicId = $stateParams.topicId; 11 | 12 | $scope.params = { 13 | topic_id: topicId, 14 | content: '', 15 | tab: 'ask', 16 | title: '' 17 | }; 18 | $scope.enable = true; 19 | 20 | $scope.init = () => { 21 | if (!topicId) { 22 | return; 23 | } 24 | TopicInfoService.getInfo({ 25 | id: topicId, 26 | mdrender: false 27 | }).then(resp => { 28 | $scope.params.content = resp.data.content; 29 | $scope.params.title = resp.data.title; 30 | $scope.params.tab = resp.data.tab; 31 | }).catch(error => { 32 | MessageService.error("主题详情加载失败,请稍后重试"); 33 | $scope.enable = false; 34 | }); 35 | }; 36 | $scope.init(); 37 | 38 | $scope.disableSubmit = () => { 39 | let params = $scope.params; 40 | return !($scope.enable && !!params.content && !!params.title && !!params.tab && params.title.length > 10 && params.title.length < 100); 41 | }; 42 | 43 | $scope.submit = () => { 44 | $scope.busy = true; 45 | TopicEditService.save($scope.params).then(resp => { 46 | MessageService.success("话题发布成功"); 47 | $state.go("main.topicList"); 48 | }).catch(error => { 49 | MessageService.error("话题发布失败"); 50 | }).finally(() => { 51 | $scope.busy = false; 52 | }); 53 | }; 54 | }]); -------------------------------------------------------------------------------- /app/modules/topicEdit/topicEditService.js: -------------------------------------------------------------------------------- 1 | window.APP.factory("TopicEditService", [ 2 | "$rootScope", 3 | "RequestService", 4 | ($rootScope, RequestService) => { 5 | 6 | let service = {}, 7 | createUrl = 'https://cnodejs.org/api/v1/topics', 8 | updateUrl = 'https://cnodejs.org/api/v1/topics/update'; 9 | 10 | service.save = (params) => { 11 | params.accesstoken = $rootScope.user.accessToken; 12 | if (params.topic_id) { 13 | return RequestService.post(updateUrl, params); 14 | } else { 15 | return RequestService.post(createUrl, params); 16 | } 17 | }; 18 | 19 | return service; 20 | }]); -------------------------------------------------------------------------------- /app/modules/topicInfo/topicInfo.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 | 8 | 9 |
10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |

18 |
19 | 发布于 20 | 上一次编辑于 Some date 21 | 次浏览 22 |
23 |
24 |
25 | 置顶 26 | 精华 27 | 28 |
29 |
30 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |

回复

49 |
50 |
51 |
52 |

53 |
54 |
55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 回复于 66 | 67 |
68 | 77 | 83 |
84 |
85 |
86 | 87 | 88 | 95 | 96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |

你的回复

104 |
105 |
106 |
107 |
108 | 115 |
116 |
117 |
118 |
119 |
-------------------------------------------------------------------------------- /app/modules/topicInfo/topicInfoController.js: -------------------------------------------------------------------------------- 1 | window.APP.controller("topicInfoCtrl", [ 2 | "$scope", 3 | "$stateParams", 4 | "MessageService", 5 | "TopicInfoService", 6 | ($scope, $stateParams, MessageService, TopicInfoService) => { 7 | 8 | let topicId = $stateParams.topicId; 9 | 10 | function getTopicInfo () { 11 | TopicInfoService.getInfo({ id: topicId }).then(resp => { 12 | $scope.topicInfo = resp.data; 13 | }).catch(error => { 14 | console.log(error); 15 | }); 16 | } 17 | 18 | getTopicInfo(); 19 | 20 | $scope.toggleCollect = () => { 21 | $scope.busy = true; 22 | let promise; 23 | if ($scope.topicInfo.is_collect) { 24 | promise = TopicInfoService.unCollect($scope.topicInfo.id); 25 | } else { 26 | promise = TopicInfoService.collect($scope.topicInfo.id); 27 | } 28 | 29 | promise.then(resp => { 30 | let msg = $scope.topicInfo.is_collect ? "取消收藏成功" : "收藏成功"; 31 | MessageService.success(msg); 32 | $scope.topicInfo.is_collect = !$scope.topicInfo.is_collect; 33 | }).catch(error => { 34 | let msg = ($scope.topicInfo.is_collect ? "取消收藏失败," : "收藏失败,") + "请稍后重试"; 35 | MessageService.error(msg); 36 | }).finally(() => { 37 | $scope.busy = false; 38 | }); 39 | }; 40 | 41 | $scope.replyParams = { 42 | topic_id: topicId, 43 | content: '', 44 | reply_id: undefined 45 | }; 46 | 47 | $scope.reply = () => { 48 | $scope.replyBusy = true; 49 | TopicInfoService.reply($scope.replyParams.topic_id, $scope.replyParams.content, $scope.replyParams.reply_id) 50 | .then(resp => { 51 | $scope.replyParams.content = ""; 52 | $scope.replyParams.reply_id = undefined; 53 | // FIXME: 这里重新获取主题详情,采用更好的方法 54 | getTopicInfo(); 55 | MessageService.success("回复成功"); 56 | }).catch(error => { 57 | MessageService.error("回复失败,请稍后重试"); 58 | }).finally(() => { 59 | $scope.replyBusy = false; 60 | }); 61 | }; 62 | 63 | $scope.toggleReplyUp = (reply) => { 64 | let message; 65 | TopicInfoService.toggleReplyUp(reply.id).then(resp => { 66 | if (reply.is_uped) { 67 | message = "取消点赞成功"; 68 | _.remove(reply.ups, (n) => n == $scope.user.id); 69 | } else { 70 | message = "点赞成功"; 71 | reply.ups.push($scope.user.id); 72 | } 73 | reply.is_uped = !reply.is_uped; 74 | MessageService.success(message); 75 | }).catch(error => { 76 | if (reply.is_uped) { 77 | message = "取消点赞失败"; 78 | } else { 79 | message = "点赞失败"; 80 | } 81 | MessageService.error(message); 82 | }); 83 | }; 84 | 85 | $scope.replyTarget = {}; 86 | /* 切换回复评论表单显示 */ 87 | $scope.toggleReplyForm = (reply) => { 88 | if ($scope.replyTarget.reply_id == reply.id) { 89 | $scope.replyTarget = {}; 90 | } else { 91 | $scope.replyTarget.topic_id = topicId; 92 | $scope.replyTarget.reply_id = reply.id; 93 | $scope.replyTarget.authorname = reply.author.loginname; 94 | $scope.replyTarget.content = '@' + reply.author.loginname + ' '; 95 | } 96 | }; 97 | 98 | /* 回复评论 */ 99 | $scope.targetReply = () => { 100 | $scope.replyBusy = true; 101 | TopicInfoService.reply($scope.replyTarget.topic_id, $scope.replyTarget.content, $scope.replyTarget.reply_id) 102 | .then(resp => { 103 | $scope.replyTarget = {}; 104 | // FIXME: 这里重新获取主题详情,采用更好的方法 105 | getTopicInfo(); 106 | MessageService.success("回复成功"); 107 | }).catch(error => { 108 | MessageService.error("回复失败,请稍后重试"); 109 | }).finally(() => { 110 | $scope.replyBusy = false; 111 | }); 112 | }; 113 | 114 | /* 使用markdown编辑器 */ 115 | $scope.useMarkdown = () => { 116 | $scope.replyParams.content = '@' + $scope.replyTarget.authorname + ' '; 117 | $scope.replyParams.reply_id = $scope.replyTarget.reply_id; 118 | $scope.replyTarget = {}; 119 | $scope.isUseMarkdown = true; 120 | }; 121 | 122 | $scope.$watch("replyParams.content", (newValue, oldValue) => { 123 | if (newValue === '') { 124 | $scope.replyParams.reply_id = undefined; 125 | } 126 | }); 127 | }]); -------------------------------------------------------------------------------- /app/modules/topicInfo/topicInfoService.js: -------------------------------------------------------------------------------- 1 | window.APP.factory('TopicInfoService', [ 2 | "$rootScope", 3 | 'RequestService', 4 | ($rootScope, RequestService) => { 5 | 6 | let service = {}, 7 | infoUrl = 'https://cnodejs.org/api/v1/topic/', 8 | collectUrl = 'https://cnodejs.org/api/v1/topic_collect/collect', 9 | unCollectUrl = 'https://cnodejs.org/api/v1/topic_collect/de_collect', 10 | replyUpUrl = 'https://cnodejs.org/api/v1/reply/'; 11 | 12 | service.getInfo = params => { 13 | let url = infoUrl + params.id; 14 | return RequestService.get(url, { 15 | accesstoken: $rootScope.user.accessToken, 16 | mdrender: params.mdrender || true 17 | }); 18 | }; 19 | 20 | service.collect = topic_id => { 21 | return RequestService.post(collectUrl, { 22 | accesstoken: $rootScope.user.accessToken, 23 | topic_id: topic_id 24 | }); 25 | }; 26 | 27 | service.unCollect = topic_id => { 28 | return RequestService.post(unCollectUrl, { 29 | accesstoken: $rootScope.user.accessToken, 30 | topic_id: topic_id 31 | }); 32 | }; 33 | 34 | service.reply = (topic_id, content, reply_id) => { 35 | let url = infoUrl + topic_id + '/replies'; 36 | return RequestService.post(url, { 37 | accesstoken: $rootScope.user.accessToken, 38 | content: content, 39 | reply_id: reply_id 40 | }); 41 | }; 42 | 43 | service.toggleReplyUp = (reply_id) => { 44 | let url = replyUpUrl + reply_id + '/ups'; 45 | return RequestService.post(url, { 46 | accesstoken: $rootScope.user.accessToken 47 | }); 48 | }; 49 | 50 | return service; 51 | }]); -------------------------------------------------------------------------------- /app/modules/topicList/topicList.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 全部 5 | 精华 6 | 分享 7 | 问答 8 | 招聘 9 | 测试 10 | 收藏夹 11 |
12 |
13 |
14 |
15 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |

32 |
33 | 34 | 35 | 36 | Replies 37 | 38 | 39 | 40 | 41 | Views 42 | 43 |
44 |
45 |
46 | 置顶 47 | 精华 48 | 49 |
50 | 51 |
52 | 53 |
54 |
55 |
56 |
57 |
58 |
-------------------------------------------------------------------------------- /app/modules/topicList/topicListController.js: -------------------------------------------------------------------------------- 1 | window.APP.controller("topicListCtrl", [ 2 | "$scope", 3 | "TopicListService", 4 | ($scope, TopicListService) => { 5 | 6 | function TopicList () { 7 | this.tab = ""; 8 | this.items = []; 9 | this.busy = false; 10 | this.page = 0; 11 | } 12 | 13 | TopicList.prototype.changeTab = function (tab) { 14 | if (this.tab == tab) return; 15 | this.tab = tab; 16 | this.page = 0; 17 | this.busy = false; 18 | this.items = []; 19 | if (tab != "collect") { 20 | this.nextPage(); 21 | } else { 22 | this.getCollect(); 23 | } 24 | }; 25 | 26 | TopicList.prototype.nextPage = function () { 27 | let self = this; 28 | if (self.busy) return; 29 | if (self.tab == "collect") return; 30 | self.busy = true; 31 | 32 | TopicListService.goPage(self.page + 1, self.tab).then(function (data) { 33 | self.items = self.items.concat(data); 34 | self.page = self.page + 1; 35 | self.busy = false; 36 | }).catch(function (error) { 37 | // TODO 处理异常 38 | self.busy = false; 39 | }); 40 | }; 41 | 42 | TopicList.prototype.getCollect = function () { 43 | let self = this; 44 | if (self.busy) return; 45 | self.busy = true; 46 | 47 | TopicListService.getCollect().then(function (resp) { 48 | self.items = self.items.concat(resp.data); 49 | self.busy = false; 50 | }).catch(function (error) { 51 | // TODO 处理异常 52 | self.busy = false; 53 | }); 54 | }; 55 | 56 | $scope.topicList = new TopicList(); 57 | $scope.topicList.changeTab("all"); 58 | }]); -------------------------------------------------------------------------------- /app/modules/topicList/topicListService.js: -------------------------------------------------------------------------------- 1 | window.APP.factory("TopicListService", [ 2 | "$rootScope", 3 | "RequestService", 4 | ($rootScope, RequestService) => { 5 | var service = {}; 6 | 7 | service.currentPage = 0; 8 | 9 | service.goPage = (pageNum, tab) => { 10 | pageNum = pageNum || 0; 11 | tab = tab || "all"; 12 | 13 | return RequestService.get("https://cnodejs.org/api/v1/topics", { 14 | limit: 40, 15 | page: pageNum, 16 | tab: tab 17 | }).then((data) => { 18 | service.currentPage = pageNum; 19 | return data.data; 20 | }); 21 | }; 22 | 23 | service.nextPage = tab => { 24 | return service.goPage(service.currentPage + 1, tab); 25 | }; 26 | 27 | service.getCollect = () => { 28 | return RequestService.get("https://cnodejs.org/api/v1/topic_collect/" + $rootScope.user.loginname); 29 | }; 30 | 31 | return service; 32 | }]); -------------------------------------------------------------------------------- /app/modules/userCard/userCard.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 7 |
8 |
9 |

10 |

11 | 12 | @ 13 |

14 |
15 |
16 |
    17 |
  • 18 |

    19 |

    最近创建

    20 |
  • 21 |
  • 22 |

    5

    23 |

    最近回复

    24 |
  • 25 |
  • 26 |

    27 |

    积分

    28 |
  • 29 |
30 | 33 |
34 |
35 | -------------------------------------------------------------------------------- /app/modules/userCard/userCardDirective.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 用户信息卡片实现: 3 | * 外部传入用户名 4 | * 外部容器hover时进行显示 5 | * 加载过程中显示loading 6 | * 支持跳转到用户界面 7 | * 根据用户传入的用户名获取用户详细信息 8 | */ 9 | 10 | window.APP.directive('mUserCard', [ 11 | '$rootScope', 12 | 'UserInfoService', 13 | ($rootScope, UserInfoService) => { 14 | return { 15 | restrict: 'EA', 16 | replace: true, 17 | scope: { 18 | mUserName: '=' 19 | }, 20 | transclude: { 21 | content: '?content' 22 | }, 23 | templateUrl: 'modules/userCard/userCard.html', 24 | link: ($scope, $element, $attrs) => { 25 | $element.hover(() => { 26 | if ($scope.userInfo) return; 27 | let isSelf = $scope.mUserName === $rootScope.user.loginname; 28 | UserInfoService.getUserInfo($scope.mUserName, isSelf).then(userInfo => { 29 | $scope.userInfo = userInfo; 30 | $scope.userInfo.isSelf = isSelf; 31 | }).catch(error => { 32 | console.log(error); 33 | }); 34 | }, angular.noop); 35 | } 36 | } 37 | }]); -------------------------------------------------------------------------------- /app/modules/userInfo/userInfo.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 18 |
19 |
    20 |
  • 21 |

    22 |

    最近创建

    23 |
  • 24 |
  • 25 |

    26 |

    最近回复

    27 |
  • 28 |
  • 30 |

    31 |

    未读信息

    32 |
  • 33 |
  • 35 |

    36 |

    已读信息

    37 |
  • 38 |
  • 39 |

    40 |

    积分

    41 |
  • 42 |
43 |
44 |
45 |
46 |

47 | 48 |

49 |
50 | 最后回复于 51 |
52 |
53 |
54 |
55 |
没有更多了
56 |
57 |
58 |
59 |
60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
69 |
70 |

71 | 72 |

73 |
74 | 最后回复于 75 |
76 |
77 |
78 |
79 |
80 |
没有更多了
81 |
82 |
83 |
84 |
85 | 102 |

103 |
104 | 回复于 105 |
106 |
107 |
108 |
109 |
没有更多了
110 |
111 |
112 |
113 |
114 | 131 |

132 |
133 | 回复于 134 |
135 |
136 |
137 |
138 |
没有更多了
139 |
140 |
141 |
142 |
143 |
144 |
145 |
-------------------------------------------------------------------------------- /app/modules/userInfo/userInfoController.js: -------------------------------------------------------------------------------- 1 | window.APP.controller("userInfoCtrl", [ 2 | "$scope", 3 | "$stateParams", 4 | "$rootScope", 5 | "UserInfoService", 6 | ($scope, $stateParams, $rootScope, UserInfoService) => { 7 | 8 | let loginname = $stateParams.loginname, 9 | isSelf = $stateParams.loginname === $rootScope.user.loginname; 10 | 11 | function getUserInfo () { 12 | UserInfoService.getUserInfo(loginname, isSelf).then(userInfo => { 13 | $scope.userInfo = userInfo; 14 | $scope.userInfo.isSelf = isSelf; 15 | }).catch(error => { 16 | console.log(error); 17 | }); 18 | } 19 | 20 | $scope.selectedTab = "CREATE"; 21 | $scope.selectTab = tab => { 22 | $scope.selectedTab = tab; 23 | }; 24 | 25 | getUserInfo(); 26 | }]); -------------------------------------------------------------------------------- /app/modules/userInfo/userInfoService.js: -------------------------------------------------------------------------------- 1 | window.APP.factory("UserInfoService", [ 2 | "$q", 3 | "$rootScope", 4 | "RequestService", 5 | ($q, $rootScope, RequestService) => { 6 | 7 | let service = {}, 8 | infoUrl = "https://cnodejs.org/api/v1/user/", 9 | messageUrl = "https://cnodejs.org/api/v1/messages"; 10 | 11 | service.getUserInfo = (loginname, isSelf) => { 12 | let defer = $q.defer(), 13 | promises = [ RequestService.get(infoUrl + loginname) ]; 14 | 15 | if (isSelf) { 16 | promises.push(RequestService.get(messageUrl, { 17 | accesstoken: $rootScope.user.accessToken, 18 | mdrender: false 19 | })); 20 | } 21 | $q.all(promises).then(([infoResp, messageResp]) => { 22 | let userInfo = infoResp.data; 23 | if (isSelf) { 24 | userInfo.unReadMessages = messageResp.data.hasnot_read_messages; 25 | userInfo.hasReadMessages = messageResp.data.has_read_messages; 26 | } 27 | defer.resolve(userInfo); 28 | }); 29 | return defer.promise; 30 | }; 31 | 32 | return service; 33 | }]); -------------------------------------------------------------------------------- /app/style/css/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/app/style/css/.gitkeep -------------------------------------------------------------------------------- /app/style/sass/base.scss: -------------------------------------------------------------------------------- 1 | // 颜色变量 2 | // 主色 3 | $light-blue: #58B7FF; 4 | $blue: #20A0FF; 5 | $dark-blue: #1D8CE0; 6 | // 辅助色 7 | $success: #13CE66; 8 | $warning: #F7BA2A; 9 | $danger: #FF4949; 10 | // 中性色 11 | $black: #1F2D3D; 12 | $light-black: #324057; 13 | $extra-light-black: #475669; 14 | 15 | $silver: #8492A6; 16 | $light-silver: #99A9BF; 17 | $extra-light-silver: #C0CCDA; 18 | 19 | $gray: #D3DCE6; 20 | $light-gray: #E5E9F2; 21 | $extra-light-gray: #EFF2F7; 22 | 23 | $dark-white: #F9FAFC; 24 | $white: #FFFFFF; 25 | 26 | $rem: 10px; 27 | 28 | // reset 29 | * { 30 | margin: 0; 31 | padding: 0; 32 | } 33 | 34 | ul { 35 | list-style: none; 36 | } 37 | 38 | html { 39 | font-size: 12px; 40 | } 41 | 42 | body { 43 | font-size: 1.6 * $rem; 44 | font-family: Helvetica, Tahoma, Arial, STXihei, “华文细黑”, “Microsoft YaHei”, “微软雅黑”, sans-serif; 45 | color: #1f2d3d; 46 | } 47 | 48 | a { 49 | cursor: pointer; 50 | } 51 | 52 | ::-webkit-scrollbar { 53 | width: 5px; 54 | height: 5px; 55 | } 56 | 57 | ::-webkit-scrollbar-thumb { 58 | background: #ccc; 59 | } 60 | 61 | ::-webkit-scrollbar-corner { 62 | background: transparent; 63 | } 64 | 65 | ::-webkit-scrollbar-track { 66 | background: transparent; 67 | } 68 | 69 | // 文字大小 70 | .h1 { 71 | font-size: 2 * $rem; 72 | } 73 | 74 | .h2 { 75 | font-size: 1.8 * $rem; 76 | } 77 | 78 | .h3 { 79 | font-size: 1.6 * $rem; 80 | } 81 | 82 | .text-regular { 83 | font-size: 1.4 * $rem; 84 | } 85 | 86 | .text-small { 87 | font-size: 1.3 * $rem; 88 | } 89 | 90 | .text-smaller { 91 | font-size: 1.2 * $rem; 92 | } 93 | 94 | // TODO 文字组合 95 | 96 | 97 | // 按钮 98 | .btn { 99 | display: inline-block; 100 | line-height: 1; 101 | white-space: nowrap; 102 | cursor: pointer; 103 | background: $white; 104 | border: 1px solid #bfcbd9; 105 | color: $black; 106 | -webkit-appearance: none; 107 | text-align: center; 108 | box-sizing: border-box; 109 | outline: none; 110 | margin: 0; 111 | padding: 1 * $rem 1.5 * $rem; 112 | font-size: 1.4 * $rem; 113 | border-radius: .2 * $rem; 114 | 115 | box-shadow: .2 * $rem .2 * $rem .1 * $rem #dde; 116 | 117 | &.disabled, 118 | &[disabled], 119 | &:hover.disabled, 120 | &:hover[disabled] { 121 | color: #bfcbd9 !important; 122 | cursor: not-allowed !important; 123 | background-image: none !important; 124 | background-color: #eef1f6; 125 | border-color: #d1dbe5 !important; 126 | box-shadow: none !important; 127 | } 128 | 129 | .icon + span { 130 | margin-left: .5 * $rem; 131 | } 132 | } 133 | 134 | .btn + .btn { 135 | margin-left: 1 * $rem; 136 | } 137 | 138 | .btn-large { 139 | padding: 1.1 * $rem 1.9 * $rem; 140 | font-size: 1.6 * $rem; 141 | } 142 | 143 | .btn-small { 144 | padding: .7 * $rem .9 * $rem; 145 | font-size: 1.2 * $rem; 146 | } 147 | 148 | .btn-mini { 149 | padding: .4 * $rem; 150 | font-size: 1.2 * $rem; 151 | } 152 | 153 | .btn-default { 154 | &.disabled, 155 | &[disabled], 156 | &:hover.disabled, 157 | &:hover[disabled] { 158 | background-color: $white; 159 | border-color: #d1dbe5; 160 | color: #bfcbd9; 161 | } 162 | 163 | &:hover { 164 | color: $blue; 165 | border-color: $blue; 166 | } 167 | 168 | &:active { 169 | color: #1d90e6; 170 | border-color: #1d90e6; 171 | } 172 | } 173 | 174 | .btn-primary { 175 | color: $white; 176 | background: $blue; 177 | border-color: $blue; 178 | 179 | &:hover { 180 | background: #4db3ff; 181 | border-color: #4db3ff; 182 | } 183 | 184 | &:active { 185 | background: #1d90e6; 186 | border-color: #1d90e6; 187 | color: $white; 188 | } 189 | 190 | &.btn-loading { 191 | background: #4db3ff; 192 | border-color: #4db3ff; 193 | pointer-events: none; 194 | } 195 | } 196 | 197 | .btn-text { 198 | border: none; 199 | color: $blue; 200 | background: transparent; 201 | padding-left: 0; 202 | padding-right: 0; 203 | 204 | box-shadow: none; 205 | 206 | &.disabled, 207 | &[disabled], 208 | &:hover.disabled, 209 | &:hover[disabled] { 210 | background-color: transparent; 211 | } 212 | 213 | &:hover { 214 | color: #4db3ff; 215 | } 216 | 217 | &:active { 218 | color: #1d90e6; 219 | } 220 | 221 | &.normal, 222 | &:hover.normal { 223 | @extend .btn.disabled; 224 | cursor: pointer !important; 225 | background-color: transparent !important; 226 | } 227 | } 228 | 229 | .btn-success { 230 | color: $white; 231 | background-color: $success; 232 | border-color: $success; 233 | 234 | &:hover { 235 | background: #42d885; 236 | border-color: #42d885; 237 | } 238 | 239 | &:active { 240 | background: #11b95c; 241 | border-color: #11b95c; 242 | } 243 | 244 | &.btn-loading { 245 | background: #42d885; 246 | border-color: #42d885; 247 | pointer-events: none; 248 | } 249 | } 250 | 251 | .btn-warning { 252 | color: $white; 253 | background-color: $warning; 254 | border-color: $warning; 255 | 256 | &:hover { 257 | background: #f9c855; 258 | border-color: #f9c855; 259 | } 260 | 261 | &:active { 262 | background: #dea726; 263 | border-color: #dea726; 264 | } 265 | } 266 | 267 | .btn-danger { 268 | color: $white; 269 | background-color: $danger; 270 | border-color: $danger; 271 | 272 | &:hover { 273 | background: #ff6d6d; 274 | border-color: #ff6d6d; 275 | } 276 | 277 | &:active { 278 | background: #e64242; 279 | border-color: #e64242; 280 | } 281 | } 282 | 283 | .btn-info { 284 | color: $white; 285 | background-color: #50bfff; 286 | border-color: #50bfff; 287 | 288 | &:hover { 289 | background: #73ccff; 290 | border-color: #73ccff; 291 | } 292 | 293 | &:active { 294 | background: #48ace6; 295 | border-color: #48ace6; 296 | } 297 | } 298 | 299 | // 输入框 300 | input[type=text], 301 | input[type=password] { 302 | outline: none; 303 | -webkit-appearance: none; 304 | background-color: $white; 305 | background-image: none; 306 | border: 1px solid #bfcbd9; 307 | border-radius: .2 & $rem; 308 | box-sizing: border-box; 309 | color: #1f2d3d; 310 | display: block; 311 | font-size: inherit; 312 | 313 | height: 3.6 * $rem; 314 | line-height: 1; 315 | padding: .3 * $rem 1 * $rem; 316 | 317 | transition: border-color .2s cubic-bezier(.645,.045,.355,1); 318 | 319 | &:hover { 320 | border-color: #8391a5; 321 | } 322 | 323 | &:focus { 324 | border-color: #20a0ff; 325 | } 326 | } 327 | 328 | select { 329 | border: 1px solid #bfcbd9; 330 | border-radius: .2 & $rem; 331 | height: 3.6 * $rem; 332 | line-height: 1; 333 | padding: .3 * $rem 1 * $rem; 334 | font-size: inherit; 335 | } 336 | 337 | .no-shadow { 338 | box-shadow: none; 339 | } 340 | 341 | [m-hover-popup] { 342 | position: relative; 343 | 344 | & .after, 345 | & .before { 346 | display: none; 347 | z-index: 100000; 348 | } 349 | 350 | &:hover .after, 351 | &:hover .before { 352 | display: block; 353 | position: absolute; 354 | top: 100%; 355 | } 356 | 357 | &:hover .after { 358 | transform: translateY(4px); 359 | padding: 4px 8px; 360 | background: rgba(0, 0, 0, .7); 361 | border-radius: 2px; 362 | line-height: 12px; 363 | font-size: 12px; 364 | color: #fff; 365 | } 366 | 367 | &:hover .before { 368 | width: 0; 369 | height: 0; 370 | border-left: 4px solid transparent; 371 | border-right: 4px solid transparent; 372 | border-bottom: 4px solid rgba(0, 0, 0, .7); 373 | } 374 | 375 | &.left:hover { 376 | & .after { 377 | left: 0; 378 | } 379 | 380 | & .before { 381 | left: 5px; 382 | } 383 | } 384 | 385 | &.right:hover { 386 | & .after { 387 | right: 0; 388 | } 389 | 390 | & .before { 391 | right: 5px; 392 | } 393 | } 394 | } -------------------------------------------------------------------------------- /app/style/sass/editor.scss: -------------------------------------------------------------------------------- 1 | .mditor { 2 | height: 280px !important; 3 | 4 | & .head { 5 | background: #fff; 6 | } 7 | } -------------------------------------------------------------------------------- /app/style/sass/login.scss: -------------------------------------------------------------------------------- 1 | .login-container { 2 | height: 100%; 3 | width: 100%; 4 | position: relative; 5 | } 6 | 7 | .login-logo { 8 | text-align: center; 9 | } 10 | 11 | .login-logo img { 12 | margin: 50px 0 30px 0; 13 | height: 160px; 14 | width: 160px; 15 | border-radius: 50%; 16 | } 17 | 18 | .login-logo p { 19 | margin-bottom: 60px; 20 | font-size: 20px; 21 | color: #838383; 22 | } 23 | 24 | .login-form { 25 | margin: auto; 26 | width: 90%; 27 | } 28 | 29 | .login-form input[type=password] { 30 | width: 100%; 31 | margin-bottom: 20px; 32 | } 33 | 34 | .login-form button { 35 | width: 100%; 36 | 37 | font-size: 20px; 38 | padding: 13px; 39 | margin-bottom: 10px; 40 | } 41 | 42 | .login-desc { 43 | position: absolute; 44 | bottom: 20px; 45 | width: 100%; 46 | 47 | text-align: center; 48 | font-size: 14px; 49 | color: #aab9c7; 50 | line-height: 18px; 51 | } 52 | 53 | .login-form-input { 54 | position: relative; 55 | height: 40px; 56 | 57 | margin-bottom: 20px; 58 | } 59 | 60 | .login-form-input label { 61 | position: absolute; 62 | left: 0; 63 | top: 0; 64 | 65 | height: 40px; 66 | line-height: 40px; 67 | width: 20px; 68 | 69 | color: #aab9c7; 70 | font-size: 20px; 71 | } 72 | 73 | .login-form-input input { 74 | border: none; 75 | border-bottom: 1px solid #ccc; 76 | box-sizing: border-box; 77 | padding-left: 30px; 78 | } 79 | 80 | .login-form-help { 81 | font-size: 14px; 82 | } 83 | 84 | .login-form-help label { 85 | color: #838383; 86 | cursor: pointer; 87 | user-select: none; 88 | } 89 | 90 | .login-form-help label input[type=checkbox] { 91 | cursor: pointer; 92 | } 93 | 94 | .login-form-help a { 95 | color: #4f6aec; 96 | text-decoration: none; 97 | float: right; 98 | } 99 | 100 | input:-webkit-autofill { 101 | -webkit-box-shadow: 0 0 0px 1000px white inset; 102 | } -------------------------------------------------------------------------------- /app/style/sass/main.scss: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | width: 100%; 4 | } 5 | 6 | body { 7 | margin: 0 auto; 8 | display: flex; 9 | 10 | .sidebar { 11 | width: 50px; 12 | flex-shrink: 0; 13 | background: #7a8fdf; 14 | box-shadow: 5px 0 5px #bfc8ec; 15 | position: relative; 16 | 17 | .logo { 18 | height: 50px; 19 | background: #8194e0; 20 | 21 | img { 22 | height: 40px; 23 | width: 40px; 24 | margin-left: 5px; 25 | margin-top: 5px; 26 | 27 | border-radius: 50%; 28 | cursor: pointer; 29 | } 30 | } 31 | 32 | .menu-list { 33 | .menu-item { 34 | height: 40px; 35 | line-height: 40px; 36 | width: 100%; 37 | 38 | color: #fff; 39 | font-size: 20px; 40 | text-align: center; 41 | color: #b6c1ed; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | .setting { 47 | position: absolute; 48 | bottom: 0; 49 | left: 0; 50 | height: 40px; 51 | line-height: 40px; 52 | width: 100%; 53 | 54 | color: #fff; 55 | font-size: 20px; 56 | text-align: center; 57 | cursor: pointer; 58 | } 59 | } 60 | 61 | .container { 62 | flex-grow: 1; 63 | display: flex; 64 | background: #dde6ed; 65 | } 66 | 67 | .main { 68 | width: 100%; 69 | display: flex; 70 | flex-direction: column; 71 | 72 | > .top-navbar { 73 | flex-shrink: 0; 74 | height: 40px; 75 | background: #fff; 76 | box-shadow: 0 3px 3px #bfc8ec; 77 | position: relative; 78 | z-index: 1000; 79 | 80 | .tabs { 81 | position: absolute; 82 | top: 0; 83 | left: 0; 84 | 85 | height: 100%; 86 | line-height: 40px; 87 | margin-left: 15px; 88 | font-size: 14px; 89 | color: #909090; 90 | cursor: pointer; 91 | user-select: none; 92 | 93 | .tab-item { 94 | box-sizing: border-box; 95 | padding-right: 10px; 96 | border-right: 1px solid #eaeaea; 97 | 98 | &:not(:first-child) { 99 | margin-left: 8px; 100 | } 101 | 102 | &:last-child { 103 | border-right: none; 104 | } 105 | 106 | &.selected { 107 | color: #007fff; 108 | } 109 | 110 | &:hover { 111 | color: #007fff; 112 | } 113 | } 114 | } 115 | 116 | .options { 117 | position: absolute; 118 | right: 0; 119 | top: 0; 120 | 121 | height: 100%; 122 | line-height: 40px; 123 | margin-right: 15px; 124 | font-size: 24px; 125 | 126 | .option-item { 127 | color: #bddae0; 128 | display: inline-block; 129 | margin-right: 10px; 130 | cursor: pointer; 131 | } 132 | } 133 | } 134 | 135 | > .content { 136 | flex-grow: 1; 137 | overflow-y: auto; 138 | } 139 | } 140 | } 141 | 142 | .panel { 143 | width: 96%; 144 | margin: 10px auto; 145 | } 146 | 147 | .list { 148 | .item { 149 | background: #fff; 150 | margin-bottom: 5px; 151 | width: 100%; 152 | box-shadow: 1px 1px 1px #ccc; 153 | 154 | display: flex; 155 | 156 | &:hover { 157 | box-shadow: 2px 2px 2px #ccc; 158 | } 159 | 160 | > .item-left-part { 161 | width: 58px; 162 | flex-shrink: 0; 163 | box-sizing: border-box; 164 | padding-left: 15px; 165 | padding-top: 10px; 166 | 167 | img { 168 | height: 48px; 169 | width: 48px; 170 | border-radius: 50%; 171 | cursor: pointer; 172 | } 173 | } 174 | 175 | > .item-right-part { 176 | flex-grow: 1; 177 | position: relative; 178 | z-index: 999; 179 | box-sizing: border-box; 180 | padding-left: 15px; 181 | padding-top: 10px; 182 | padding-right: 15px; 183 | } 184 | } 185 | } 186 | 187 | .item-right-part { 188 | > .title { 189 | margin-bottom: 10px; 190 | font-size: 16px; 191 | font-weight: 600; 192 | color: #615b5b; 193 | cursor: pointer; 194 | 195 | a { 196 | text-decoration: none; 197 | color: inherit; 198 | font-size: inherit; 199 | font-weight: inherit; 200 | } 201 | } 202 | 203 | > .status { 204 | margin-bottom: 10px; 205 | font-size: 12px; 206 | color: #01aaea; 207 | font-weight: 300; 208 | 209 | .status-item { 210 | margin-right: 20px; 211 | cursor: pointer; 212 | } 213 | 214 | em { 215 | font-style: normal; 216 | } 217 | } 218 | 219 | .topic-list-active { 220 | margin-bottom: 10px; 221 | .date { 222 | position: absolute; 223 | right: 15px; 224 | bottom: 10px; 225 | font-size: 14px; 226 | color: #bec8d3; 227 | font-weight: 300; 228 | } 229 | } 230 | } 231 | 232 | .tags { 233 | .tag-item { 234 | font-size: 12px; 235 | font-weight: 500; 236 | color: #c8b383; 237 | display: inline-block; 238 | background: #fff4de; 239 | padding: 2px 4px; 240 | border: 1px solid #ffe9b2; 241 | border-radius: 2px; 242 | cursor: pointer; 243 | margin-right: 3px; 244 | 245 | &.special { 246 | background: #80bd01; 247 | color: #fff; 248 | border-color: #afd06b; 249 | } 250 | } 251 | } -------------------------------------------------------------------------------- /app/style/sass/markdown.scss: -------------------------------------------------------------------------------- 1 | .markdown-text { 2 | * { 3 | word-break: break-all; 4 | } 5 | 6 | h1, h2, h3, h4, h5, h6 { 7 | margin: 10px 0; 8 | font-family: inherit; 9 | font-weight: 700; 10 | line-height: 20px; 11 | color: inherit; 12 | text-rendering: optimizelegibility; 13 | } 14 | 15 | h1, h2, h3 { 16 | line-height: 40px; 17 | } 18 | 19 | table { 20 | padding: 0; 21 | border-collapse: collapse; 22 | border-spacing: 0; 23 | font: inherit; 24 | max-width: 100%; 25 | background-color: transparent; 26 | 27 | tr { 28 | border-top: 1px solid #ccc; 29 | background-color: #fff; 30 | margin: 0; 31 | padding: 0; 32 | 33 | th, td { 34 | border: 1px solid #ccc; 35 | text-align: left; 36 | margin: 0; 37 | padding: 6px 13px; 38 | } 39 | 40 | &:nth-child(2n) { 41 | background-color: #f8f8f8; 42 | } 43 | } 44 | } 45 | 46 | img { 47 | width: auto\9; 48 | height: auto; 49 | max-width: 100%; 50 | vertical-align: middle; 51 | border: 0; 52 | -ms-interpolation-mode: bicubic; 53 | cursor: pointer; 54 | } 55 | 56 | a { 57 | text-decoration: none; 58 | color: #08c; 59 | 60 | &:hover { 61 | text-decoration: underline; 62 | color: #08c; 63 | } 64 | } 65 | 66 | ul, li { 67 | list-style: disc; 68 | font-size: 14px; 69 | line-height: 2em; 70 | } 71 | 72 | ol, ul { 73 | padding: 0; 74 | margin: 0 0 10px 25px; 75 | } 76 | 77 | p { 78 | white-space: pre-wrap; 79 | word-wrap: break-word; 80 | line-height: 2em; 81 | margin: 1em 0; 82 | overflow: auto; 83 | } 84 | 85 | small, address, blockquote { 86 | line-height: 20px; 87 | display: block; 88 | } 89 | 90 | address { 91 | margin-bottom: 20px; 92 | } 93 | 94 | blockquote { 95 | padding: 0 0 0 15px; 96 | margin: 0 0 20px; 97 | border-left: 5px solid #eee; 98 | } 99 | 100 | pre { 101 | display: block; 102 | line-height: 22px; 103 | padding: 9.5px; 104 | margin: 0 0 10px; 105 | font-family: Monaco,Menlo,Consolas,"Courier New",monospace; 106 | font-size: 13px; 107 | color: #333; 108 | border-radius: 4px; 109 | word-break: break-all; 110 | word-wrap: break-word; 111 | white-space: pre; 112 | background: #fee9cc; 113 | border: 1px dashed #ccc; 114 | 115 | &.prettyprint { 116 | margin-bottom: 20px; 117 | border: 1px solid #888; 118 | padding: 0 15px; 119 | background: #f7f7f7; 120 | } 121 | 122 | code { 123 | padding: 0; 124 | border: 0; 125 | color: inherit; 126 | white-space: pre-wrap; 127 | background-color: transparent; 128 | } 129 | } 130 | 131 | code { 132 | font-family: Monaco,Menlo,Consolas,"Courier New",monospace; 133 | font-size: 12px; 134 | border-radius: 3px; 135 | color: #d14; 136 | background: #f7f7f9; 137 | padding: 0; 138 | border: none; 139 | } 140 | 141 | dl, legend { 142 | margin-bottom: 20px; 143 | } 144 | 145 | fieldset, legend { 146 | padding: 0; 147 | border: 0; 148 | } 149 | } -------------------------------------------------------------------------------- /app/style/sass/message.scss: -------------------------------------------------------------------------------- 1 | .message { 2 | background: #fff; 3 | min-width: 300px; 4 | padding: 10px 12px; 5 | box-sizing: border-box; 6 | border-radius: 1px; 7 | position: fixed; 8 | left: 50%; 9 | top: 0; 10 | opacity: 1; 11 | transform: translate(-50%, 60px); 12 | overflow: hidden; 13 | box-shadow: 2px 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); 14 | } 15 | 16 | .message.ng-enter { 17 | transition: all .4s; 18 | transform: translate(-50%, 0); 19 | opacity: 0; 20 | } 21 | 22 | .message.ng-enter-active { 23 | transform: translate(-50%, 60px); 24 | opacity: 1; 25 | } 26 | 27 | .message.ng-leave { 28 | transition: all .4s; 29 | transform: translate(-50%, 60px); 30 | opacity: 1; 31 | } 32 | 33 | .message.ng-leave-active { 34 | transition: all .4s; 35 | transform: translate(-50%, 0); 36 | opacity: 0; 37 | } 38 | 39 | .message-img { 40 | width: 40px; 41 | height: 40px; 42 | position: absolute; 43 | left: 0; 44 | top: 0; 45 | } 46 | 47 | .message-group { 48 | margin-left: 38px; 49 | position: relative; 50 | height: 20px; 51 | } 52 | 53 | .message-group p { 54 | font-size: 14px; 55 | line-height: 20px; 56 | margin: 0 34px 0 0; 57 | white-space: nowrap; 58 | color: #8391a5; 59 | text-align: justify; 60 | vertical-align: middle; 61 | display: inline-block; 62 | } 63 | 64 | .message-close { 65 | top: 0; 66 | right: 0; 67 | position: absolute; 68 | cursor: pointer; 69 | color: #bfcbd9; 70 | font-size: 20px; 71 | } -------------------------------------------------------------------------------- /app/style/sass/topic.scss: -------------------------------------------------------------------------------- 1 | .part { 2 | background: #fff; 3 | border-radius: 2px; 4 | box-shadow: 1px 1px 1px #ccc; 5 | padding: 20px 10px; 6 | margin-bottom: 10px; 7 | } 8 | 9 | .topic-header { 10 | display: flex; 11 | border-bottom: 1px dashed #ccc; 12 | margin-bottom: 10px; 13 | 14 | .user-avator { 15 | flex-basis: 60px; 16 | flex-grow: 0; 17 | flex-shrink: 0; 18 | 19 | img { 20 | height: 60px; 21 | width: 60px; 22 | border-radius: 50%; 23 | } 24 | } 25 | 26 | .topic-info { 27 | padding-left: 10px; 28 | width: 100%; 29 | 30 | .topic-info-title { 31 | margin-bottom: 10px; 32 | font-size: 18px; 33 | font-weight: 600; 34 | } 35 | 36 | .topic-info-state { 37 | font-size: 14px; 38 | color: #acb6b7; 39 | margin-bottom: 10px; 40 | font-weight: 300; 41 | 42 | a { 43 | color: #6ac5e6; 44 | text-decoration: none; 45 | } 46 | } 47 | 48 | .topic-info-active { 49 | position: relative; 50 | margin-bottom: 10px; 51 | .topic-info-tabs { 52 | span { 53 | font-size: 12px; 54 | font-weight: 500; 55 | color: #c8b383; 56 | display: inline-block; 57 | background: #fff4de; 58 | padding: 2px 4px; 59 | border: 1px solid #ffe9b2; 60 | border-radius: 2px; 61 | cursor: pointer; 62 | margin-right: 3px; 63 | } 64 | } 65 | 66 | .topic-info-opts { 67 | position: absolute; 68 | font-size: 14px; 69 | top: 0; 70 | right: 10px; 71 | 72 | color: #999; 73 | 74 | > span { 75 | margin-left: 10px; 76 | } 77 | } 78 | } 79 | } 80 | } 81 | 82 | .reply-header { 83 | padding-bottom: 10px; 84 | margin-bottom: 10px; 85 | border-bottom: 1px dashed #ccc; 86 | } 87 | 88 | .reply-list { 89 | .reply-item { 90 | padding-bottom: 10px; 91 | margin-bottom: 10px; 92 | border-bottom: 1px dashed #ccc; 93 | 94 | &:last-child { 95 | border-bottom: none; 96 | margin-bottom: 0; 97 | padding-bottom: 0; 98 | } 99 | 100 | .reply-item-content { 101 | margin-bottom: 10px; 102 | } 103 | 104 | .reply-item-bottom { 105 | font-size: 14px; 106 | color: #acb6b7; 107 | 108 | .reply-item-bottom-info { 109 | position: relative; 110 | * { 111 | vertical-align: middle; 112 | } 113 | 114 | img { 115 | height: 30px; 116 | width: 30px; 117 | border-radius: 50%; 118 | } 119 | } 120 | 121 | .reply-item-bottom-actions { 122 | position: absolute; 123 | right: 0; 124 | bottom: 0; 125 | top: 0; 126 | 127 | * { 128 | vertical-align: middle; 129 | } 130 | 131 | .reply-item-bottom-actions-item { 132 | margin-left: 5px; 133 | } 134 | } 135 | 136 | .reply-item-bottom-form { 137 | border-top: 1px solid #ccc; 138 | margin-top: 10px; 139 | padding: 10px 0 0 20px; 140 | text-align: right; 141 | position: relative; 142 | 143 | &::after, 144 | &::before { 145 | content: ''; 146 | display: block; 147 | position: absolute; 148 | 149 | width: 0; 150 | height: 0; 151 | } 152 | 153 | &::after { 154 | border-left: 10px solid transparent; 155 | border-right: 10px solid transparent; 156 | border-bottom: 10px solid #ccc; 157 | top: 1px; 158 | right: 20px; 159 | z-index: 1000; 160 | } 161 | 162 | &.focused::after { 163 | border-bottom-color: #6ac5e6; 164 | } 165 | 166 | &::before { 167 | border-left: 8px solid transparent; 168 | border-right: 8px solid transparent; 169 | border-bottom: 8px solid #fff; 170 | top: 3px; 171 | right: 22px; 172 | z-index: 1001; 173 | } 174 | 175 | textarea { 176 | display: block; 177 | width: 100%; 178 | height: 50px; 179 | box-sizing: border-box; 180 | padding: 5px; 181 | margin-bottom: 5px; 182 | 183 | border-color: #ccc; 184 | border-radius: 2px; 185 | outline: none; 186 | resize: none; 187 | font-size: 12px; 188 | 189 | &:hover, 190 | &:focus { 191 | border-color: #6ac5e6; 192 | } 193 | } 194 | 195 | .use-markdown { 196 | position: absolute; 197 | left: 10px; 198 | bottom: 0; 199 | } 200 | } 201 | } 202 | } 203 | } 204 | 205 | .reply-bottom { 206 | margin-top: 10px; 207 | text-align: right; 208 | } 209 | 210 | .form-group { 211 | margin-bottom: 15px; 212 | .form-group-label { 213 | margin-bottom: 5px; 214 | font-size: 16px; 215 | color: #acb6b7; 216 | 217 | .require { 218 | color: red; 219 | } 220 | } 221 | 222 | .form-group-input { 223 | 224 | } 225 | } -------------------------------------------------------------------------------- /app/style/sass/user.scss: -------------------------------------------------------------------------------- 1 | .user-info { 2 | text-align: center; 3 | margin-bottom: 20px; 4 | 5 | .user-info-avatar { 6 | box-sizing: border-box; 7 | padding: 10px 0; 8 | 9 | img { 10 | width: 170px; 11 | height: 170px; 12 | border-radius: 50%; 13 | border: 1px solid #ecf1f3; 14 | } 15 | } 16 | 17 | .title { 18 | color: #364149; 19 | font-size: 16px; 20 | font-weight: 500; 21 | } 22 | 23 | .sub-title { 24 | color: #aab9c7; 25 | font-size: 13px; 26 | margin-top: 5px; 27 | } 28 | } 29 | 30 | .user-tab { 31 | .user-tab-header { 32 | display: flex; 33 | height: 70px; 34 | border-top: 1px solid #e9e9e9; 35 | border-bottom: 1px solid #e9e9e9; 36 | 37 | padding: 10px 0; 38 | box-sizing: border-box; 39 | 40 | cursor: pointer; 41 | user-select: none; 42 | 43 | li { 44 | flex: auto; 45 | width: 1%; 46 | height: 100%; 47 | border-right: 1px solid #e9e9e9; 48 | text-align: center; 49 | padding: 0 8px; 50 | 51 | .value { 52 | font-size: 20px; 53 | font-weight: 500; 54 | line-height: 20px; 55 | margin-top: 5px; 56 | margin-bottom: 5px; 57 | 58 | max-width: 100%; 59 | 60 | white-space: nowrap; 61 | overflow: hidden; 62 | text-overflow: ellipsis; 63 | } 64 | 65 | .desc { 66 | font-size: 14px; 67 | color: #aab9c7; 68 | } 69 | 70 | &:nth-last-child(1) { 71 | border-right: none; 72 | &:hover .value { 73 | color: #1f2d3d; 74 | } 75 | } 76 | 77 | &.selected .value, 78 | &:hover .value { 79 | color: #317fff; 80 | } 81 | } 82 | } 83 | 84 | .user-tab-content-wrapper { 85 | background: #f6f6f6; 86 | position: relative; 87 | 88 | .user-tab-content { 89 | width: 100%; 90 | 91 | position: absolute; 92 | top: 0; 93 | left: 0; 94 | 95 | &.active { 96 | position: relative; 97 | } 98 | } 99 | } 100 | 101 | .user-tab-content { 102 | .topic-item { 103 | background: #fff; 104 | padding: 10px; 105 | margin-bottom: 3px; 106 | box-shadow: 1px 1px 1px #ccc; 107 | 108 | .title { 109 | font-size: 16px; 110 | font-weight: 600; 111 | margin-bottom: 8px; 112 | } 113 | 114 | .info { 115 | font-size: 14px; 116 | color: #aab9c7; 117 | } 118 | 119 | &.last { 120 | background: transparent; 121 | color: #aab9c7; 122 | position: relative; 123 | 124 | box-sizing: border-box; 125 | padding: 14px; 126 | 127 | .split { 128 | background: #aab9c7; 129 | height: 2px; 130 | border: none; 131 | } 132 | 133 | .desc { 134 | height: 20px; 135 | line-height: 20px; 136 | position: absolute; 137 | top: 50%; 138 | left: 50%; 139 | transform: translate(-50%, -50%); 140 | 141 | padding: 0 5px; 142 | background: #f6f6f6; 143 | } 144 | } 145 | 146 | &.flex { 147 | display: flex; 148 | 149 | .left-part { 150 | flex-basis: 40px; 151 | 152 | img { 153 | height: 38px; 154 | width: 38px; 155 | border-radius: 50%; 156 | } 157 | } 158 | 159 | .right-part { 160 | flex-grow: 1; 161 | padding-left: 10px; 162 | } 163 | } 164 | } 165 | 166 | .message-item { 167 | background: #fff; 168 | padding: 10px; 169 | margin-bottom: 3px; 170 | box-shadow: 1px 1px 1px #ccc; 171 | 172 | .user-info { 173 | display: flex; 174 | margin-bottom: 0; 175 | 176 | .left-part { 177 | flex-basis: 40px; 178 | 179 | img { 180 | height: 38px; 181 | width: 38px; 182 | border-radius: 50%; 183 | } 184 | } 185 | 186 | .right-part { 187 | flex-grow: 1; 188 | padding-left: 10px; 189 | text-align: left; 190 | 191 | .user-name { 192 | margin-bottom: 5px; 193 | font-size: 14px; 194 | font-weight: 500; 195 | } 196 | 197 | .topic-title { 198 | font-size: 14px; 199 | color: #aab9c7; 200 | 201 | width: 90%; 202 | display: -webkit-box; 203 | -webkit-line-clamp: 1; 204 | -webkit-box-orient: vertical; 205 | overflow: hidden; 206 | } 207 | } 208 | } 209 | 210 | .desc { 211 | margin: 10px 0; 212 | font-size: 14px; 213 | } 214 | 215 | .info { 216 | font-size: 14px; 217 | color: #aab9c7; 218 | } 219 | } 220 | } 221 | } -------------------------------------------------------------------------------- /app/style/sass/userCard.scss: -------------------------------------------------------------------------------- 1 | .user-card-container { 2 | position: relative; 3 | display: inline-block; 4 | border-radius: 4px; 5 | .user-card { 6 | display: none; 7 | position: absolute; 8 | z-index: 1000; 9 | background: #fff; 10 | width: 300px; 11 | box-shadow: -1px 1px 1px #ccc, 12 | 1px -1px 1px #ccc, 13 | 1px 1px 1px #ccc, 14 | 1px 1px 1px #ccc; 15 | } 16 | 17 | &:hover .user-card { 18 | display: block; 19 | } 20 | 21 | .user-card-header { 22 | position: relative; 23 | } 24 | 25 | .user-card-header .img-container { 26 | position: absolute; 27 | top: -10px; 28 | left: 12px; 29 | height: 60px; 30 | width: 60px; 31 | 32 | > img { 33 | height: 100% !important; 34 | width: 100% !important; 35 | border-radius: 50% !important; 36 | } 37 | } 38 | 39 | .user-card-header .user-card-header-desc { 40 | margin-left: 80px; 41 | padding-top: 10px; 42 | margin-bottom: 8px; 43 | text-align: left; 44 | 45 | .title { 46 | color: #364149; 47 | font-size: 16px; 48 | font-weight: 500; 49 | } 50 | 51 | .sub-title { 52 | color: #aab9c7; 53 | font-size: 13px; 54 | margin-top: 5px; 55 | } 56 | } 57 | 58 | .user-card-content { 59 | display: flex; 60 | height: 50px; 61 | box-sizing: border-box; 62 | li { 63 | flex: auto; 64 | border-right: 1px solid #e9e9e9; 65 | text-align: center; 66 | padding: 0 8px; 67 | 68 | .value { 69 | font-size: 20px; 70 | font-weight: 500; 71 | line-height: 20px; 72 | margin-top: 5px; 73 | margin-bottom: 5px; 74 | 75 | max-width: 100%; 76 | 77 | white-space: nowrap; 78 | overflow: hidden; 79 | text-overflow: ellipsis; 80 | } 81 | 82 | .desc { 83 | font-size: 14px; 84 | color: #aab9c7; 85 | } 86 | } 87 | } 88 | 89 | .user-card-footer { 90 | text-align: center; 91 | padding: 8px; 92 | } 93 | } -------------------------------------------------------------------------------- /dist/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/dist/.gitkeep -------------------------------------------------------------------------------- /icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/icon.icns -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const electron = require("electron"); 2 | const app = electron.app; 3 | const BrowserWindow = electron.BrowserWindow; 4 | const ipc = electron.ipcMain; 5 | 6 | let win; 7 | 8 | function createWindow () { 9 | win = new BrowserWindow({ 10 | width: 400, 11 | height: 725, 12 | title: 'CNODE', 13 | resizable: false 14 | }); 15 | 16 | win.loadURL(`file://${__dirname}/app/index.html`); 17 | 18 | win.on("closed", () => { 19 | win = null; 20 | }); 21 | 22 | ipc.on("login-success", () => { 23 | win.setSize(600, 780, true); 24 | }); 25 | 26 | ipc.on("logout", () => { 27 | win.setSize(400, 725, true); 28 | }) 29 | } 30 | 31 | app.on("ready", createWindow); -------------------------------------------------------------------------------- /menu.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | window.nodeRequire = require; 4 | 5 | const electron = nodeRequire('electron'); 6 | const remote = electron.remote; 7 | const Menu = remote.Menu; 8 | 9 | var template = [ 10 | { 11 | label: '编辑', 12 | submenu: [ 13 | { 14 | label: '撤销', 15 | accelerator: 'CmdOrCtrl+Z', 16 | role: 'undo' 17 | }, 18 | { 19 | label: '重做', 20 | accelerator: 'Shift+CmdOrCtrl+Z', 21 | role: 'redo' 22 | }, 23 | { 24 | type: 'separator' 25 | }, 26 | { 27 | label: '剪切', 28 | accelerator: 'CmdOrCtrl+X', 29 | role: 'cut' 30 | }, 31 | { 32 | label: '复制', 33 | accelerator: 'CmdOrCtrl+C', 34 | role: 'copy' 35 | }, 36 | { 37 | label: '粘贴', 38 | accelerator: 'CmdOrCtrl+V', 39 | role: 'paste' 40 | }, 41 | { 42 | label: '全选', 43 | accelerator: 'CmdOrCtrl+A', 44 | role: 'selectall' 45 | } 46 | ] 47 | }, 48 | { 49 | label: '窗口', 50 | role: 'window', 51 | submenu: [ 52 | { 53 | label: '最小化', 54 | accelerator: 'CmdOrCtrl+M', 55 | role: 'minimize' 56 | }, 57 | { 58 | label: '关闭窗口', 59 | accelerator: 'CmdOrCtrl+W', 60 | role: 'close' 61 | }, 62 | { 63 | label: '调试模式', 64 | accelerator: 'Option+CmdOrCtrl+I', 65 | click: function () { 66 | remote.getCurrentWindow().webContents.toggleDevTools(); 67 | } 68 | } 69 | ] 70 | }, 71 | { 72 | label: '帮助', 73 | role: 'help', 74 | submenu: [ 75 | { 76 | label: '建议 或 反馈…', 77 | click: function () { 78 | electron.shell.openExternal('https://github.com/P-ppc/cnodejs/issues'); 79 | } 80 | } 81 | ] 82 | } 83 | ]; 84 | 85 | if (process.platform === 'darwin') { 86 | var name = remote.app.getName(); 87 | template.unshift({ 88 | label: name, 89 | submenu: [ 90 | { 91 | label: '隐藏 ' + name, 92 | accelerator: 'Command+H', 93 | role: 'hide' 94 | }, 95 | { 96 | label: '隐藏其他应用', 97 | accelerator: 'Command+Alt+H', 98 | role: 'hideothers' 99 | }, 100 | { 101 | label: '显示全部', 102 | role: 'unhide' 103 | }, 104 | { 105 | type: 'separator' 106 | }, 107 | { 108 | label: '退出', 109 | accelerator: 'Command+Q', 110 | click: function () { 111 | remote.app.quit(); 112 | } 113 | } 114 | ] 115 | }); 116 | } else if(process.platform === 'win32'){ 117 | let helpItem = template[template.length-1]; 118 | } 119 | 120 | var menu = Menu.buildFromTemplate(template); 121 | Menu.setApplicationMenu(menu); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cnodejs", 3 | "version": "2.0.0", 4 | "description": "基于electron的cnodejs社区桌面客户端", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "electron index.js", 8 | "build:mac": "electron-packager ./ cnodejs --platform=darwin --arch=x64 --icon=icon.icns --overwrite --out ./dist/$npm_package_version --version=0.37.8 --ignore='(.github|.git|.DS_Store|TODOS.md|imgPreview|node_modules)'" 9 | }, 10 | "devDependencies": { 11 | "electron-packager": "^7.0.3", 12 | "electron-prebuilt": "^0.37.0", 13 | "rimraf": "^2.5.2" 14 | }, 15 | "dependencies": {} 16 | } 17 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## 利用cnodejs网站提供的api实现一个桌面客户端([cnodejs社区](https://cnodejs.org/)) 2 | 3 | ### 快速开始 4 | ``` 5 | git clone git@github.com:P-ppc/cnodejs.git 6 | cd cnodejs 7 | npm install 8 | npm start 9 | ``` 10 | 11 | ### mac打包 12 | ``` 13 | npm run build:mac 14 | ``` 15 | 打包目录在/dist下 16 | -------------------------------------------------------------------------------- /uikit/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 基础ui规范 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |

cnodejs项目基础ui规范

14 |

包含基础样式以及一些基础组件样式

15 |
16 | 17 |
18 |

字体

19 |
    20 |
  • 使用 Helvetica, Tahoma, Arial, STXihei, “华文细黑”, “Microsoft YaHei”, “微软雅黑”, sans-serif;
  • 21 |
22 |
23 | 24 |
25 |

字体大小

26 |
    27 |
  • 基础大小: 1.6 * $rem 即 16px
  • 28 |
  • 主标题: uikit基础规范
  • 29 |
  • 标题: uikit基础规范
  • 30 |
  • 小标题: uikit基础规范
  • 31 |
  • 正文: uikit基础规范
  • 32 |
  • 正文(小): uikit基础规范
  • 33 |
  • 辅助文字: uikit基础规范
  • 34 |
35 |
36 | 37 |
38 |

背景色

39 |
light-blue
40 |
blue
41 |
dark-blue
42 |
success
43 |
warning
44 |
danger
45 |
black
46 |
light-black
47 |
extra-light-black
48 |
silver
49 |
light-silver
50 |
extra-light-silve
51 |
gray
52 |
light-gray
53 |
extra-light-gray
54 |
dark-white
55 |
white
56 |
57 | 58 |
59 |

文字组合: 如标题、副标题、连接等

60 |
61 | 62 |
63 |

按钮

64 | 65 | 66 | 67 |

68 | 69 | 70 | 71 | 72 |

73 | 74 | 75 | 76 |

77 | 81 | 84 |

85 | 86 | 87 | 88 | 89 |
90 | 91 |
92 |

输入框

93 | 94 |
95 |
96 | 97 | 98 | -------------------------------------------------------------------------------- /uikit/lib/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lib", 3 | "homepage": "https://github.com/P-ppc/cnodejs", 4 | "authors": [ 5 | "P-ppc " 6 | ], 7 | "description": "", 8 | "main": "", 9 | "license": "MIT", 10 | "ignore": [ 11 | "**/.*", 12 | "node_modules", 13 | "bower_components", 14 | "test", 15 | "tests" 16 | ], 17 | "dependencies": { 18 | "font-awesome": "^4.7.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /uikit/readme.md: -------------------------------------------------------------------------------- 1 | ### 基础ui规范 2 | -------------------------------------------------------------------------------- /uikit/style/.sass-cache/3ba488fdfbc78971641fce13030a68c63786cf7b/base.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/uikit/style/.sass-cache/3ba488fdfbc78971641fce13030a68c63786cf7b/base.scssc -------------------------------------------------------------------------------- /uikit/style/.sass-cache/668eb442b432740ea9d2399596fb6a7c064b5cbb/base.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/uikit/style/.sass-cache/668eb442b432740ea9d2399596fb6a7c064b5cbb/base.scssc -------------------------------------------------------------------------------- /uikit/style/.sass-cache/668eb442b432740ea9d2399596fb6a7c064b5cbb/index.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/P-ppc/cnodejs/433d4343e67f1aa30b8a8c29d185216177c0c09d/uikit/style/.sass-cache/668eb442b432740ea9d2399596fb6a7c064b5cbb/index.scssc -------------------------------------------------------------------------------- /uikit/style/.sass-cache/8cc6fe8dfb5d7d8edbf3e9ed79f953aa78fb04c5/_index.scssc: -------------------------------------------------------------------------------- 1 | 3.4.22 (Selective Steve) 2 | 88a837eaf941b3420d799861038319ccbfa03865 3 | o:Sass::Tree::RootNode :@children[o:Sass::Tree::CommentNode : @value[I"5/* this file is private for uikit, not public */:ET: 4 | @type: silent;[:@filename0: @options{: 5 | @linei:@source_rangeo:Sass::Source::Range :@start_poso:Sass::Source::Position;i: @offseti: @end_poso;;i;i3: 6 | @fileI"scss/_index.scss; T:@importero: Sass::Importers::Filesystem: 7 | @rootI"6/Users/ppc/MyRepertory/GitHub/cnodejs/uikit/style; T:@real_rootI"6/Users/ppc/MyRepertory/GitHub/cnodejs/uikit/style; T:@same_name_warningso:Set: 8 | @hash{o:Sass::Tree::RuleNode: 9 | @rule[I" .panel; T:@parsed_ruleso:"Sass::Selector::CommaSequence: @members[o:Sass::Selector::Sequence;![o:#Sass::Selector::SimpleSequence ;![o:Sass::Selector::Class: 10 | @nameI" 11 | panel; T;i; 0: @subject0: @sourceso;;{;o; ;o;;i;i;o;;i;i ;0;0;i; 0;i;i; 0:@selector_source_rangeo; ;o;;i;i;o;;i;i ;@;@: 12 | @tabsi;[; 0; @ ;i;o; ;@&;o;;i;i ;@;@:@has_childrenT; 0; @ :@templateI"li{margin:1rem 0}.uikit-bg{height:3rem;width:100%;margin-bottom:1rem;border-radius:.1rem;line-height:3rem;text-align:center}.uikit-bg-light-blue{background:#58B7FF}.uikit-bg-blue{background:#20A0FF}.uikit-bg-dark-blue{background:#1D8CE0}.uikit-bg-success{background:#13CE66}.uikit-bg-warning{background:#F7BA2A}.uikit-bg-danger{background:#FF4949}.uikit-bg-black{background:#1F2D3D}.uikit-bg-light-black{background:#324057}.uikit-bg-extra-light-black{background:#475669}.uikit-bg-silver{background:#8492A6}.uikit-bg-light-silver{background:#99A9BF}.uikit-bg-extra-light-silver{background:#C0CCDA}.uikit-bg-gray{background:#D3DCE6}.uikit-bg-light-gray{background:#E5E9F2}.uikit-bg-extra-light-gray{background:#EFF2F7}.uikit-bg-dark-white{background:#F9FAFC}.uikit-bg-white{background:#fff} 2 | /*# sourceMappingURL=index.css.map */ 3 | -------------------------------------------------------------------------------- /uikit/style/css/index.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AA2BA,YAAa,CACT,KAAK,CAAE,GAAG,CACV,MAAM,CAAE,MAAM,CAGlB,UAAW,CACP,UAAU,CAAE,UAAU,CACtB,OAAO,CAAE,IAAI,CACb,UAAU,CAAE,OAAO,CACnB,aAAa,CAAE,KAAK,CACpB,UAAU,CAAE,KAAK,CAGrB,iBAAkB,CACd,UAAU,CAAE,MAAM,CAClB,MAAM,CAAE,MAAM,CACd,SAAS,CAAE,MAAM,CAGrB,YAAa,CACT,SAAS,CAAE,MAAM,CACjB,MAAM,CAAE,MAAM,CAGlB,WAAY,CACR,UAAU,CAAE,IAAI,CAChB,WAAW,CAAE,IAAI,CAEjB,cAAK,CACD,MAAM,CAAE,MAAM,CAItB,SAAU,CACN,MAAM,CAAE,IAAI,CACZ,KAAK,CAAE,IAAI,CACX,aAAa,CAAE,IAAI,CACnB,aAAa,CAAE,KAAK,CAEpB,WAAW,CAAE,IAAI,CACjB,UAAU,CAAE,MAAM,CAGtB,oBAAqB,CACjB,UAAU,CAnED,OAAO,CAsEpB,cAAe,CACX,UAAU,CAtEP,OAAO,CAyEd,mBAAoB,CAChB,UAAU,CAzEF,OAAO,CA4EnB,iBAAkB,CACd,UAAU,CA3EJ,OAAO,CA8EjB,iBAAkB,CACd,UAAU,CA9EJ,OAAO,CAiFjB,gBAAiB,CACb,UAAU,CAjFL,OAAO,CAoFhB,eAAgB,CACZ,UAAU,CAnFN,OAAO,CAsFf,qBAAsB,CAClB,UAAU,CAtFA,OAAO,CAyFrB,2BAA4B,CACxB,UAAU,CAzFM,OAAO,CA4F3B,gBAAiB,CACb,UAAU,CA3FL,OAAO,CA8FhB,sBAAuB,CACnB,UAAU,CA9FC,OAAO,CAiGtB,4BAA6B,CACzB,UAAU,CAjGO,OAAO,CAoG5B,cAAe,CACX,UAAU,CAnGP,OAAO,CAsGd,oBAAqB,CACjB,UAAU,CAtGD,OAAO,CAyGpB,0BAA2B,CACvB,UAAU,CAzGK,OAAO,CA4G1B,oBAAqB,CACjB,UAAU,CA3GD,OAAO,CA8GpB,eAAgB,CACZ,UAAU,CA9GN,IAAO", 4 | "sources": ["../scss/index.scss"], 5 | "names": [], 6 | "file": "index.css" 7 | } -------------------------------------------------------------------------------- /uikit/style/scss/base.scss: -------------------------------------------------------------------------------- 1 | // 颜色变量 2 | // 主色 3 | $light-blue: #58B7FF; 4 | $blue: #20A0FF; 5 | $dark-blue: #1D8CE0; 6 | // 辅助色 7 | $success: #13CE66; 8 | $warning: #F7BA2A; 9 | $danger: #FF4949; 10 | // 中性色 11 | $black: #1F2D3D; 12 | $light-black: #324057; 13 | $extra-light-black: #475669; 14 | 15 | $silver: #8492A6; 16 | $light-silver: #99A9BF; 17 | $extra-light-silver: #C0CCDA; 18 | 19 | $gray: #D3DCE6; 20 | $light-gray: #E5E9F2; 21 | $extra-light-gray: #EFF2F7; 22 | 23 | $dark-white: #F9FAFC; 24 | $white: #FFFFFF; 25 | 26 | $rem: 10px; 27 | 28 | // reset 29 | * { 30 | margin: 0; 31 | padding: 0; 32 | } 33 | 34 | ul { 35 | list-style: none; 36 | } 37 | 38 | html { 39 | font-size: 12px; 40 | } 41 | 42 | body { 43 | font-size: 1.6 * $rem; 44 | font-family: Helvetica, Tahoma, Arial, STXihei, “华文细黑”, “Microsoft YaHei”, “微软雅黑”, sans-serif; 45 | color: #1f2d3d; 46 | } 47 | 48 | // 文字大小 49 | .h1 { 50 | font-size: 2 * $rem; 51 | } 52 | 53 | .h2 { 54 | font-size: 1.8 * $rem; 55 | } 56 | 57 | .h3 { 58 | font-size: 1.6 * $rem; 59 | } 60 | 61 | .text-regular { 62 | font-size: 1.4 * $rem; 63 | } 64 | 65 | .text-small { 66 | font-size: 1.3 * $rem; 67 | } 68 | 69 | .text-smaller { 70 | font-size: 1.2 * $rem; 71 | } 72 | 73 | // TODO 文字组合 74 | 75 | 76 | // 按钮 77 | .btn { 78 | display: inline-block; 79 | line-height: 1; 80 | white-space: nowrap; 81 | cursor: pointer; 82 | background: $white; 83 | border: 1px solid #bfcbd9; 84 | color: $black; 85 | -webkit-appearance: none; 86 | text-align: center; 87 | box-sizing: border-box; 88 | outline: none; 89 | margin: 0; 90 | padding: 1 * $rem 1.5 * $rem; 91 | font-size: 1.4 * $rem; 92 | border-radius: .2 * $rem; 93 | 94 | box-shadow: .2 * $rem .2 * $rem .1 * $rem #dde; 95 | 96 | &.disabled, 97 | &[disabled], 98 | &:hover.disabled, 99 | &:hover[disabled] { 100 | color: #bfcbd9; 101 | cursor: not-allowed; 102 | background-image: none; 103 | background-color: #eef1f6; 104 | border-color: #d1dbe5; 105 | } 106 | 107 | .icon + span { 108 | margin-left: .5 * $rem; 109 | } 110 | } 111 | 112 | .btn + .btn { 113 | margin-left: 1 * $rem; 114 | } 115 | 116 | .btn-large { 117 | padding: 1.1 * $rem 1.9 * $rem; 118 | font-size: 1.6 * $rem; 119 | } 120 | 121 | .btn-small { 122 | padding: .7 * $rem .9 * $rem; 123 | font-size: 1.2 * $rem; 124 | } 125 | 126 | .btn-mini { 127 | padding: .4 * $rem; 128 | font-size: 1.2 * $rem; 129 | } 130 | 131 | .btn-default { 132 | &.disabled, 133 | &[disabled], 134 | &:hover.disabled, 135 | &:hover[disabled] { 136 | background-color: $white; 137 | border-color: #d1dbe5; 138 | color: #bfcbd9; 139 | } 140 | 141 | &:hover { 142 | color: $blue; 143 | border-color: $blue; 144 | } 145 | 146 | &:active { 147 | color: #1d90e6; 148 | border-color: #1d90e6; 149 | } 150 | } 151 | 152 | .btn-primary { 153 | color: $white; 154 | background: $blue; 155 | border-color: $blue; 156 | 157 | &:hover { 158 | background: #4db3ff; 159 | border-color: #4db3ff; 160 | } 161 | 162 | &:active { 163 | background: #1d90e6; 164 | border-color: #1d90e6; 165 | color: $white; 166 | } 167 | } 168 | 169 | .btn-text { 170 | border: none; 171 | color: $blue; 172 | background: transparent; 173 | padding-left: 0; 174 | padding-right: 0; 175 | 176 | box-shadow: none; 177 | 178 | &.disabled, 179 | &[disabled], 180 | &:hover.disabled, 181 | &:hover[disabled] { 182 | background-color: transparent; 183 | } 184 | 185 | &:hover { 186 | color: #4db3ff; 187 | } 188 | 189 | &:active { 190 | color: #1d90e6; 191 | } 192 | } 193 | 194 | .btn-success { 195 | color: $white; 196 | background-color: $success; 197 | border-color: $success; 198 | 199 | &:hover { 200 | background: #42d885; 201 | border-color: #42d885; 202 | } 203 | 204 | &:active { 205 | background: #11b95c; 206 | border-color: #11b95c; 207 | } 208 | } 209 | 210 | .btn-warning { 211 | color: $white; 212 | background-color: $warning; 213 | border-color: $warning; 214 | 215 | &:hover { 216 | background: #f9c855; 217 | border-color: #f9c855; 218 | } 219 | 220 | &:active { 221 | background: #dea726; 222 | border-color: #dea726; 223 | } 224 | } 225 | 226 | .btn-danger { 227 | color: $white; 228 | background-color: $danger; 229 | border-color: $danger; 230 | 231 | &:hover { 232 | background: #ff6d6d; 233 | border-color: #ff6d6d; 234 | } 235 | 236 | &:active { 237 | background: #e64242; 238 | border-color: #e64242; 239 | } 240 | } 241 | 242 | .btn-info { 243 | color: $white; 244 | background-color: #50bfff; 245 | border-color: #50bfff; 246 | 247 | &:hover { 248 | background: #73ccff; 249 | border-color: #73ccff; 250 | } 251 | 252 | &:active { 253 | background: #48ace6; 254 | border-color: #48ace6; 255 | } 256 | } 257 | 258 | // 输入框 259 | .input { 260 | outline: none; 261 | -webkit-appearance: none; 262 | background-color: $white; 263 | background-image: none; 264 | border: 1px solid #bfcbd9; 265 | border-radius: .2 & $rem; 266 | box-sizing: border-box; 267 | color: #1f2d3d; 268 | display: block; 269 | font-size: inherit; 270 | 271 | height: 3.6 * $rem; 272 | line-height: 1; 273 | padding: .3 * $rem 1 * $rem; 274 | 275 | transition: border-color .2s cubic-bezier(.645,.045,.355,1); 276 | 277 | &:hover { 278 | border-color: #8391a5; 279 | } 280 | 281 | &:focus { 282 | border-color: #20a0ff; 283 | } 284 | } -------------------------------------------------------------------------------- /uikit/style/scss/index.scss: -------------------------------------------------------------------------------- 1 | // this file is PRIVATE style for uikit, and use uikit- begin 2 | 3 | // 颜色变量 4 | // 主色 5 | $light-blue: #58B7FF; 6 | $blue: #20A0FF; 7 | $dark-blue: #1D8CE0; 8 | // 辅助色 9 | $success: #13CE66; 10 | $warning: #F7BA2A; 11 | $danger: #FF4949; 12 | // 中性色 13 | $black: #1F2D3D; 14 | $light-black: #324057; 15 | $extra-light-black: #475669; 16 | 17 | $silver: #8492A6; 18 | $light-silver: #99A9BF; 19 | $extra-light-silver: #C0CCDA; 20 | 21 | $gray: #D3DCE6; 22 | $light-gray: #E5E9F2; 23 | $extra-light-gray: #EFF2F7; 24 | 25 | $dark-white: #F9FAFC; 26 | $white: #FFFFFF; 27 | 28 | .uikit-panel { 29 | width: 80%; 30 | margin: 0 auto; 31 | } 32 | 33 | .uikit-row { 34 | box-sizing: border-box; 35 | padding: 1rem; 36 | background: #f4f5f5; 37 | border-radius: .1rem; 38 | margin-top: .5rem; 39 | } 40 | 41 | .uikit-full-title { 42 | text-align: center; 43 | margin: .8em 0; 44 | font-size: 2.5rem; 45 | } 46 | 47 | .uikit-title { 48 | font-size: 1.8rem; 49 | margin: .8em 0; 50 | } 51 | 52 | .uikit-list { 53 | list-style: disc; 54 | margin-left: 2rem; 55 | 56 | > li { 57 | margin: 1rem 0; 58 | } 59 | } 60 | 61 | .uikit-bg { 62 | height: 3rem; 63 | width: 100%; 64 | margin-bottom: 1rem; 65 | border-radius: .1rem; 66 | 67 | line-height: 3rem; 68 | text-align: center; 69 | } 70 | 71 | .uikit-bg-light-blue { 72 | background: $light-blue; 73 | } 74 | 75 | .uikit-bg-blue { 76 | background: $blue; 77 | } 78 | 79 | .uikit-bg-dark-blue { 80 | background: $dark-blue; 81 | } 82 | 83 | .uikit-bg-success { 84 | background: $success; 85 | } 86 | 87 | .uikit-bg-warning { 88 | background: $warning; 89 | } 90 | 91 | .uikit-bg-danger { 92 | background: $danger; 93 | } 94 | 95 | .uikit-bg-black { 96 | background: $black; 97 | } 98 | 99 | .uikit-bg-light-black { 100 | background: $light-black; 101 | } 102 | 103 | .uikit-bg-extra-light-black { 104 | background: $extra-light-black; 105 | } 106 | 107 | .uikit-bg-silver { 108 | background: $silver; 109 | } 110 | 111 | .uikit-bg-light-silver { 112 | background: $light-silver; 113 | } 114 | 115 | .uikit-bg-extra-light-silver { 116 | background: $extra-light-silver; 117 | } 118 | 119 | .uikit-bg-gray { 120 | background: $gray; 121 | } 122 | 123 | .uikit-bg-light-gray { 124 | background: $light-gray; 125 | } 126 | 127 | .uikit-bg-extra-light-gray { 128 | background: $extra-light-gray; 129 | } 130 | 131 | .uikit-bg-dark-white { 132 | background: $dark-white; 133 | } 134 | 135 | .uikit-bg-white { 136 | background: $white; 137 | } --------------------------------------------------------------------------------