├── 开始.bat ├── 初始化数据.bat ├── static ├── images │ ├── up.png │ ├── logo.png │ ├── pic01.jpg │ ├── pic02.jpg │ ├── pic03.jpg │ ├── pic04.jpg │ ├── pic05.jpg │ ├── pic06.jpg │ ├── pic07.jpg │ ├── pic08.jpg │ ├── pic09.jpg │ ├── pic10.jpg │ ├── avatar-1.jpg │ └── list_title_bg.png ├── admin │ ├── .DS_Store │ ├── images │ │ ├── 2.jpg │ │ ├── logo.png │ │ ├── logo02.png │ │ ├── pic06.jpg │ │ ├── login_bg.jpg │ │ ├── login_title.png │ │ └── uploads_icon.jpg │ ├── js │ │ ├── .DS_Store │ │ ├── tinymce │ │ │ ├── .DS_Store │ │ │ └── js │ │ │ │ ├── tinymce │ │ │ │ ├── plugins │ │ │ │ │ ├── help │ │ │ │ │ │ └── img │ │ │ │ │ │ │ └── logo.png │ │ │ │ │ ├── imageupload │ │ │ │ │ │ ├── img │ │ │ │ │ │ │ └── icon.png │ │ │ │ │ │ ├── jquery.iframe-post-form.js │ │ │ │ │ │ ├── plugin.min.js │ │ │ │ │ │ └── uncompressed │ │ │ │ │ │ │ └── plugin.js │ │ │ │ │ ├── emoticons │ │ │ │ │ │ ├── img │ │ │ │ │ │ │ ├── smiley-cool.gif │ │ │ │ │ │ │ ├── smiley-cry.gif │ │ │ │ │ │ │ ├── smiley-frown.gif │ │ │ │ │ │ │ ├── smiley-kiss.gif │ │ │ │ │ │ │ ├── smiley-smile.gif │ │ │ │ │ │ │ ├── smiley-wink.gif │ │ │ │ │ │ │ ├── smiley-yell.gif │ │ │ │ │ │ │ ├── smiley-sealed.gif │ │ │ │ │ │ │ ├── smiley-embarassed.gif │ │ │ │ │ │ │ ├── smiley-innocent.gif │ │ │ │ │ │ │ ├── smiley-laughing.gif │ │ │ │ │ │ │ ├── smiley-surprised.gif │ │ │ │ │ │ │ ├── smiley-tongue-out.gif │ │ │ │ │ │ │ ├── smiley-undecided.gif │ │ │ │ │ │ │ ├── smiley-money-mouth.gif │ │ │ │ │ │ │ └── smiley-foot-in-mouth.gif │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── print │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── hr │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── directionality │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── nonbreaking │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── code │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── colorpicker │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── save │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── anchor │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── pagebreak │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── noneditable │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── tabfocus │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── visualblocks │ │ │ │ │ │ ├── plugin.min.js │ │ │ │ │ │ └── css │ │ │ │ │ │ │ └── visualblocks.css │ │ │ │ │ ├── contextmenu │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── preview │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── autoresize │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── autolink │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── fullscreen │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── advlist │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── insertdatetime │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── bbcode │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── toc │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── autosave │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── codesample │ │ │ │ │ │ └── css │ │ │ │ │ │ │ └── prism.css │ │ │ │ │ ├── importcss │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── legacyoutput │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── textpattern │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── textcolor │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── template │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── visualchars │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ ├── fullpage │ │ │ │ │ │ └── plugin.min.js │ │ │ │ │ └── searchreplace │ │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── skins │ │ │ │ │ └── lightgray │ │ │ │ │ │ ├── img │ │ │ │ │ │ ├── anchor.gif │ │ │ │ │ │ ├── loader.gif │ │ │ │ │ │ ├── object.gif │ │ │ │ │ │ └── trans.gif │ │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── tinymce.eot │ │ │ │ │ │ ├── tinymce.ttf │ │ │ │ │ │ ├── tinymce.woff │ │ │ │ │ │ ├── tinymce-small.eot │ │ │ │ │ │ ├── tinymce-small.ttf │ │ │ │ │ │ ├── tinymce-small.woff │ │ │ │ │ │ └── tinymce-mobile.woff │ │ │ │ │ │ ├── content.mobile.min.css │ │ │ │ │ │ ├── content.inline.min.css │ │ │ │ │ │ └── content.min.css │ │ │ │ ├── langs │ │ │ │ │ └── readme.md │ │ │ │ └── jquery.tinymce.min.js │ │ │ │ └── tinymce_setup.js │ │ └── jedate │ │ │ └── css │ │ │ ├── jedate.png │ │ │ ├── jedatefont.eot │ │ │ ├── jedatefont.ttf │ │ │ ├── jedatefont.woff │ │ │ └── jedatefont.svg │ ├── fonts │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ ├── iconfont.woff2 │ │ └── iconfont.css │ ├── css │ │ ├── reset.css │ │ └── iconfont.css │ ├── login.html │ ├── article_release.html │ ├── article_edit.html │ └── user.html ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 ├── css │ ├── jquery.pagination.css │ └── reset.css └── js │ └── jquery.pagination.min.js ├── reset ├── static │ └── icon.jpg ├── resetData │ ├── user.json │ └── category.json └── index.js ├── 服务器接口文档说明.assets ├── 1568597237554.png ├── 1568597384285.png ├── 1568597640907.png ├── 1568597752936.png └── 1568598049185.png ├── config └── index.js ├── pem ├── rsa_public_key.pem └── rsa_private_key.pem ├── utils ├── uploads.js ├── message.js ├── htmlFmt.js └── jwt.js ├── router ├── data │ └── dataRouter.js ├── comment │ └── commentRouter.js ├── category │ └── categoryRouter.js ├── indexRouter.js ├── adminRouter.js ├── user │ └── userRouter.js └── article │ └── articleRouter.js ├── db ├── models │ ├── category.js │ ├── user.js │ ├── comment.js │ └── article.js └── index.js ├── package.json ├── app.js ├── .gitignore └── controllers ├── categoryController.js ├── dataController.js ├── userController.js └── commentController.js /开始.bat: -------------------------------------------------------------------------------- 1 | node app.js -------------------------------------------------------------------------------- /初始化数据.bat: -------------------------------------------------------------------------------- 1 | node reset -------------------------------------------------------------------------------- /static/images/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/up.png -------------------------------------------------------------------------------- /reset/static/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/reset/static/icon.jpg -------------------------------------------------------------------------------- /static/admin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/.DS_Store -------------------------------------------------------------------------------- /static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/logo.png -------------------------------------------------------------------------------- /static/images/pic01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic01.jpg -------------------------------------------------------------------------------- /static/images/pic02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic02.jpg -------------------------------------------------------------------------------- /static/images/pic03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic03.jpg -------------------------------------------------------------------------------- /static/images/pic04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic04.jpg -------------------------------------------------------------------------------- /static/images/pic05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic05.jpg -------------------------------------------------------------------------------- /static/images/pic06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic06.jpg -------------------------------------------------------------------------------- /static/images/pic07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic07.jpg -------------------------------------------------------------------------------- /static/images/pic08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic08.jpg -------------------------------------------------------------------------------- /static/images/pic09.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic09.jpg -------------------------------------------------------------------------------- /static/images/pic10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/pic10.jpg -------------------------------------------------------------------------------- /static/admin/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/images/2.jpg -------------------------------------------------------------------------------- /static/admin/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/.DS_Store -------------------------------------------------------------------------------- /static/admin/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/images/logo.png -------------------------------------------------------------------------------- /static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /static/images/avatar-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/avatar-1.jpg -------------------------------------------------------------------------------- /static/admin/images/logo02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/images/logo02.png -------------------------------------------------------------------------------- /static/admin/images/pic06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/images/pic06.jpg -------------------------------------------------------------------------------- /static/admin/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/fonts/iconfont.eot -------------------------------------------------------------------------------- /static/admin/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/fonts/iconfont.ttf -------------------------------------------------------------------------------- /static/admin/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/fonts/iconfont.woff -------------------------------------------------------------------------------- /static/admin/fonts/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/fonts/iconfont.woff2 -------------------------------------------------------------------------------- /static/admin/images/login_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/images/login_bg.jpg -------------------------------------------------------------------------------- /static/admin/js/tinymce/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/.DS_Store -------------------------------------------------------------------------------- /static/images/list_title_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/images/list_title_bg.png -------------------------------------------------------------------------------- /static/admin/images/login_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/images/login_title.png -------------------------------------------------------------------------------- /服务器接口文档说明.assets/1568597237554.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/服务器接口文档说明.assets/1568597237554.png -------------------------------------------------------------------------------- /服务器接口文档说明.assets/1568597384285.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/服务器接口文档说明.assets/1568597384285.png -------------------------------------------------------------------------------- /服务器接口文档说明.assets/1568597640907.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/服务器接口文档说明.assets/1568597640907.png -------------------------------------------------------------------------------- /服务器接口文档说明.assets/1568597752936.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/服务器接口文档说明.assets/1568597752936.png -------------------------------------------------------------------------------- /服务器接口文档说明.assets/1568598049185.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/服务器接口文档说明.assets/1568598049185.png -------------------------------------------------------------------------------- /static/admin/images/uploads_icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/images/uploads_icon.jpg -------------------------------------------------------------------------------- /static/admin/js/jedate/css/jedate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/jedate/css/jedate.png -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /static/admin/js/jedate/css/jedatefont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/jedate/css/jedatefont.eot -------------------------------------------------------------------------------- /static/admin/js/jedate/css/jedatefont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/jedate/css/jedatefont.ttf -------------------------------------------------------------------------------- /static/admin/js/jedate/css/jedatefont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/jedate/css/jedatefont.woff -------------------------------------------------------------------------------- /reset/resetData/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "username": "admin", 3 | "nickname": "李思思", 4 | "email": "sisili@qq.com", 5 | "userPic": "icon.jpg", 6 | "password": "123456" 7 | } 8 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/help/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/help/img/logo.png -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/imageupload/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/imageupload/img/icon.png -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-cool.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-cool.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-cry.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-cry.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-frown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-frown.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-kiss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-kiss.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-smile.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-wink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-wink.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-yell.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-yell.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-sealed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-sealed.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/langs/readme.md: -------------------------------------------------------------------------------- 1 | This is where language files should be placed. 2 | 3 | Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ 4 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-innocent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-innocent.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-laughing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-laughing.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-surprised.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-surprised.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-undecided.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-undecided.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-mobile.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-mobile.woff -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/penglin0613/bigEvents/HEAD/static/admin/js/tinymce/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | module.exports ={ 2 | // 库名 3 | database:'bignews', 4 | // 用户名 5 | username:'root', 6 | // 密码 7 | password:'root', 8 | // 主机 9 | host:'127.0.0.1', 10 | // 项目运行端口 11 | port:8080, 12 | // 项目基地址 13 | baseUrl:'http://localhost' 14 | } -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/skins/lightgray/content.mobile.min.css: -------------------------------------------------------------------------------- 1 | .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{position:absolute;display:inline-block;background-color:green;opacity:.5}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%} -------------------------------------------------------------------------------- /pem/rsa_public_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDrgzxtbX++lU8iuC+O20QOr8sU 3 | 5bZ8gvsI4Rx9kFEgdhswYyGVQT1rraxbBkKU6Ekaw8tH6euitKZ5bAldyJJv4Um6 4 | 6hMO8nlP15lsHidny2lJ2FGqQWTkgrdOhdI6yAy4xF6oQu9jgT2GeeGeO6Wxf8z5 5 | QmZEcpnypnx7OcSHOwIDAQAB 6 | -----END PUBLIC KEY----- 7 | -------------------------------------------------------------------------------- /reset/resetData/category.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "爱生活", 4 | "slug": "热爱生活" 5 | }, 6 | { 7 | "name": "爱旅行", 8 | "slug": "热爱旅行" 9 | }, 10 | { 11 | "name": "爱美食", 12 | "slug": "热爱美食" 13 | }, 14 | { 15 | "name": "爱运动", 16 | "slug": "热爱运动" 17 | }, 18 | { 19 | "name": "经济特区", 20 | "slug": "热爱经济" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /utils/uploads.js: -------------------------------------------------------------------------------- 1 | const multer = require('multer') 2 | 3 | const fileFilter = (request, file, callback) => { 4 | if (!file.originalname.match(/\.(jpg|jpeg|png|gif)$/)) { 5 | return callback(new Error('wrong type :)'), false) 6 | } 7 | callback(null, true) 8 | } 9 | 10 | const upload = multer({ dest: 'uploads/', fileFilter }) 11 | 12 | module.exports = { 13 | upload 14 | } -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){t.addCommand("mcePrint",function(){t.getWin().print()})},i=function(t){t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print"})};t.add("print",function(t){n(t),i(t),t.addShortcut("Meta+P","","mcePrint")})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}(); -------------------------------------------------------------------------------- /utils/message.js: -------------------------------------------------------------------------------- 1 | const { validationResult } = require("express-validator") 2 | 3 | module.exports = { 4 | errorMsg: (req, res, next) => { 5 | const valRes = validationResult(req) 6 | if (!valRes.isEmpty()) { 7 | let msg = "" 8 | valRes.errors.forEach(v => { 9 | msg += `${v.param},` 10 | }) 11 | msg = msg.slice(0, -1) 12 | msg += " 参数有问题,请检查" 13 | return res.status(400).send({ 14 | msg 15 | }) 16 | } 17 | next() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /router/data/dataRouter.js: -------------------------------------------------------------------------------- 1 | const express = require("express") 2 | const router = express.Router() 3 | 4 | // 错误信息提示中间件 5 | const { errorMsg } = reqlib("/utils/message") 6 | // 导入控制器 7 | const dataController = reqlib("/controllers/dataController.js") 8 | 9 | 10 | // 注册路由 11 | // 路由 - 统计数据 12 | router.get('/info',dataController.info) 13 | // 路由 - 日新增文章数量统计 14 | router.get('/article',dataController.article) 15 | // 路由 - 各类型文章数量统计 16 | router.get('/category',dataController.category) 17 | // 路由 - 日文章访问量 18 | router.get('/visit',dataController.visit) 19 | 20 | // 暴露出去 21 | module.exports = router -------------------------------------------------------------------------------- /db/models/category.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | module.exports = (sequelize, DataTypes) => { 4 | const Category = sequelize.define("category", { 5 | name: { 6 | type: DataTypes.STRING, 7 | allowNull: false, 8 | unique: true 9 | }, 10 | slug: { 11 | type: DataTypes.STRING, 12 | allowNull: false, 13 | unique: true 14 | } 15 | }) 16 | 17 | Category.associate = function(model) { 18 | // associations can be defined here 19 | // // console.log(model) 20 | // this.hasMany(model, { foreignKey: "id", sourceKey: "pid" }) 21 | } 22 | 23 | return Category 24 | } 25 | -------------------------------------------------------------------------------- /db/models/user.js: -------------------------------------------------------------------------------- 1 | module.exports = (sequelize, DataTypes) => { 2 | const User = sequelize.define('user', { 3 | username: { 4 | type: DataTypes.STRING, 5 | allowNull: false 6 | }, 7 | nickname: { 8 | type: DataTypes.STRING 9 | }, 10 | email: { 11 | type: DataTypes.STRING 12 | }, 13 | userPic: { 14 | type: DataTypes.STRING 15 | }, 16 | password: { 17 | type: DataTypes.STRING 18 | } 19 | }); 20 | 21 | User.associate = function(models) { 22 | // associations can be defined here 23 | }; 24 | 25 | return User; 26 | }; -------------------------------------------------------------------------------- /static/css/jquery.pagination.css: -------------------------------------------------------------------------------- 1 | .ui-pagination-container { 2 | height: 34px; 3 | line-height: 34px; 4 | } 5 | 6 | .ui-pagination-container .ui-pagination-page-item { 7 | font-size: 14px; 8 | padding: 4px 10px; 9 | background: #fff; 10 | border: 1px solid #c5b7b7; 11 | color: #888; 12 | margin: 0 3px; 13 | text-decoration: none; 14 | } 15 | 16 | .ui-pagination-container .ui-pagination-page-item:hover { 17 | border-color: #568dbd; 18 | color: #568dbd; 19 | text-decoration: none; 20 | } 21 | 22 | .ui-pagination-container .ui-pagination-page-item.active { 23 | background: #568dbd; 24 | border-color: #568dbd; 25 | color: #fff; 26 | cursor: default; 27 | } -------------------------------------------------------------------------------- /static/css/reset.css: -------------------------------------------------------------------------------- 1 | body,ul,h1,h2,h3,h4,h5,h6,p{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | h1,h2,h3,h4,h5,h6{ 6 | font-size:100%; 7 | font-weight:normal; 8 | } 9 | a{ 10 | text-decoration:none; 11 | /* 点击a标签显示透明色,不设置会显示蓝色 */ 12 | -webkit-tap-highlight-color:transparent; 13 | } 14 | ul{ 15 | list-style:none; 16 | } 17 | img{ 18 | border:0px; 19 | } 20 | 21 | /* 清除浮动,解决margin-top塌陷 */ 22 | .clearfix:before,.clearfix:after{ 23 | content:''; 24 | display:table; 25 | } 26 | .clearfix:after{ 27 | clear:both; 28 | } 29 | .clearfix{ 30 | zoom:1; 31 | } 32 | 33 | .fl{ 34 | float:left; 35 | } 36 | .fr{ 37 | float:right; 38 | } 39 | -------------------------------------------------------------------------------- /db/models/comment.js: -------------------------------------------------------------------------------- 1 | module.exports = (sequelize, DataTypes) => { 2 | const Comment = sequelize.define('comment', { 3 | author: { 4 | type: DataTypes.STRING, 5 | allowNull: false 6 | }, 7 | content: { 8 | type: DataTypes.STRING, 9 | allowNull: false 10 | }, 11 | date: { 12 | type: DataTypes.STRING, 13 | allowNull: false 14 | }, 15 | time: { 16 | type: DataTypes.STRING, 17 | allowNull: false 18 | }, 19 | state: { 20 | type: DataTypes.STRING, 21 | allowNull: false 22 | } 23 | }); 24 | 25 | Comment.associate = function(models) { 26 | // associations can be defined here 27 | }; 28 | 29 | return Comment; 30 | }; -------------------------------------------------------------------------------- /static/admin/css/reset.css: -------------------------------------------------------------------------------- 1 | body,ul,h1,h2,h3,h4,h5,h6,p{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | h1,h2,h3,h4,h5,h6{ 6 | font-size:100%; 7 | font-weight:normal; 8 | } 9 | a{ 10 | text-decoration:none; 11 | /* 点击a标签显示透明色,不设置会显示蓝色 */ 12 | -webkit-tap-highlight-color:transparent; 13 | } 14 | 15 | a:link,a:visited,a:hover,a:active{ 16 | text-decoration:none; 17 | } 18 | 19 | 20 | ul{ 21 | list-style:none; 22 | } 23 | img{ 24 | border:0px; 25 | } 26 | 27 | /* 清除浮动,解决margin-top塌陷 */ 28 | .clearfix:before,.clearfix:after{ 29 | content:''; 30 | display:table; 31 | } 32 | .clearfix:after{ 33 | clear:both; 34 | } 35 | .clearfix{ 36 | zoom:1; 37 | } 38 | 39 | .fl{ 40 | float:left; 41 | } 42 | .fr{ 43 | float:right; 44 | } 45 | -------------------------------------------------------------------------------- /utils/htmlFmt.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // html装字符串 3 | html_encode(str) { 4 | var s = ""; 5 | if (str.length == 0) return ""; 6 | s = str.replace(/&/g, "&"); 7 | s = s.replace(//g, ">"); 9 | s = s.replace(/ /g, " "); 10 | s = s.replace(/\'/g, "'"); 11 | s = s.replace(/\"/g, """); 12 | s = s.replace(/\n/g, "
"); 13 | return s; 14 | }, 15 | // 字符串转html 16 | html_decode(str) { 17 | var s = ""; 18 | if (str.length == 0) return ""; 19 | s = str.replace(/&/g, "&"); 20 | s = s.replace(/</g, "<"); 21 | s = s.replace(/>/g, ">"); 22 | s = s.replace(/ /g, " "); 23 | s = s.replace(/'/g, "'"); 24 | s = s.replace(/"/g, '"'); 25 | s = s.replace(//g, "\n"); 26 | return s; 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/directionality/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,i){var n,o=t.dom,c=t.selection.getSelectedBlocks();c.length&&(n=o.getAttrib(c[0],"dir"),e.each(c,function(t){o.getParent(t.parentNode,'*[dir="'+i+'"]',o.getRoot())||o.setAttrib(t,"dir",n!==i?i:null)}),t.nodeChanged())},n=function(t){t.addCommand("mceDirectionLTR",function(){i(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){i(t,"rtl")})},o=function(t){var i=[];return e.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(e){i.push(e+"[dir="+t+"]")}),i.join(",")},c=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:o("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:o("rtl")})};t.add("directionality",function(t){n(t),c(t)})}(); -------------------------------------------------------------------------------- /pem/rsa_private_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXAIBAAKBgQDrgzxtbX++lU8iuC+O20QOr8sU5bZ8gvsI4Rx9kFEgdhswYyGV 3 | QT1rraxbBkKU6Ekaw8tH6euitKZ5bAldyJJv4Um66hMO8nlP15lsHidny2lJ2FGq 4 | QWTkgrdOhdI6yAy4xF6oQu9jgT2GeeGeO6Wxf8z5QmZEcpnypnx7OcSHOwIDAQAB 5 | AoGAAQYwFBW+0XhawL7mTgu8DwhKrMuW8JGtP8ui0RT4lViOI7a6paiD+Nzne/nZ 6 | /kXIU5p4XtawlKOOecazf7nokRvZi5XNa0265L4kA0Gre8J9ooo/GADCdB18hpgA 7 | bRpols9EmKcoKfGjwLDC1cxcrwm6xHNt8WRl2IEs12DNV7kCQQD/k9F1nDrQEzAy 8 | LwH3yokqaHIyKNDQsBJPJ+lF9SQqQz7PukkKe/uQJ90ZDmO/8sklFwglv3/4zT02 9 | wVrQdGQVAkEA6+bsvFHnwwH+YV5hc9hxEO3zmem/hdqo752yBlullfqvFJ1BzNNt 10 | gfmE/KXQUCZsBnNPQDo9bs6XxozRr6CCDwJBAK0REQbeW2kphTqGYIPGb+n6vlG/ 11 | F+ApSsy1Tx7jaLEBxlfuYqWp3Wj5xZvBBcUmiBUIqqi9K9B0Ut5wQqnkFx0CQFSA 12 | oATFgjPEnw7Z9Ca/PaFG26Air0yPizxqTL8iTSpwZg8IVe29Ptj0PMMT0o8jdEbL 13 | P3ROaHss3gltoB89a9kCQDfRLAmmWEdFmDXmcvELQO4ELkuYHqPHFgnt2rWM/yr3 14 | 3OB84ggbfBLxsyGD4yyN0KF4FEadAuQIx1sDpbaSmPg= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /db/models/article.js: -------------------------------------------------------------------------------- 1 | module.exports = (sequelize, DataTypes) => { 2 | const Article = sequelize.define('article', { 3 | title: { 4 | type: DataTypes.STRING, 5 | allowNull: false 6 | }, 7 | cover: { 8 | type: DataTypes.STRING, 9 | allowNull: false 10 | }, 11 | date: { 12 | type: DataTypes.STRING, 13 | allowNull: false 14 | }, 15 | content: { 16 | type: DataTypes.TEXT, 17 | allowNull: false 18 | }, 19 | isDelete: { 20 | type: DataTypes.BOOLEAN, 21 | allowNull: false 22 | }, 23 | state: { 24 | type: DataTypes.STRING, 25 | allowNull: false 26 | }, 27 | author: { 28 | type: DataTypes.STRING, 29 | allowNull: false 30 | }, 31 | read: { 32 | type: DataTypes.INTEGER 33 | } 34 | }); 35 | 36 | Article.associate = function(model) { 37 | // associations can be defined here 38 | }; 39 | 40 | return Article; 41 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bigNews", 3 | "version": "1.0.0", 4 | "description": "大事件", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/AutumnFish/bigNews.git" 12 | }, 13 | "keywords": [], 14 | "author": "", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/AutumnFish/bigNews/issues" 18 | }, 19 | "homepage": "https://github.com/AutumnFish/bigNews#readme", 20 | "dependencies": { 21 | "app-root-path": "^2.2.1", 22 | "body-parser": "^1.19.0", 23 | "cors": "^2.8.5", 24 | "express": "^4.17.1", 25 | "express-validator": "^6.1.1", 26 | "jsonwebtoken": "^8.5.1", 27 | "mockjs": "^1.0.1-beta3", 28 | "moment": "^2.24.0", 29 | "morgan": "^1.9.1", 30 | "multer": "^1.4.2", 31 | "mysql2": "^1.6.5", 32 | "sequelize": "^5.11.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /router/comment/commentRouter.js: -------------------------------------------------------------------------------- 1 | const express = require("express") 2 | const router = express.Router() 3 | // 验证插件 4 | const { check } = require("express-validator") 5 | 6 | // 导入控制器 7 | const commentController = reqlib("/controllers/commentController.js") 8 | 9 | // 错误信息提示中间件 10 | const { errorMsg } = reqlib("/utils/message") 11 | 12 | 13 | // 注册路由 - 评论搜索 14 | router.get("/search",commentController.search) 15 | 16 | // 注册路由 - 评论审核通过 17 | router.post( 18 | "/pass", 19 | [ 20 | check("id") 21 | .not() 22 | .isEmpty() 23 | ], 24 | errorMsg, 25 | commentController.pass 26 | ) 27 | 28 | // 注册路由 - 评论审核不通过 29 | router.post( 30 | "/reject", 31 | [ 32 | check("id") 33 | .not() 34 | .isEmpty() 35 | ], 36 | errorMsg, 37 | commentController.reject 38 | ) 39 | 40 | // 注册路由 - 删除评论 41 | router.post( 42 | "/delete", 43 | [ 44 | check("id") 45 | .not() 46 | .isEmpty() 47 | ], 48 | errorMsg, 49 | commentController._delete 50 | ) 51 | 52 | module.exports = router 53 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(n,e){var t,a=(t=n).plugins.visualchars&&t.plugins.visualchars.isEnabled()?' ':" ";n.insertContent(function(n,e){for(var t="",a=0;a0&&n.on("keydown",function(i){if(i.keyCode===a.TAB&&!i.isDefaultPrevented()){if(i.shiftKey)return;i.preventDefault(),i.stopImmediatePropagation(),e(n,t)}})},r=function(n){n.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),n.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"})};n.add("nonbreaking",function(n){t(n),r(n),o(n)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/code/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),e=function(t){return t.getParam("code_dialog_width",600)},o=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},i=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},c=function(t){return t.getContent({source_view:!0})},d=function(t){var n=e(t),d=o(t);t.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:n,minHeight:d,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(n){i(t,n.data.code)}}).find("#code").value(c(t))},u=function(t){t.addCommand("mceCodeEditor",function(){d(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){d(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){d(t)}})};t.add("code",function(t){return u(t),a(t),{}})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/emoticons/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]],o=function(t){var o;return o='',e.each(i,function(i){o+="",e.each(i,function(e){var i=t+"/img/smiley-"+e+".gif";o+=''}),o+=""}),o+="
"},n=function(t,e){var i=o(e);t.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:i,onclick:function(e){var i,o,n,a=t.dom.getParent(e.target,"a");a&&(i=t,o=a.getAttribute("data-mce-url"),n=a.getAttribute("data-mce-alt"),i.insertContent(i.dom.createHTML("img",{src:o,alt:n})),this.hide())}},tooltip:"Emoticons"})};t.add("emoticons",function(t,e){n(t,e)})}(); -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const express = require("express") 2 | const cors = require("cors") 3 | const bodyParser = require("body-parser") 4 | const morgan = require("morgan") 5 | // 设置到全局对象上 6 | global.reqlib = require('app-root-path').require; 7 | 8 | // 导入配置文件 9 | const config = require('./config/index') 10 | 11 | // 路由 12 | const adminRouter = require("./router/adminRouter") 13 | const indexRouter = require("./router/indexRouter") 14 | // 数据库 15 | const db = require("./db") 16 | 17 | const app = express() 18 | 19 | // 托管静态资源 20 | app.use(express.static('static')) 21 | 22 | 23 | // 中间件 - 跨域 24 | app.use(cors()) 25 | 26 | // 中间件 - post数据解析 27 | app.use(bodyParser.urlencoded({ extended: false })) 28 | 29 | // 中间件 - 日志 最小模式输出 30 | app.use(morgan("tiny")) 31 | 32 | // 中间件 - 路由 - admin 33 | app.use("/api/v1/admin", adminRouter) 34 | // 中间件 - 路由 - index 35 | app.use("/api/v1/index", indexRouter) 36 | 37 | // 中间件 - 托管静态资源 38 | app.use(express.static('uploads')) 39 | 40 | db.sequelize.sync({ force: false }).then(() => { 41 | app.listen(config.port, () => { 42 | console.log(`开启成功: ${config.baseUrl}:${config.port}`) 43 | }) 44 | }) 45 | -------------------------------------------------------------------------------- /router/category/categoryRouter.js: -------------------------------------------------------------------------------- 1 | const express = require("express") 2 | const router = express.Router() 3 | // 验证插件 4 | const { check } = require("express-validator") 5 | 6 | // 导入控制器 7 | const categoryController = reqlib("/controllers/categoryController.js") 8 | 9 | // 错误信息提示中间件 10 | const {errorMsg} = reqlib('/utils/message') 11 | 12 | // 新增文章分类 13 | router.post( 14 | "/add", 15 | [ 16 | check("slug") 17 | .not() 18 | .isEmpty(), 19 | check("slug") 20 | .not() 21 | .isEmpty() 22 | ], 23 | errorMsg, 24 | categoryController.add 25 | ) 26 | 27 | // 获取文章分类列表 28 | router.get('/list',categoryController.list) 29 | // 根据id搜索文章分类 30 | router.get('/search',[ 31 | check('id').not() 32 | .isEmpty() 33 | ],errorMsg,categoryController.search) 34 | 35 | // 编辑文章类别 36 | router.post('/edit',[ 37 | check('id').not().isEmpty(), 38 | check('name').not().isEmpty(), 39 | check('slug').not().isEmpty(), 40 | ],errorMsg,categoryController.edit) 41 | 42 | 43 | // 删除文章类别 44 | router.post('/delete',[ 45 | check('id').not().isEmpty() 46 | ],errorMsg,categoryController._delete) 47 | 48 | 49 | module.exports = router 50 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce_setup.js: -------------------------------------------------------------------------------- 1 | tinymce.init({ 2 | //选择class为content的标签作为编辑器 3 | selector: '#rich_content', 4 | //方向从左到右 5 | directionality:'ltr', 6 | //语言选择中文 7 | language:'zh_CN', 8 | //高度为400 9 | height:300, 10 | width: '100%', 11 | //工具栏上面的补丁按钮 12 | plugins: [ 13 | 'advlist autolink link image lists charmap preview hr anchor pagebreak spellchecker', 14 | 'searchreplace wordcount visualblocks visualchars code insertdatetime nonbreaking', 15 | 'save table contextmenu directionality template paste textcolor', 16 | 'codesample imageupload', 17 | ], 18 | //工具栏的补丁按钮 19 | toolbar: 'insertfile undo redo | \ 20 | styleselect | \ 21 | bold italic | \ 22 | alignleft aligncenter alignright alignjustify | \ 23 | bullist numlist outdent indent | \ 24 | image | \ 25 | preview | \ 26 | forecolor emoticons |\ 27 | codesample fontsizeselect |\ 28 | imageupload', 29 | //字体大小 30 | fontsize_formats: '10pt 12pt 14pt 18pt 24pt 36pt', 31 | //按tab不换行 32 | nonbreaking_force_tab: true, 33 | imageupload_url: "/user/submit-image" 34 | }); -------------------------------------------------------------------------------- /db/index.js: -------------------------------------------------------------------------------- 1 | 2 | const Sequelize = require('sequelize'); 3 | const CategoryModel = require('./models/category.js'); 4 | const CommentModel = require('./models/comment.js'); 5 | const ArticleModel = require('./models/article.js'); 6 | const UserModel = require('./models/user.js'); 7 | const {database,username,password,host}= require('../config') 8 | 9 | const sequelize = new Sequelize(database, username, password, { 10 | host, 11 | dialect: 'mysql', 12 | define: { 13 | // `timestamps` 字段指定是否将创建 `createdAt` 和 `updatedAt` 字段. 14 | // 该值默认为 true, 但是当前设定为 false 15 | timestamps: false, 16 | // 设置数据库定义的类型 17 | engine: 'MYISAM' 18 | }, 19 | // 打印sql语句 20 | logging:false 21 | }); 22 | 23 | const Category = CategoryModel(sequelize, Sequelize); 24 | const Comment = CommentModel(sequelize, Sequelize); 25 | const Article = ArticleModel(sequelize, Sequelize); 26 | const User = UserModel(sequelize, Sequelize); 27 | 28 | // 定义关联 分类 ->文章 一对多 29 | // // console.log(Category.hasMany) 30 | Category.hasMany(Article) 31 | Article.belongsTo(Category) 32 | 33 | // 定义关联 文章 ->分类 一对多 34 | Article.hasMany(Comment) 35 | Comment.belongsTo(Article) 36 | module.exports = { 37 | sequelize, 38 | Sequelize, 39 | Category, 40 | Comment, 41 | Article, 42 | User 43 | } -------------------------------------------------------------------------------- /router/indexRouter.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const router = express.Router() 3 | // 验证插件 4 | const { check } = require("express-validator") 5 | // 控制器 6 | const indexController = reqlib('/controllers/indexController.js') 7 | 8 | // 错误信息提示中间件 9 | const {errorMsg} = reqlib('/utils/message') 10 | 11 | 12 | 13 | // 路由 - 评论新增 14 | router.post('/post_comment',[ 15 | check('author').not().isEmpty().isLength({max:6}), 16 | check('content').not().isEmpty(), 17 | check('articleId').not().isEmpty() 18 | ],errorMsg,indexController.post_comment) 19 | 20 | // 路由 - 评论列表 21 | router.get('/get_comment',[ 22 | check('articleId').not().isEmpty() 23 | ],errorMsg,indexController.get_comment) 24 | 25 | // 路由 - 文章搜索 26 | router.get('/search',indexController.search) 27 | // 路由 - 文章类型 28 | router.get('/category',indexController.category) 29 | // 路由 - 热点图 30 | router.get('/hotpic',indexController.hotpic) 31 | // 路由 - 文章热门排行 32 | router.get('/rank',indexController.rank) 33 | // 路由 - 最新资讯 34 | router.get('/latest',indexController.latest) 35 | // 路由 - 最新评论 36 | router.get('/latest_comment',indexController.latest_comment) 37 | // 路由 - 焦点关注 38 | router.get('/attention',indexController.attention) 39 | // 路由 - 文章详情 40 | router.get('/article',indexController.article) 41 | 42 | 43 | module.exports = router 44 | -------------------------------------------------------------------------------- /utils/jwt.js: -------------------------------------------------------------------------------- 1 | // 引入模块依赖 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | const jwt = require('jsonwebtoken'); 5 | // 创建 token 类 6 | class Jwt { 7 | constructor(data) { 8 | this.data = data; 9 | 10 | } 11 | 12 | //生成token 13 | generateToken() { 14 | let data = this.data; 15 | let created = Math.floor(Date.now() / 1000); 16 | let cert = fs.readFileSync(path.join(__dirname, '../pem/rsa_private_key.pem'));//私钥 可以自己生成 17 | let token = jwt.sign({ 18 | data, 19 | exp: created + 60 * 60 * 24 * 7 * 1000, 20 | }, cert, {algorithm: 'RS256'}); 21 | return token; 22 | } 23 | 24 | // 校验token 25 | verifyToken() { 26 | let token = this.data; 27 | let cert = fs.readFileSync(path.join(__dirname, '../pem/rsa_public_key.pem'));//公钥 可以自己生成 28 | let res; 29 | try { 30 | let result = jwt.verify(token, cert, {algorithms: ['RS256']}) || {}; 31 | let {exp = 0} = result, current = Math.floor(Date.now() / 1000); 32 | if (current <= exp) { 33 | res = result.data || {}; 34 | } 35 | } catch (e) { 36 | res = 'err'; 37 | } 38 | return res; 39 | } 40 | } 41 | 42 | module.exports = Jwt; 43 | -------------------------------------------------------------------------------- /router/adminRouter.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | 3 | const router = express.Router(); 4 | // 引入jwt token工具 5 | const JwtUtil = require("../utils/jwt"); 6 | // 分类路由 7 | const categoryRouter = require("./category/categoryRouter"); 8 | // 文章路由 9 | const articleRouter = require("./article/articleRouter"); 10 | // 评论路由 11 | const commentRouter = require("./comment/commentRouter"); 12 | // 用户路由 13 | const userRouter = require("./user/userRouter"); 14 | // 用户路由 15 | const dataRouter = require("./data/dataRouter"); 16 | 17 | router.use((req, res, next) => { 18 | // // console.log(req.url) 19 | // 如果是登录页就放过去 20 | if (req.url === "/user/login") { 21 | next(); 22 | } else { 23 | // 验证token 24 | let authorization = req.headers.authorization; 25 | let jwt = new JwtUtil(authorization); 26 | let result = jwt.verifyToken(); 27 | if (result == "err") { 28 | return res.status(403).send({ status: 403, msg: "未登录,请先登录" }); 29 | } 30 | next(); 31 | } 32 | }); 33 | 34 | // 中间件 - 分类路由 35 | router.use("/category", categoryRouter); 36 | // 中间件 - 文章路由 37 | router.use("/article", articleRouter); 38 | // 中间件 - 评论路由 39 | router.use("/comment", commentRouter); 40 | 41 | // 中间件 - 用户 42 | router.use("/user", userRouter); 43 | 44 | // 中间件 - 统计数据 45 | router.use("/data", dataRouter); 46 | 47 | module.exports = router; 48 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Color"),i=function(e,n){e.find("#preview")[0].getEl().style.background=n},t=function(e,t){var l=n(t),a=l.toRgb();e.fromJSON({r:a.r,g:a.g,b:a.b,hex:l.toHex().substr(1)}),i(e,l.toHex())},l=function(e,n,l){var a=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:l,onchange:function(){var e=this.rgb();a&&(a.find("#r").value(e.r),a.find("#g").value(e.g),a.find("#b").value(e.b),a.find("#hex").value(this.value().substr(1)),i(a,this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,i=a.find("colorpicker")[0];if(e=this.name(),n=this.value(),"hex"===e)return t(a,n="#"+n),void i.value(n);n={r:a.find("#r").value(),g:a.find("#g").value(),b:a.find("#b").value()},i.value(n),t(a,n)}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+a.toJSON().hex)}});t(a,l)};e.add("colorpicker",function(e){e.settings.color_picker_callback||(e.settings.color_picker_callback=function(n,i){l(e,n,i)})})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/save/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},o=function(n){return!!n.getParam("save_onsavecallback")},c=function(n){return!!n.getParam("save_oncancelcallback")},i=function(n,e){n.notificationManager.open({text:n.translate(e),type:"error"})},r=function(n){var t;if(t=e.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),o(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();t?(n.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():i(n,"Error: Form submit field collision.")),n.nodeChanged()):i(n,"Error: No form element found.")}},l=function(n){var e=t.trim(n.startContent);c(n)?n.execCallback("save_oncancelcallback",n):(n.setContent(e),n.undoManager.clear(),n.nodeChanged())},d=function(n){n.addCommand("mceSave",function(){r(n)}),n.addCommand("mceCancel",function(){l(n)})},s=function(n){return function(e){var t=e.control;n.on("nodeChange dirty",function(){t.disabled(a(n)&&!n.isDirty())})}},u=function(n){n.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:s(n)}),n.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:s(n)}),n.addShortcut("Meta+S","","mceSave")};n.add("save",function(n){u(n),d(n)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/anchor/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},n=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},o=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},r=function(t){var r=n(t);t.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:r},onsubmit:function(n){var r,a,i=n.data.id;r=t,(e(a=i)?(o(r,a),0):(r.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&n.preventDefault()}})},a=function(t){t.addCommand("mceAnchor",function(){r(t)})},i=function(t){return function(e){for(var n=0;n'},o=function(e){var a=n(e),r=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");e.on("BeforeSetContent",function(e){e.content=e.content.replace(r,c())}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(n){for(var r,c,o=n.length;o--;)if((c=(r=n[o]).attr("class"))&&-1!==c.indexOf("mce-pagebreak")){var i=r.parent;if(e.schema.getBlockElements()[i.name]&&t(e)){i.type=3,i.value=a,i.raw=!0,r.remove();continue}r.type=3,r.value=a,r.raw=!0}})})},i=c,g=r,u=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("

"+i()+"

"):e.insertContent(i())})},m=function(e){e.on("ResolveName",function(a){"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,g())&&(a.name="pagebreak")})},s=function(e){e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"})};e.add("pagebreak",function(e){u(e),s(e),o(e),m(e)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/noneditable/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(t){return t.getParam("noneditable_editable_class","mceEditable")},a=function(t){var n=t.getParam("noneditable_regexp",[]);return n&&n.constructor===RegExp?[n]:n},i=function(t){return function(n){return-1!==(" "+n.attr("class")+" ").indexOf(t)}},o=function(t,n,e){return function(r){var a=arguments,i=a[a.length-2],o=i>0?n.charAt(i-1):"";if('"'===o)return r;if(">"===o){var c=n.lastIndexOf("<",i);if(-1!==c&&-1!==n.substring(c,i).indexOf('contenteditable="false"'))return r}return''+t.dom.encode("string"==typeof a[1]?a[1]:a[0])+""}},c=function(t){var c,l,u="contenteditable";c=" "+n.trim(r(t))+" ",l=" "+n.trim(e(t))+" ";var f=i(c),s=i(l),d=a(t);t.on("PreInit",function(){d.length>0&&t.on("BeforeSetContent",function(n){!function(t,n,r){var a=n.length,i=r.content;if("raw"!==r.format){for(;a--;)i=i.replace(n[a],o(t,i,e(t)));r.content=i}}(t,d,n)}),t.parser.addAttributeFilter("class",function(t){for(var n,e=t.length;e--;)n=t[e],f(n)?n.attr(u,"true"):s(n)&&n.attr(u,"false")}),t.serializer.addAttributeFilter(u,function(t){for(var n,e=t.length;e--;)n=t[e],(f(n)||s(n))&&(d.length>0&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(u,null))})})};t.add("noneditable",function(t){c(t)})}(); -------------------------------------------------------------------------------- /router/user/userRouter.js: -------------------------------------------------------------------------------- 1 | const express = require("express") 2 | const router = express.Router() 3 | // 验证插件 4 | const { check } = require("express-validator") 5 | 6 | // 导入控制器 7 | const userController = reqlib("/controllers/userController.js") 8 | 9 | // 错误信息提示中间件 10 | const { errorMsg } = reqlib("/utils/message") 11 | // 导入文件上传组件 12 | const upload = reqlib("/utils/uploads.js").upload.single("userPic") 13 | // 文件上传类型验证 14 | const typeCheck = (req, res, next) => { 15 | upload(req, res, err => { 16 | if (err) { 17 | res.status(400).send({ 18 | code: 400, 19 | msg: "文件类型不对哦,请检查" 20 | }) 21 | } else { 22 | next() 23 | } 24 | }) 25 | } 26 | 27 | // 用户登录 28 | router.post( 29 | "/login", 30 | [ 31 | check("username") 32 | .not() 33 | .isEmpty(), 34 | check("password") 35 | .not() 36 | .isEmpty() 37 | ], 38 | errorMsg, 39 | userController.login 40 | ) 41 | 42 | // 用户登出 43 | router.post("/logout", userController.logout) 44 | // 获取用户信息 45 | router.get("/info", userController.info) 46 | // 获取用户详情 47 | router.get("/detail", userController.detail) 48 | // 编辑用户详情 49 | router.post( 50 | "/edit", 51 | typeCheck, 52 | [ 53 | check("username") 54 | .not() 55 | .isEmpty(), 56 | check("nickname") 57 | .not() 58 | .isEmpty(), 59 | check("email") 60 | .not() 61 | .isEmpty() 62 | .isEmail(), 63 | check("password") 64 | .not() 65 | .isEmpty() 66 | ], 67 | errorMsg, 68 | 69 | userController.edit 70 | ) 71 | 72 | module.exports = router 73 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),n=tinymce.util.Tools.resolve("tinymce.EditorManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Delay"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=tinymce.util.Tools.resolve("tinymce.util.VK"),r={getTabFocus:function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))}},c=t.DOM,s=function(e){e.keyCode!==u.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},a=function(e){function t(t){var s,a,y,f;if(!(t.keyCode!==u.TAB||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())&&(1===(y=l.explode(r.getTabFocus(e))).length&&(y[1]=y[0],y[0]=":prev"),a=t.shiftKey?":prev"===y[0]?m(-1):c.get(y[0]):":next"===y[1]?m(1):c.get(y[1]))){var d=n.get(a.id||a.name);a.id&&d?d.focus():o.setTimeout(function(){i.webkit||window.focus(),a.focus()},10),t.preventDefault()}function m(i){function o(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&n.get(t.id)&&-1!==e.tabIndex&&function i(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&i(e.parentNode)}(e)}if(a=c.select(":input:enabled,*[tabindex]:not(iframe)"),l.each(a,function(t,n){if(t.id===e.id)return s=n,!1}),i>0){for(f=s+1;f=0;f--)if(o(a[f]))return a[f];return null}}e.on("init",function(){e.inline&&c.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",s),i.gecko?e.on("keypress keydown",t):e.on("keydown",t)})};e.add("tabfocus",function(e){a(e)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e=function(t){var n=t,o=function(){return n};return{get:o,set:function(e){n=e},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e,t){e.fire("VisualBlocks",{state:t})},o=function(e){return e.getParam("visualblocks_default_state",!1)},s=function(e){return e.settings.visualblocks_content_css},i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=i.DOM.uniqueId(),u=function(e,t){var n=c.toArray(e.getElementsByTagName("link"));if(0===c.grep(n,function(e){return e.id===l}).length){var o=i.DOM.create("link",{id:l,rel:"stylesheet",href:t});e.getElementsByTagName("head")[0].appendChild(o)}},a=function(e,t,o){var i=e.dom,c=s(e);u(e.getDoc(),c||t+"/css/visualblocks.css"),i.toggleClass(e.getBody(),"mce-visualblocks"),o.set(!o.get()),n(e,o.get())},r=function(e,t,n){e.addCommand("mceVisualBlocks",function(){a(e,t,n)})},m=function(e,t,n){e.on("PreviewFormats AfterPreviewFormats",function(t){n.get()&&e.dom.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),e.on("init",function(){o(e)&&a(e,t,n)}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")})},f=function(e,t){return function(n){var o=n.control;o.active(t.get()),e.on("VisualBlocks",function(e){o.active(e.state)})}},d=function(e,t){e.addButton("visualblocks",{active:!1,title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:f(e,t)}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:f(e,t),selectable:!0,context:"view",prependToContext:!0})};t.add("visualblocks",function(t,n){var o=e(!1);r(t,n,o),d(t,o),m(t,n,o)})}(); -------------------------------------------------------------------------------- /reset/index.js: -------------------------------------------------------------------------------- 1 | // 数据库 2 | const db = require("../db") 3 | // 导入mock 4 | const articleData = require("./resetData/article.json") 5 | const categoryData = require("./resetData/category.json") 6 | const userData = require("./resetData/user.json") 7 | // 导入fs 8 | const fs = require('fs') 9 | // 导入path 10 | const path = require('path') 11 | 12 | // 生成随机数据 13 | const Mock = require("mockjs") 14 | const Random = Mock.Random 15 | 16 | // 随机数据的方法 17 | function randomData(num) { 18 | return Mock.mock({ 19 | [`Comment|${num}`]: [ 20 | { 21 | "id|+1": 1, 22 | // 随机的作者名 23 | author: "@cname", 24 | // 内容 25 | content: "@csentence(8,32)", 26 | date: "@now('year','yyyy')-@natural(1,7)-@datetime('dd')", 27 | time:'@time', 28 | articleId:"@natural(1,220)", 29 | "state|1":["已通过","待审核","已拒绝"] 30 | } 31 | ] 32 | }) 33 | } 34 | 35 | 36 | // 生成随机的访问量 37 | articleData.forEach(v=>{ 38 | v.read = parseInt(Math.random()*1000) 39 | }) 40 | db.sequelize.sync({ force: true }).then(async () => { 41 | try { 42 | await db.Category.bulkCreate(categoryData) 43 | await db.Article.bulkCreate(articleData) 44 | await db.Comment.bulkCreate(randomData(8000).Comment) 45 | // // console.log( randomData(10000).Comment.length) 46 | await db.User.create(userData) 47 | // 不存在文件夹就新建 48 | if(!fs.existsSync('./uploads')){ 49 | fs.mkdirSync('./uploads') 50 | } 51 | fs.copyFileSync(path.join(__dirname,'./static/icon.jpg'),path.join(__dirname,'../uploads/icon.jpg')) 52 | // 移动图片 53 | setTimeout(() => { 54 | // console.log('搞定') 55 | }, 0); 56 | } catch (error) { 57 | // console.log(error) 58 | } 59 | // // console.log(res); 60 | }) 61 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=function(n){var e=n,o=function(){return e};return{get:o,set:function(t){e=t},clone:function(){return t(o())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){return{isContextMenuVisible:function(){return t.get()}}},o=function(t){return t.settings.contextmenu_never_use_native},i=function(t){return t.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),u=function(t){return r.DOM.select(t.settings.ui_container)[0]},c=function(t,n){return{x:t,y:n}},l=function(t,n,e){return c(t.x+n,t.y+e)},s=function(t,n){if(t&&"static"!==r.DOM.getStyle(t,"position",!0)){var e=r.DOM.getPos(t),o=e.x-t.scrollLeft,i=e.y-t.scrollTop;return l(n,-o,-i)}return l(n,0,0)},a=function(t,n){if(t.inline)return s(u(t),c((f=n).pageX,f.pageY));var e,o,i,a,f,m=(e=t.getContentAreaContainer(),o=c((a=n).clientX,a.clientY),i=r.DOM.getPos(e),l(o,i.x,i.y));return s(u(t),m)},f=tinymce.util.Tools.resolve("tinymce.ui.Factory"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,n,e,o){null===o.get()?o.set(function(t,n){var e,o,r=[];o=i(t),m.each(o.split(/[ ,]/),function(n){var e=t.menuItems[n];"|"===n&&(e={text:n}),e&&(e.shortcut="",r.push(e))});for(var c=0;c',i&&(t+='"),r.each(e.contentCSS,function(i){t+=''});var c=e.settings.body_id||"tinymce";-1!==c.indexOf("=")&&(c=(c=e.getParam("body_id","","hash"))[e.id]||c);var a=e.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=e.getParam("body_class","","hash"))[e.id]||"");var s=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";return""+t+'"+e.getContent()+' 70 | 71 | 72 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /controllers/commentController.js: -------------------------------------------------------------------------------- 1 | const { Comment, Article } = require("../db"); 2 | 3 | // 服务器内部错误 4 | const serverError = res => { 5 | res.send({ 6 | code: 500, 7 | msg: "服务器内部错误" 8 | }); 9 | }; 10 | 11 | module.exports = { 12 | // 评论审核通过 13 | async pass(req, res) { 14 | // 获取id 15 | const { id } = req.body; 16 | try { 17 | // 查询数据 18 | const commentRes = await Comment.findOne({ 19 | where: { 20 | id 21 | } 22 | }); 23 | // id判断 24 | if (!commentRes) { 25 | res.send({ 26 | code: 400, 27 | msg: "id有误,请检查" 28 | }); 29 | } 30 | // 修改评论状态 31 | const updateRes = await Comment.update( 32 | { 33 | state: "已通过" 34 | }, 35 | { 36 | where: { 37 | id 38 | } 39 | } 40 | ); 41 | if (updateRes[0] == 1) { 42 | res.send({ 43 | msg: "已通过", 44 | code: 200 45 | }); 46 | } else { 47 | res.send({ 48 | msg: "已批准,不要重复操作", 49 | code: 400 50 | }); 51 | } 52 | } catch (error) { 53 | serverError(res); 54 | } 55 | }, 56 | // 评论审核不通过 57 | async reject(req, res) { 58 | // 获取id 59 | const { id } = req.body; 60 | try { 61 | // 查询数据 62 | const commentRes = await Comment.findOne({ 63 | where: { 64 | id 65 | } 66 | }); 67 | // id判断 68 | if (!commentRes) { 69 | res.send({ 70 | code: 400, 71 | msg: "id有误,请检查" 72 | }); 73 | } 74 | // 修改评论状态 75 | const updateRes = await Comment.update( 76 | { 77 | state: "已拒绝" 78 | }, 79 | { 80 | where: { 81 | id 82 | } 83 | } 84 | ); 85 | if (updateRes[0] == 1) { 86 | res.send({ 87 | msg: "已拒绝", 88 | code: 200 89 | }); 90 | } else { 91 | res.send({ 92 | msg: "已拒绝,不要重复操作", 93 | code: 400 94 | }); 95 | } 96 | } catch (error) { 97 | serverError(res); 98 | } 99 | }, 100 | // 删除评论 101 | async _delete(req, res) { 102 | // 获取id 103 | const { id } = req.body; 104 | try { 105 | // 查询数据 106 | const commentRes = await Comment.findOne({ 107 | where: { 108 | id 109 | } 110 | }); 111 | // id判断 112 | if (!commentRes) { 113 | res.send({ 114 | code: 400, 115 | msg: "id有误,请检查" 116 | }); 117 | } 118 | // 修改评论状态 119 | const destroyRes = await Comment.destroy({ 120 | where: { 121 | id 122 | } 123 | }); 124 | res.send({ 125 | msg: "已删除", 126 | code: 200 127 | }); 128 | } catch (error) { 129 | serverError(res); 130 | } 131 | }, 132 | // 搜索评论 133 | async search(req, res) { 134 | // 获取页码和页容量 135 | let { page, perpage } = req.query; 136 | try { 137 | if (!page) { 138 | page = 1; 139 | } 140 | if (!perpage) { 141 | perpage = 6; 142 | } 143 | // 分页数据判断 144 | page = parseInt(page); 145 | perpage = parseInt(perpage); 146 | if (typeof page != "number" || typeof perpage != "number") { 147 | return res.send({ 148 | code: 400, 149 | msg: "页码,或者页容量类型错误" 150 | }); 151 | } 152 | // 数据查询 153 | // 计算跳过的页码 154 | const offset = (page - 1) * perpage; 155 | // 查询条件 156 | let where = {}; 157 | // 查询 158 | // 分页查询 159 | let pageArticleRes = await Comment.findAll({ 160 | // 分页 161 | limit: perpage, 162 | // 跳过页码 163 | offset, 164 | // 连表 165 | include: [ 166 | { 167 | model: Article, 168 | require: true 169 | } 170 | ], 171 | order: [ 172 | // 根据id倒序 173 | ["id", "DESC"] 174 | ] 175 | }); 176 | // 总页数 177 | let totalArticleRes = await Comment.findAll({ 178 | // 模糊查询 179 | where 180 | }); 181 | pageArticleRes = JSON.parse(JSON.stringify(pageArticleRes)); 182 | pageArticleRes.forEach(v => { 183 | v.title = v.article.title 184 | delete v.article 185 | }); 186 | res.send({ 187 | code: 200, 188 | msg: "数据获取成功", 189 | data: { 190 | totalCount: totalArticleRes.length, 191 | totalPage: Math.ceil(totalArticleRes.length / perpage), 192 | data: pageArticleRes 193 | } 194 | }); 195 | } catch (error) { 196 | serverError(res); 197 | } 198 | } 199 | }; 200 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/textcolor/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t,e){var o;return t.dom.getParents(t.selection.getStart(),function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(o=r)}),o},o=function(t){var e,o=[];for(e=0;e
'+(o?"×":"")+"
"};for((a=o(r)).push({text:h.translate("No color"),color:"transparent"}),i='',u=a.length-1,s=0;s",m=0;mu?"":F((c=a[d]).color,c.text);i+=""}if(n){for(i+='",i+="",m=0;m0&&(r=s.create("div",null)).appendChild(l[0].cloneNode(!0)),a.each(s.select("*",r),function(t){_(t,c(e).replace(/\s+/g,"|"))&&(t.innerHTML=y(e,m(e))),_(t,o(e).replace(/\s+/g,"|"))&&(t.innerHTML=y(e,d(e))),_(t,i(e).replace(/\s+/g,"|"))&&(t.innerHTML=p)}),M(e,r),e.execCommand("mceInsertContent",!1,r.innerHTML),e.addVisual()},S=function(e){e.addCommand("mceInsertTemplate",n(P,e))},w=function(e){e.on("PreProcess",function(t){var n=e.dom,r=d(e);a.each(n.select("div",t.node),function(t){n.hasClass(t,"mceTmpl")&&(a.each(n.select("*",t),function(t){n.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=y(e,r))}),x(e,t))})})},D=function(e,t,n){if(-1===n.indexOf("")){var r="";a.each(e.contentCSS,function(t){r+=''});var l=e.settings.body_class||"";-1!==l.indexOf("=")&&(l=(l=e.getParam("body_class","","hash"))[e.id]||""),n=""+r+''+n+""}n=T(e,n,s(e));var c=t.find("iframe")[0].getEl().contentWindow.document;c.open(),c.write(n),c.close()},H=function(e,t){var n,l,c=[];if(t&&0!==t.length)a.each(t,function(e){c.push({selected:!c.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),(n=e.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:c,onselect:function(t){var a=t.control.value();a.url?r.send({url:a.url,success:function(t){D(e,n,l=t)}}):(l=a.content,D(e,n,l)),n.find("#description")[0].text(t.control.value().description)}}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){P(e,!1,l)},minWidth:f(e),minHeight:g(e)})).find("listbox")[0].fire("select");else{var o=e.translate("No templates defined.");e.notificationManager.open({text:o,type:"info"})}},C=function(e){return function(t){H(e,t)}},A=function(e){e.addButton("template",{title:"Insert template",onclick:b(e.settings,C(e))}),e.addMenuItem("template",{text:"Template",onclick:b(e.settings,C(e)),icon:"template",context:"insert"})};e.add("template",function(e){A(e),S(e),w(e)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/visualchars/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var n,e,t,r,o=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return o(t())}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){return{isEnabled:function(){return n.get()}}},c=function(n,e){return n.fire("VisualChars",{state:e})},a={"\xa0":"nbsp","\xad":"shy"},f=function(n,e){var t,r="";for(t in n)r+=t;return new RegExp("["+r+"]",e?"g":"")},l=function(n){var e,t="";for(e in n)t&&(t+=","),t+="span.mce-"+n[e];return t},s={charMap:a,regExp:f(a),regExpGlobal:f(a,!0),selector:l(a),charMapToRegExp:f,charMapToSelector:l},d=function(n){return function(){return n}},m={noop:function(){},noarg:function(n){return function(){return n()}},compose:function(n,e){return function(){return n(e.apply(null,arguments))}},constant:d,identity:function(n){return n},tripleEquals:function(n,e){return n===e},curry:function(n){for(var e=new Array(arguments.length-1),t=1;t1)throw console.error("HTML does not have a single root node",n),"HTML must have a single root node";return k(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return k(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return k(t)},fromDom:k,fromPoint:function(n,e,t){return T.from(n.dom().elementFromPoint(e,t)).map(k)}},C=8,M=9,D=3,O=function(n){return n.dom().nodeName.toLowerCase()},A=function(n){return n.dom().nodeType},S=function(n){return function(e){return A(e)===n}},B=S(1),P=S(D),V=S(M),q={name:O,type:A,value:function(n){return n.dom().nodeValue},isElement:B,isText:P,isDocument:V,isComment:function(n){return A(n)===C||"#comment"===O(n)}},H=function(n){return''+n+""},L=function(n,e){var t=[],r=n.dom(),o=E(r.childNodes,N.fromDom);return b(o,function(n){e(n)&&(t=t.concat([n])),t=t.concat(L(n,e))}),t},R={isMatch:function(n){return q.isText(n)&&q.value(n)!==undefined&&s.regExp.test(q.value(n))},filterDescendants:L,findParentElm:function(n,e){for(;n.parentNode;){if(n.parentNode===e)return n;n=n.parentNode}},replaceWithSpans:function(n){return n.replace(s.regExpGlobal,H)}},_=function(n,e){var t,r,o=R.filterDescendants(N.fromDom(e),R.isMatch);b(o,function(e){var o=R.replaceWithSpans(q.value(e));for(r=n.dom.create("div",null,o);t=r.lastChild;)n.dom.insertAfter(t,e.dom());n.dom.remove(e.dom())})},j=function(n,e){var t=n.dom.select(s.selector,e);b(t,function(e){n.dom.remove(e,1)})},z=_,G=j,W=function(n){var e=n.getBody(),t=n.selection.getBookmark(),r=R.findParentElm(n.selection.getNode(),e);r=r!==undefined?r:e,j(n,r),_(n,r),n.selection.moveToBookmark(t)},F=function(n,e){var t,r=n.getBody(),o=n.selection;e.set(!e.get()),c(n,e.get()),t=o.getBookmark(),!0===e.get()?z(n,r):G(n,r),o.moveToBookmark(t)},I=function(n,e){n.addCommand("mceVisualChars",function(){F(n,e)})},J=tinymce.util.Tools.resolve("tinymce.util.Delay"),K=function(n,e){var t=J.debounce(function(){W(n)},300);!1!==n.settings.forced_root_block&&n.on("keydown",function(r){!0===e.get()&&(13===r.keyCode?W(n):t())})},Q=function(n){return function(e){var t=e.control;n.on("VisualChars",function(n){t.active(n.state)})}};u.add("visualchars",function(n){var e,t=o(!1);return I(n,t),(e=n).addButton("visualchars",{active:!1,title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:Q(e)}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:Q(e),selectable:!0,context:"view",prependToContext:!0}),K(n,t),i(t)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/imageupload/plugin.min.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | tinymce.create("tinymce.plugins.ImageUploadPlugin", { 3 | init: function (e, t) { 4 | t = tinyMCE.activeEditor.getParam("imageupload_rel") || t; 5 | var n = tinyMCE.activeEditor.getParam("imageupload_url"); 6 | var r = document.getElementsByTagName("body")[0]; 7 | var i = document.createElement("link"); 8 | i.type = "text/css"; 9 | i.rel = "stylesheet"; 10 | i.href = t + "/css/style.css"; 11 | r.appendChild(i); 12 | var j = document.createElement("script"); 13 | j.src = t + "/jquery.iframe-post-form.js"; 14 | r.appendChild(j); 15 | e.addCommand("mceImageUpload", function () { 16 | $("#image_upload_type").val("tinymce"); 17 | $("body").append('
'); 18 | var t = function (e) { 19 | $(".imageUploadError").html(e).show(); 20 | r(); 21 | }; 22 | var r = function () { 23 | $(".imageUploadFg").remove(); 24 | $(".imageUploadFgLoading").remove() 25 | }; 26 | var i = function () { 27 | $(".imageUploadBg").remove(); 28 | $(".imageUploadContainer").remove() 29 | }; 30 | var s = '
上传图片

'; 31 | $("body").append(s); 32 | $(".imageUploadBg, .imageUploadContainer .imageUploadClose, .mce-close").on("click", function () { 33 | r(); 34 | i() 35 | }); 36 | $("#uploadImageForm").iframePostForm({ 37 | json: true, post: function () { 38 | }, complete: function (n) { 39 | if (typeof n != "object" || n == null || typeof n.error == "undefined") { 40 | r(); 41 | t("An error occurred while uploading your image.") 42 | } else { 43 | if (n.error != false) { 44 | switch (n.error) { 45 | case"filetype": 46 | t("Please select a valid image and try again."); 47 | break; 48 | default: 49 | t("An unknown error occurred."); 50 | break 51 | } 52 | } else { 53 | if (typeof n.path != "undefined") { 54 | var s = ''; 55 | e.insertContent(s.replace("%s", n.path)); 56 | e.focus(); 57 | r(); 58 | i() 59 | } else { 60 | t("An unknown error occurred.") 61 | } 62 | } 63 | } 64 | } 65 | }); 66 | $(".imageUploadSubmit").on("click", function () { 67 | $(".imageUploadError").html("").hide(); 68 | if ($("#image-upload-area").val() != "") { 69 | $("body").append('
'); 70 | $("body").append('
'); 71 | $("#uploadImageForm").submit() 72 | } else { 73 | t("Please select an image to upload.") 74 | } 75 | }) 76 | }); 77 | e.addButton("imageupload", {title: "Image Upload", cmd: "mceImageUpload", image: t + "/img/icon.png"}) 78 | }, getInfo: function () { 79 | return { 80 | longname: "Image Upload", 81 | author: "BoxUK", 82 | authorurl: "https://github.com/boxuk/tinymce-imageupload", 83 | infourl: "https://github.com/boxuk/tinymce-imageupload/blob/master/README.md", 84 | version: "1.0.0" 85 | } 86 | } 87 | }); 88 | tinymce.PluginManager.add("imageupload", tinymce.plugins.ImageUploadPlugin) 89 | })(); 90 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css: -------------------------------------------------------------------------------- 1 | .mce-visualblocks p { 2 | padding-top: 10px; 3 | border: 1px dashed #BBB; 4 | margin-left: 3px; 5 | background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); 6 | background-repeat: no-repeat; 7 | } 8 | 9 | .mce-visualblocks h1 { 10 | padding-top: 10px; 11 | border: 1px dashed #BBB; 12 | margin-left: 3px; 13 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); 14 | background-repeat: no-repeat; 15 | } 16 | 17 | .mce-visualblocks h2 { 18 | padding-top: 10px; 19 | border: 1px dashed #BBB; 20 | margin-left: 3px; 21 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); 22 | background-repeat: no-repeat; 23 | } 24 | 25 | .mce-visualblocks h3 { 26 | padding-top: 10px; 27 | border: 1px dashed #BBB; 28 | margin-left: 3px; 29 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); 30 | background-repeat: no-repeat; 31 | } 32 | 33 | .mce-visualblocks h4 { 34 | padding-top: 10px; 35 | border: 1px dashed #BBB; 36 | margin-left: 3px; 37 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); 38 | background-repeat: no-repeat; 39 | } 40 | 41 | .mce-visualblocks h5 { 42 | padding-top: 10px; 43 | border: 1px dashed #BBB; 44 | margin-left: 3px; 45 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); 46 | background-repeat: no-repeat; 47 | } 48 | 49 | .mce-visualblocks h6 { 50 | padding-top: 10px; 51 | border: 1px dashed #BBB; 52 | margin-left: 3px; 53 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); 54 | background-repeat: no-repeat; 55 | } 56 | 57 | .mce-visualblocks div:not([data-mce-bogus]) { 58 | padding-top: 10px; 59 | border: 1px dashed #BBB; 60 | margin-left: 3px; 61 | background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); 62 | background-repeat: no-repeat; 63 | } 64 | 65 | .mce-visualblocks section { 66 | padding-top: 10px; 67 | border: 1px dashed #BBB; 68 | margin: 0 0 1em 3px; 69 | background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); 70 | background-repeat: no-repeat; 71 | } 72 | 73 | .mce-visualblocks article { 74 | padding-top: 10px; 75 | border: 1px dashed #BBB; 76 | margin: 0 0 1em 3px; 77 | background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); 78 | background-repeat: no-repeat; 79 | } 80 | 81 | .mce-visualblocks blockquote { 82 | padding-top: 10px; 83 | border: 1px dashed #BBB; 84 | background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); 85 | background-repeat: no-repeat; 86 | } 87 | 88 | .mce-visualblocks address { 89 | padding-top: 10px; 90 | border: 1px dashed #BBB; 91 | margin: 0 0 1em 3px; 92 | background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); 93 | background-repeat: no-repeat; 94 | } 95 | 96 | .mce-visualblocks pre { 97 | padding-top: 10px; 98 | border: 1px dashed #BBB; 99 | margin-left: 3px; 100 | background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); 101 | background-repeat: no-repeat; 102 | } 103 | 104 | .mce-visualblocks figure { 105 | padding-top: 10px; 106 | border: 1px dashed #BBB; 107 | margin: 0 0 1em 3px; 108 | background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); 109 | background-repeat: no-repeat; 110 | } 111 | 112 | .mce-visualblocks hgroup { 113 | padding-top: 10px; 114 | border: 1px dashed #BBB; 115 | margin: 0 0 1em 3px; 116 | background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); 117 | background-repeat: no-repeat; 118 | } 119 | 120 | .mce-visualblocks aside { 121 | padding-top: 10px; 122 | border: 1px dashed #BBB; 123 | margin: 0 0 1em 3px; 124 | background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); 125 | background-repeat: no-repeat; 126 | } 127 | 128 | .mce-visualblocks figcaption { 129 | border: 1px dashed #BBB; 130 | } 131 | 132 | .mce-visualblocks ul { 133 | padding-top: 10px; 134 | border: 1px dashed #BBB; 135 | margin: 0 0 1em 3px; 136 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); 137 | background-repeat: no-repeat; 138 | } 139 | 140 | .mce-visualblocks ol { 141 | padding-top: 10px; 142 | border: 1px dashed #BBB; 143 | margin: 0 0 1em 3px; 144 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); 145 | background-repeat: no-repeat; 146 | } 147 | 148 | .mce-visualblocks dl { 149 | padding-top: 10px; 150 | border: 1px dashed #BBB; 151 | margin: 0 0 1em 3px; 152 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); 153 | background-repeat: no-repeat; 154 | } 155 | -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/fullpage/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e=function(t){var n=t,l=function(){return n};return{get:l,set:function(e){n=e},clone:function(){return e(l())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=tinymce.util.Tools.resolve("tinymce.html.DomParser"),i=tinymce.util.Tools.resolve("tinymce.html.Node"),r=tinymce.util.Tools.resolve("tinymce.html.Serializer"),o=function(e){return e.getParam("fullpage_hide_in_source_view")},a=function(e){return e.getParam("fullpage_default_xml_pi")},c=function(e){return e.getParam("fullpage_default_encoding")},s=function(e){return e.getParam("fullpage_default_font_family")},u=function(e){return e.getParam("fullpage_default_font_size")},d=function(e){return e.getParam("fullpage_default_text_color")},f=function(e){return e.getParam("fullpage_default_title")},g=function(e){return e.getParam("fullpage_default_doctype","")},m=function(e){return l({validate:!1,root_name:"#document"}).parse(e)},h=m,p=function(e,t){var l,i,r=m(t),o={};function a(e,t){return e.attr(t)||""}return o.fontface=s(e),o.fontsize=u(e),7===(l=r.firstChild).type&&(o.xml_pi=!0,(i=/encoding="([^"]+)"/.exec(l.value))&&(o.docencoding=i[1])),(l=r.getAll("#doctype")[0])&&(o.doctype=""),(l=r.getAll("title")[0])&&l.firstChild&&(o.title=l.firstChild.value),n.each(r.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?o[n.toLowerCase()]=e.attr("content"):"Content-Type"===l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(o.docencoding=t[1])}),(l=r.getAll("html")[0])&&(o.langcode=a(l,"lang")||a(l,"xml:lang")),o.stylesheets=[],n.each(r.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&o.stylesheets.push(e.attr("href"))}),(l=r.getAll("body")[0])&&(o.langdir=a(l,"dir"),o.style=a(l,"style"),o.visited_color=a(l,"vlink"),o.link_color=a(l,"link"),o.active_color=a(l,"alink")),o},y=function(e,t,l){var o,a,c,s,u,d=e.dom;function f(e,t,n){e.attr(t,n||undefined)}function g(e){a.firstChild?a.insert(e,a.firstChild):a.append(e)}o=m(l),(a=o.getAll("head")[0])||(s=o.getAll("html")[0],a=new i("head",1),s.firstChild?s.insert(a,s.firstChild,!0):s.append(a)),s=o.firstChild,t.xml_pi?(u='version="1.0"',t.docencoding&&(u+=' encoding="'+t.docencoding+'"'),7!==s.type&&(s=new i("xml",7),o.insert(s,o.firstChild,!0)),s.value=u):s&&7===s.type&&s.remove(),s=o.getAll("#doctype")[0],t.doctype?(s||(s=new i("#doctype",10),t.xml_pi?o.insert(s,o.firstChild):g(s)),s.value=t.doctype.substring(9,t.doctype.length-1)):s&&s.remove(),s=null,n.each(o.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(s=e)}),t.docencoding?(s||((s=new i("meta",1)).attr("http-equiv","Content-Type"),s.shortEnded=!0,g(s)),s.attr("content","text/html; charset="+t.docencoding)):s&&s.remove(),s=o.getAll("title")[0],t.title?(s?s.empty():g(s=new i("title",1)),s.append(new i("#text",3)).value=t.title):s&&s.remove(),n.each("keywords,description,author,copyright,robots".split(","),function(e){var n,l,r=o.getAll("meta"),a=t[e];for(n=0;n"))},v=function(e,t){var l=p(e,t.get());e.windowManager.open({title:"Document properties",data:l,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(i){var r=y(e,n.extend(l,i.data),t.get());t.set(r)}})},_=function(e,t){e.addCommand("mceFullPageProperties",function(){v(e,t)})},b=function(e,t){return n.each(e,function(e){t=t.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),t},x=function(e){return e.replace(//g,function(e,t){return unescape(t)})},k=n.each,C=function(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})},A=function(e){var t,n="",l="";if(a(e)){var i=c(e);n+='\n'}return n+=g(e),n+="\n\n\n",(t=f(e))&&(n+=""+t+"\n"),(t=c(e))&&(n+='\n'),(t=s(e))&&(l+="font-family: "+t+";"),(t=u(e))&&(l+="font-size: "+t+";"),(t=d(e))&&(l+="color: "+t+";"),n+="\n\n"},w=function(e,t,l){e.on("BeforeSetContent",function(i){!function(e,t,l,i){var r,a,c,s,u,d="",f=e.dom;if(!(i.selection||(c=b(e.settings.protect,i.content),"raw"===i.format&&t.get()||i.source_view&&o(e)))){0!==c.length||i.source_view||(c=n.trim(t.get())+"\n"+n.trim(c)+"\n"+n.trim(l.get())),-1!==(r=(c=c.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",r),t.set(C(c.substring(0,r+1))),-1===(a=c.indexOf("\n")),s=h(t.get()),k(s.getAll("style"),function(e){e.firstChild&&(d+=e.firstChild.value)}),(u=s.getAll("body")[0])&&f.setAttribs(e.getBody(),{style:u.attr("style")||"",dir:u.attr("dir")||"",vLink:u.attr("vlink")||"",link:u.attr("link")||"",aLink:u.attr("alink")||""}),f.remove("fullpage_styles");var g=e.getDoc().getElementsByTagName("head")[0];d&&(f.add(g,"style",{id:"fullpage_styles"},d),(u=f.get("fullpage_styles")).styleSheet&&(u.styleSheet.cssText=d));var m={};n.each(g.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(m[e.href]=e)}),n.each(s.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;m[t]||"stylesheet"!==e.attr("rel")||f.add(g,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete m[t]}),n.each(m,function(e){e.parentNode.removeChild(e)})}}(e,t,l,i)}),e.on("GetContent",function(i){var r,a,c,s;r=e,a=t.get(),c=l.get(),(s=i).selection||s.source_view&&o(r)||(s.content=x(n.trim(a)+"\n"+n.trim(s.content)+"\n"+n.trim(c)))})},P=function(e){e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"})};t.add("fullpage",function(t){var n=e(""),l=e("");_(t,n),P(t),w(t,n,l)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/searchreplace/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");function r(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var a={findAndReplaceDOMText:function(e,t,n,a,i){var o,d,c,l,s,u,f=[],p=0;function g(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(t>0){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(c=t.ownerDocument,l=i.getBlockElements(),s=i.getWhiteSpaceElements(),u=i.getShortEndedElements(),d=function h(e){var t;if(3===e.nodeType)return e.data;if(s[e.nodeName]&&!l[e.nodeName])return"";if(t="",r(e))return"\n";if((l[e.nodeName]||u[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=h(e),e=e.nextSibling;);return t}(t)){if(e.global)for(;o=e.exec(d);)f.push(g(o,a));else o=d.match(e),f.push(g(o,a));return f.length&&(p=f.length,function(e,t,n){var a,i,o,d,c=[],f=0,p=e,g=t.shift(),h=0;e:for(;;){if((l[p.nodeName]||u[p.nodeName]||r(p))&&f++,3===p.nodeType&&(!i&&p.length+f>=g[1]?(i=p,d=g[1]-f):a&&c.push(p),!a&&p.length+f>g[0]&&(a=p,o=g[0]-f),f+=p.length),a&&i){if(p=n({startNode:a,startNodeIndex:o,endNode:i,endNodeIndex:d,innerNodes:c,match:g[2],matchIndex:h}),f-=i.length-d,a=null,i=null,c=[],h++,!(g=t.shift()))break}else if(s[p.nodeName]&&!l[p.nodeName]||!p.firstChild){if(p.nextSibling){p=p.nextSibling;continue}}else if(!r(p)){p=p.firstChild;continue}for(;;){if(p.nextSibling){p=p.nextSibling;break}if(p.parentNode===e)break e;p=p.parentNode}}}(t,f,function(e){var t;if("function"!=typeof e){var n=e.nodeType?e:c.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(c.createTextNode(e)),r}}else t=e;return function(e){var n,r,a,i=e.startNode,o=e.endNode,d=e.matchIndex;if(i===o){var l=i;a=l.parentNode,e.startNodeIndex>0&&(n=c.createTextNode(l.data.substring(0,e.startNodeIndex)),a.insertBefore(n,l));var s=t(e.match[0],d);return a.insertBefore(s,l),e.endNodeIndex0},p=function(e,t,r){var a,d,c,l;for(d=n.toArray(e.getBody().getElementsByTagName("span")),a=0;a0},h=function(e,t){return d(e,t.get()-1).length>0},m={done:p,find:function(e,t,n,r,i){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"\\s"),n=i?"\\b"+n+"\\b":n;var o,d,l,s,u,f=(o=e,d=t,l=new RegExp(n,r?"g":"gi"),(u=o.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",s=o.getBody(),p(o,d,!1),a.findAndReplaceDOMText(l,s,u,!1,o.schema));return f&&(t.set(-1),t.set(c(e,t,!0))),f},next:s,prev:u,replace:function(e,t,r,a,d){var c,p,m,v,x,b,N=t.get();for(a=!1!==a,m=e.getBody(),p=n.grep(n.toArray(m.getElementsByTagName("span")),f),c=0;ct.get()&&p[c].setAttribute("data-mce-index",x-1)}return t.set(N),a?(b=g(e,t),s(e,t)):(b=h(e,t),u(e,t)),!d&&b},hasNext:g,hasPrev:h},v=function(e,t){return{done:function(n){return m.done(e,t,n)},find:function(n,r,a){return m.find(e,t,n,r,a)},next:function(){return m.next(e,t)},prev:function(){return m.prev(e,t)},replace:function(n,r,a){return m.replace(e,t,n,r,a)}}},x=function(e,t){var r,a={};function i(){d.statusbar.find("#next").disabled(!1===m.hasNext(e,t)),d.statusbar.find("#prev").disabled(!1===m.hasPrev(e,t))}function o(){e.windowManager.alert("Could not find the specified string.",function(){d.find("#find")[0].focus()})}e.undoManager.add(),r=n.trim(e.selection.getContent({format:"text"}));var d=e.windowManager.open({layout:"flex",pack:"center",align:"center",onClose:function(){e.focus(),m.done(e,t),e.undoManager.add()},onSubmit:function(n){var r,c,l,s;return n.preventDefault(),c=d.find("#case").checked(),s=d.find("#words").checked(),(l=d.find("#find").value()).length?a.text===l&&a.caseState===c&&a.wholeWord===s?m.hasNext(e,t)?(m.next(e,t),void i()):void o():((r=m.find(e,t,l,c,s))||o(),d.statusbar.items().slice(1).disabled(0===r),i(),void(a={text:l,caseState:c,wholeWord:s})):(m.done(e,t,!1),void d.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){d.submit()}},{text:"Replace",disabled:!0,onclick:function(){m.replace(e,t,d.find("#replace").value())||(d.statusbar.items().slice(1).disabled(!0),t.set(-1),a={})}},{text:"Replace all",disabled:!0,onclick:function(){m.replace(e,t,d.find("#replace").value(),!0,!0),d.statusbar.items().slice(1).disabled(!0),a={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){m.prev(e,t),i()}},{text:"Next",name:"next",disabled:!0,onclick:function(){m.next(e,t),i()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:r},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}})},b=function(e,t){e.addCommand("SearchReplace",function(){x(e,t)})},N=function(e,t){return function(){x(e,t)}},y=function(e,t){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:N(e,t),separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",onclick:N(e,t)}),e.shortcuts.add("Meta+F","",N(e,t))};t.add("searchreplace",function(t){var n=e(-1);return b(t,n),y(t,n),v(t,n)})}(); -------------------------------------------------------------------------------- /static/admin/js/tinymce/js/tinymce/plugins/imageupload/uncompressed/plugin.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | tinymce.create('tinymce.plugins.ImageUploadPlugin', { 3 | init : function(ed, url) { 4 | url = tinyMCE.activeEditor.getParam('imageupload_rel') || url; 5 | var imageUploadUrl = tinyMCE.activeEditor.getParam('imageupload_url'); 6 | var head = document.getElementsByTagName('body')[0]; 7 | var css = document.createElement('link'); 8 | css.type = 'text/css'; 9 | css.rel = 'stylesheet'; 10 | css.href = url + '/css/style.css'; 11 | head.appendChild(css); 12 | 13 | // Register commands 14 | ed.addCommand('mceImageUpload', function() { 15 | $('#image_upload_type').val('tinymce'); 16 | $('body').append('
'); 17 | 18 | var showImageUploadError = function(msg) { 19 | $('.imageUploadError').html(msg).show(); 20 | removeForeground(); 21 | }; 22 | 23 | var removeForeground = function() { 24 | $('.imageUploadFg').remove(); 25 | $('.imageUploadFgLoading').remove(); 26 | }; 27 | 28 | var removeBackground = function() { 29 | $('.imageUploadBg').remove(); 30 | $('.imageUploadContainer').remove(); 31 | }; 32 | 33 | var container = '\ 34 |
\ 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 | $('body').append(container); 62 | 63 | $('.imageUploadBg, .imageUploadContainer .imageUploadClose, .mce-close').on('click', function(){ 64 | removeForeground(); 65 | removeBackground(); 66 | }); 67 | 68 | $('#uploadImageForm').iframePostForm({ 69 | json: true, 70 | post: function(){ 71 | // Sending. 72 | }, 73 | complete: function(response){ 74 | 75 | if (typeof response != "object" || response == null || typeof response.error == 'undefined') { 76 | removeForeground(); 77 | showImageUploadError('An error occurred while uploading your image.'); 78 | } else { 79 | if (response.error != false) { 80 | switch (response.error) { 81 | case ("filetype"): 82 | showImageUploadError('Please select a valid image and try again.'); 83 | break; 84 | default: 85 | showImageUploadError('An unknown error occurred.'); 86 | break; 87 | } 88 | } else { 89 | if (typeof response.path != 'undefined') { 90 | var tpl = ''; 91 | ed.insertContent(tpl.replace('%s', response.path)); 92 | ed.focus(); 93 | removeForeground(); 94 | removeBackground(); 95 | } else { 96 | showImageUploadError('An unknown error occurred.'); 97 | } 98 | } 99 | } 100 | } 101 | }); 102 | 103 | $('.imageUploadSubmit').on('click', function(){ 104 | 105 | $('.imageUploadError').html('').hide(); 106 | 107 | if ($('#image-upload-area').val() != '') { 108 | $('body').append('
'); 109 | $('body').append('
'); 110 | $('#uploadImageForm').submit(); 111 | } else { 112 | showImageUploadError('Please select an image to upload.'); 113 | } 114 | 115 | }); 116 | }); 117 | 118 | // Register buttons 119 | ed.addButton('imageupload', { 120 | title : '上传图片', 121 | cmd : 'mceImageUpload', 122 | image : url + '/img/icon.png' 123 | }); 124 | }, 125 | 126 | getInfo : function() { 127 | return { 128 | longname : '上传图片', 129 | author : 'BoxUK', 130 | authorurl : 'https://github.com/boxuk/tinymce-imageupload', 131 | infourl : 'https://github.com/boxuk/tinymce-imageupload/blob/master/README.md', 132 | version : '1.0.0' 133 | }; 134 | } 135 | }); 136 | 137 | tinymce.PluginManager.add('imageupload', tinymce.plugins.ImageUploadPlugin); 138 | })(); 139 | -------------------------------------------------------------------------------- /static/admin/article_release.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 |
25 | 写文章 26 |
27 |
28 |
29 |
30 | 31 |
32 | 33 |
34 |
35 |
36 | 37 |
38 | 39 | 40 |
41 |
42 |
43 | 44 |
45 | 52 |
53 |
54 |
55 | 56 |
57 | 58 |
59 | 60 | 61 | 64 | 65 |
66 |
67 |
68 |
69 | 70 |
71 | 74 |
75 |
76 |
77 |
78 | 79 | 80 |
81 |
82 | 83 |
84 |
85 | 86 | 87 | 88 | 89 | 94 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /static/admin/article_edit.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 |
25 |
26 |
27 |
28 | 29 |
30 | 31 |
32 |
33 |
34 | 35 |
36 | 37 | 38 |
39 |
40 |
41 | 42 |
43 | 50 |
51 |
52 |
53 | 54 |
55 | 56 |
57 | 58 | 59 | 62 | 63 |
64 |
65 |
66 |
67 | 68 |
69 | 70 |
71 |
72 |
73 |
74 | 75 |
76 |
77 | 78 |
79 |
80 | 81 | 82 | 83 | 84 | 89 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /static/admin/user.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 |
25 | 26 |
27 | 28 |
29 |
30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 | 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | 50 |
51 | 54 |
55 |
56 | 57 |
58 | 59 |
60 | 62 |
63 |
64 | 65 | 66 |
67 |
68 | 69 |
70 |
71 | 72 |
73 |
74 | 75 | 165 | 166 | 167 | --------------------------------------------------------------------------------