├── .env.example ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── app ├── Article.php ├── Category.php ├── Console │ ├── Commands │ │ └── Inspire.php │ └── Kernel.php ├── Events │ └── Event.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Admin │ │ │ ├── ArticleController.php │ │ │ ├── CategoryController.php │ │ │ ├── PaperController.php │ │ │ ├── QuestionController.php │ │ │ └── UserController.php │ │ ├── Auth │ │ │ ├── AuthController.php │ │ │ └── PasswordController.php │ │ ├── Controller.php │ │ └── HomeController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── ManageMiddleware.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── VerifyCsrfToken.php │ │ └── opFileMiddleware.php │ ├── Requests │ │ └── Request.php │ └── routes.php ├── Jobs │ └── Job.php ├── Listeners │ └── .gitkeep ├── Paper.php ├── Policies │ └── .gitkeep ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Question.php └── User.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── compile.php ├── database.php ├── debugbar.php ├── elfinder.php ├── excel.php ├── filesystems.php ├── ide-helper.php ├── laravel-backup.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2016_08_02_110546_create_articles_table.php │ ├── 2016_08_02_110553_create_categories_table.php │ ├── 2016_08_16_142058_create_questions_table.php │ ├── 2016_08_21_144951_create_papers_table.php │ ├── 2016_08_21_152436_create_paper_question_table.php │ ├── 2016_08_24_151849_create_user_paper_table.php │ └── 2016_08_26_100452_create_user_question_table.php └── seeds │ ├── .gitkeep │ ├── ArticlesSeeder.php │ ├── CategoriesSeeder.php │ ├── DatabaseSeeder.php │ ├── PapersSeeder.php │ ├── QuestionsSeeder.php │ └── UsersSeeder.php ├── gulpfile.js ├── npm-shrinkwrap.json ├── package.json ├── phpunit.xml ├── public ├── .gitignore ├── .htaccess ├── .tmb │ └── .gitignore ├── css │ ├── app.css │ ├── app.css.map │ ├── bootstrap-material-design.min.css │ ├── dataTables.bootstrap.css │ ├── flags16.css │ ├── images │ │ ├── ui-icons_444444_256x240.png │ │ ├── ui-icons_555555_256x240.png │ │ ├── ui-icons_777620_256x240.png │ │ ├── ui-icons_777777_256x240.png │ │ ├── ui-icons_cc0000_256x240.png │ │ └── ui-icons_ffffff_256x240.png │ ├── jquery-ui.min.css │ └── ripples.min.css ├── favicon.ico ├── fonts │ ├── FontAwesome.otf │ ├── bootstrap │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 ├── images │ ├── bg.jpg │ ├── dot.png │ ├── hfut.png │ ├── ii.png │ ├── logo.png │ ├── q1.jpg │ ├── q2.jpg │ ├── q3.jpg │ ├── q4.png │ ├── q5.png │ ├── q6.png │ ├── q7.png │ ├── q8.png │ ├── q9.png │ ├── w.png │ ├── w1.png │ └── w2.png ├── img │ ├── chemlab.png │ ├── gate.png │ ├── gate2.jpg │ ├── hfut.png │ ├── hfut_logo.png │ ├── scrollbar_arrow.png │ ├── 事故案例.png │ ├── 在线学习.png │ ├── 在线考试.png │ ├── 安全标识.png │ ├── 安全讲座.png │ └── 规章制度.png ├── index.php ├── js │ ├── app.js │ ├── app.js.map │ ├── app_config.js │ ├── app_config.js.map │ ├── dataTables.bootstrap.js │ ├── easing.js │ ├── jcarousellite.js │ ├── jquery-ui.min.js │ ├── jquery.dataTables.js │ ├── jquery.jcarousellite.min.js │ ├── jquery.min.js │ ├── material.min.js │ ├── ripples.min.js │ └── tinymce │ │ ├── jquery.tinymce.min.js │ │ ├── langs │ │ ├── readme.md │ │ └── zh_CN.js │ │ ├── license.txt │ │ ├── plugins │ │ ├── advlist │ │ │ └── plugin.min.js │ │ ├── anchor │ │ │ └── plugin.min.js │ │ ├── autolink │ │ │ └── plugin.min.js │ │ ├── autoresize │ │ │ └── plugin.min.js │ │ ├── autosave │ │ │ └── plugin.min.js │ │ ├── bbcode │ │ │ └── plugin.min.js │ │ ├── charmap │ │ │ └── plugin.min.js │ │ ├── code │ │ │ └── plugin.min.js │ │ ├── codesample │ │ │ ├── css │ │ │ │ └── prism.css │ │ │ └── plugin.min.js │ │ ├── colorpicker │ │ │ └── plugin.min.js │ │ ├── contextmenu │ │ │ └── plugin.min.js │ │ ├── directionality │ │ │ └── plugin.min.js │ │ ├── emoticons │ │ │ ├── img │ │ │ │ ├── smiley-cool.gif │ │ │ │ ├── smiley-cry.gif │ │ │ │ ├── smiley-embarassed.gif │ │ │ │ ├── smiley-foot-in-mouth.gif │ │ │ │ ├── smiley-frown.gif │ │ │ │ ├── smiley-innocent.gif │ │ │ │ ├── smiley-kiss.gif │ │ │ │ ├── smiley-laughing.gif │ │ │ │ ├── smiley-money-mouth.gif │ │ │ │ ├── smiley-sealed.gif │ │ │ │ ├── smiley-smile.gif │ │ │ │ ├── smiley-surprised.gif │ │ │ │ ├── smiley-tongue-out.gif │ │ │ │ ├── smiley-undecided.gif │ │ │ │ ├── smiley-wink.gif │ │ │ │ └── smiley-yell.gif │ │ │ └── plugin.min.js │ │ ├── example │ │ │ ├── dialog.html │ │ │ └── plugin.min.js │ │ ├── example_dependency │ │ │ └── plugin.min.js │ │ ├── fullpage │ │ │ └── plugin.min.js │ │ ├── fullscreen │ │ │ └── plugin.min.js │ │ ├── hr │ │ │ └── plugin.min.js │ │ ├── image │ │ │ └── plugin.min.js │ │ ├── imagetools │ │ │ └── plugin.min.js │ │ ├── importcss │ │ │ └── plugin.min.js │ │ ├── insertdatetime │ │ │ └── plugin.min.js │ │ ├── layer │ │ │ └── plugin.min.js │ │ ├── legacyoutput │ │ │ └── plugin.min.js │ │ ├── link │ │ │ └── plugin.min.js │ │ ├── lists │ │ │ └── plugin.min.js │ │ ├── media │ │ │ ├── moxieplayer.swf │ │ │ └── plugin.min.js │ │ ├── nonbreaking │ │ │ └── plugin.min.js │ │ ├── noneditable │ │ │ └── plugin.min.js │ │ ├── pagebreak │ │ │ └── plugin.min.js │ │ ├── paste │ │ │ └── plugin.min.js │ │ ├── preview │ │ │ └── plugin.min.js │ │ ├── print │ │ │ └── plugin.min.js │ │ ├── save │ │ │ └── plugin.min.js │ │ ├── searchreplace │ │ │ └── plugin.min.js │ │ ├── spellchecker │ │ │ └── plugin.min.js │ │ ├── tabfocus │ │ │ └── plugin.min.js │ │ ├── table │ │ │ └── plugin.min.js │ │ ├── template │ │ │ └── plugin.min.js │ │ ├── textcolor │ │ │ └── plugin.min.js │ │ ├── textpattern │ │ │ └── plugin.min.js │ │ ├── visualblocks │ │ │ ├── css │ │ │ │ └── visualblocks.css │ │ │ └── plugin.min.js │ │ ├── visualchars │ │ │ └── plugin.min.js │ │ └── wordcount │ │ │ └── plugin.min.js │ │ ├── skins │ │ └── lightgray │ │ │ ├── content.inline.min.css │ │ │ ├── content.min.css │ │ │ ├── fonts │ │ │ ├── tinymce-small.eot │ │ │ ├── tinymce-small.svg │ │ │ ├── tinymce-small.ttf │ │ │ ├── tinymce-small.woff │ │ │ ├── tinymce.eot │ │ │ ├── tinymce.svg │ │ │ ├── tinymce.ttf │ │ │ └── tinymce.woff │ │ │ ├── img │ │ │ ├── anchor.gif │ │ │ ├── loader.gif │ │ │ ├── object.gif │ │ │ └── trans.gif │ │ │ ├── skin.ie7.min.css │ │ │ └── skin.min.css │ │ ├── themes │ │ ├── inlite │ │ │ ├── config │ │ │ │ ├── bolt │ │ │ │ │ ├── atomic.js │ │ │ │ │ ├── bootstrap-atomic.js │ │ │ │ │ ├── bootstrap-browser.js │ │ │ │ │ ├── bootstrap-demo.js │ │ │ │ │ ├── bootstrap-prod.js │ │ │ │ │ ├── browser.js │ │ │ │ │ ├── demo.js │ │ │ │ │ └── prod.js │ │ │ │ └── dent │ │ │ │ │ └── depend.js │ │ │ ├── scratch │ │ │ │ ├── compile │ │ │ │ │ ├── bootstrap.js │ │ │ │ │ └── theme.js │ │ │ │ └── inline │ │ │ │ │ ├── theme.js │ │ │ │ │ └── theme.raw.js │ │ │ ├── src │ │ │ │ ├── demo │ │ │ │ │ ├── css │ │ │ │ │ │ └── demo.css │ │ │ │ │ ├── html │ │ │ │ │ │ └── demo.html │ │ │ │ │ └── js │ │ │ │ │ │ └── tinymce │ │ │ │ │ │ └── inlite │ │ │ │ │ │ └── Demo.js │ │ │ │ ├── main │ │ │ │ │ └── js │ │ │ │ │ │ └── tinymce │ │ │ │ │ │ └── inlite │ │ │ │ │ │ ├── Theme.js │ │ │ │ │ │ ├── alien │ │ │ │ │ │ ├── Arr.js │ │ │ │ │ │ ├── Bookmark.js │ │ │ │ │ │ ├── Unlink.js │ │ │ │ │ │ └── Uuid.js │ │ │ │ │ │ ├── core │ │ │ │ │ │ ├── Actions.js │ │ │ │ │ │ ├── Convert.js │ │ │ │ │ │ ├── ElementMatcher.js │ │ │ │ │ │ ├── Layout.js │ │ │ │ │ │ ├── Matcher.js │ │ │ │ │ │ ├── Measure.js │ │ │ │ │ │ ├── PredicateId.js │ │ │ │ │ │ ├── SelectionMatcher.js │ │ │ │ │ │ ├── SkinLoader.js │ │ │ │ │ │ └── UrlType.js │ │ │ │ │ │ ├── file │ │ │ │ │ │ ├── Conversions.js │ │ │ │ │ │ └── Picker.js │ │ │ │ │ │ └── ui │ │ │ │ │ │ ├── Buttons.js │ │ │ │ │ │ ├── Forms.js │ │ │ │ │ │ ├── Panel.js │ │ │ │ │ │ └── Toolbar.js │ │ │ │ └── test │ │ │ │ │ ├── .eslintrc │ │ │ │ │ └── js │ │ │ │ │ ├── atomic │ │ │ │ │ ├── alien │ │ │ │ │ │ ├── ArrTest.js │ │ │ │ │ │ └── UuidTest.js │ │ │ │ │ └── core │ │ │ │ │ │ ├── ConvertTest.js │ │ │ │ │ │ ├── MatcherTest.js │ │ │ │ │ │ └── UrlTypeTest.js │ │ │ │ │ └── browser │ │ │ │ │ ├── ThemeTest.js │ │ │ │ │ ├── alien │ │ │ │ │ ├── BookmarkTest.js │ │ │ │ │ └── UnlinkTest.js │ │ │ │ │ ├── core │ │ │ │ │ ├── ActionsTest.js │ │ │ │ │ ├── ElementMatcher.js │ │ │ │ │ ├── LayoutTest.js │ │ │ │ │ ├── MeasureTest.js │ │ │ │ │ ├── PredicateIdTest.js │ │ │ │ │ └── SelectionMatcherTest.js │ │ │ │ │ └── file │ │ │ │ │ ├── ConversionsTest.js │ │ │ │ │ └── SelectionMatcher.js │ │ │ └── theme.min.js │ │ └── modern │ │ │ └── theme.min.js │ │ └── tinymce.min.js ├── packages │ └── barryvdh │ │ └── elfinder │ │ ├── css │ │ ├── elfinder.full.css │ │ ├── elfinder.min.css │ │ └── theme.css │ │ ├── img │ │ ├── arrows-active.png │ │ ├── arrows-normal.png │ │ ├── crop.gif │ │ ├── dialogs.png │ │ ├── icons-big.png │ │ ├── icons-small.png │ │ ├── logo.png │ │ ├── progress.gif │ │ ├── quicklook-bg.png │ │ ├── quicklook-icons.png │ │ ├── resize.png │ │ ├── spinner-mini.gif │ │ ├── toolbar.png │ │ ├── volume_icon_dropbox.png │ │ ├── volume_icon_ftp.png │ │ ├── volume_icon_googledrive.png │ │ ├── volume_icon_local.png │ │ └── volume_icon_sql.png │ │ └── js │ │ ├── elfinder.full.js │ │ ├── elfinder.min.js │ │ ├── extras │ │ └── quicklook.googledocs.js │ │ ├── i18n │ │ ├── elfinder.LANG.js │ │ ├── elfinder.ar.js │ │ ├── elfinder.bg.js │ │ ├── elfinder.ca.js │ │ ├── elfinder.cs.js │ │ ├── elfinder.da.js │ │ ├── elfinder.de.js │ │ ├── elfinder.el.js │ │ ├── elfinder.es.js │ │ ├── elfinder.fa.js │ │ ├── elfinder.fo.js │ │ ├── elfinder.fr.js │ │ ├── elfinder.he.js │ │ ├── elfinder.hr.js │ │ ├── elfinder.hu.js │ │ ├── elfinder.id.js │ │ ├── elfinder.it.js │ │ ├── elfinder.jp.js │ │ ├── elfinder.ko.js │ │ ├── elfinder.nl.js │ │ ├── elfinder.no.js │ │ ├── elfinder.pl.js │ │ ├── elfinder.pt_BR.js │ │ ├── elfinder.ro.js │ │ ├── elfinder.ru.js │ │ ├── elfinder.sk.js │ │ ├── elfinder.sl.js │ │ ├── elfinder.sr.js │ │ ├── elfinder.sv.js │ │ ├── elfinder.tr.js │ │ ├── elfinder.ug_CN.js │ │ ├── elfinder.uk.js │ │ ├── elfinder.vi.js │ │ ├── elfinder.zh_CN.js │ │ └── elfinder.zh_TW.js │ │ ├── proxy │ │ └── elFinderSupportVer1.js │ │ ├── standalonepopup.js │ │ ├── standalonepopup.min.js │ │ └── tiny_mce_popup.js ├── robots.txt ├── style │ └── index.css ├── templates │ └── sb-admin-2 │ │ ├── bower_components │ │ ├── bootstrap │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ ├── flot.tooltip │ │ │ └── js │ │ │ │ ├── jquery.flot.tooltip.min.js │ │ │ │ └── jquery.flot.tooltip.source.js │ │ ├── flot │ │ │ ├── jquery.flot.js │ │ │ ├── jquery.flot.pie.js │ │ │ └── jquery.flot.resize.js │ │ ├── font-awesome │ │ │ ├── css │ │ │ │ ├── font-awesome.css │ │ │ │ └── font-awesome.min.css │ │ │ └── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ └── fontawesome-webfont.woff │ │ ├── jquery │ │ │ └── dist │ │ │ │ ├── jquery.js │ │ │ │ ├── jquery.min.js │ │ │ │ └── jquery.min.map │ │ ├── metisMenu │ │ │ └── dist │ │ │ │ ├── metisMenu.css │ │ │ │ ├── metisMenu.js │ │ │ │ ├── metisMenu.min.css │ │ │ │ └── metisMenu.min.js │ │ ├── morrisjs │ │ │ ├── morris.css │ │ │ └── morris.min.js │ │ └── raphael │ │ │ └── raphael-min.js │ │ └── dist │ │ ├── css │ │ ├── sb-admin-2.css │ │ └── timeline.css │ │ └── js │ │ └── sb-admin-2.js └── web.config ├── resources ├── assets │ ├── js │ │ ├── app.js │ │ └── app_config.js │ └── sass │ │ └── app.scss ├── lang │ ├── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php │ └── zh_CN │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── admin │ ├── articles │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── categories │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── papers │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── questions │ │ └── index.blade.php │ ├── resources.blade.php │ ├── scoreMgr │ │ ├── examinees.blade.php │ │ └── index.blade.php │ └── usersMgr │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── auth │ ├── emails │ │ └── password.blade.php │ ├── login.blade.php │ ├── passwords │ │ ├── email.blade.php │ │ └── reset.blade.php │ └── register.blade.php │ ├── categories │ └── index.blade.php │ ├── errors │ └── 503.blade.php │ ├── index.blade.php │ ├── layouts │ └── app.blade.php │ ├── main │ └── index.blade.php │ ├── paper │ ├── exam.blade.php │ └── index.blade.php │ ├── user │ └── changePwd.blade.php │ └── vendor │ ├── elfinder │ ├── .gitkeep │ ├── ckeditor4.php │ ├── elfinder.php │ ├── filepicker.php │ ├── standalonepopup.php │ ├── tinymce.php │ └── tinymce4.php │ └── laravel-log-viewer │ └── log.blade.php ├── server.php ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── ExampleTest.php └── TestCase.php /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_KEY=SomeRandomString 3 | APP_DEBUG=true 4 | APP_LOG_LEVEL=debug 5 | APP_URL=http://localhost 6 | 7 | DB_CONNECTION=mysql 8 | DB_HOST=127.0.0.1 9 | DB_PORT=3306 10 | DB_DATABASE=homestead 11 | DB_USERNAME=homestead 12 | DB_PASSWORD=secret 13 | 14 | CACHE_DRIVER=file 15 | SESSION_DRIVER=file 16 | QUEUE_DRIVER=sync 17 | 18 | REDIS_HOST=127.0.0.1 19 | REDIS_PASSWORD=null 20 | REDIS_PORT=6379 21 | 22 | MAIL_DRIVER=smtp 23 | MAIL_HOST=mailtrap.io 24 | MAIL_PORT=2525 25 | MAIL_USERNAME=null 26 | MAIL_PASSWORD=null 27 | MAIL_ENCRYPTION=null 28 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | *.html linguist-vendored 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | /public/storage 4 | Homestead.yaml 5 | Homestead.json 6 | .phpstorm.meta.php 7 | storage/debugbar/ 8 | /.idea 9 | .env 10 | _ide_*.php 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A Laravel application for HFUT Chemistry lab learning and exam system 2 | # Introduction 3 | **合肥工业大学化学实验室安全教育与考试系统**由化工系创新实验小组人员(Netcan全栈程序设计)开发,利用了全世界一流的`Laravel`框架,基于`MVC`设计模式,采用先进的`Google Material`设计,系统安全、可靠、稳定,操作流畅,用户体验良好。 4 | 5 | 目前系统已经制作完成,正在投入使用,效果达到预期要求。平台运行在Debian系统上,采用Laravel框架+MySQL数据库存储数据。 6 | 7 | 系统集题库管理、试卷管理、成绩管理、用户管理、资源管理于一身。 8 | 9 | 其中题库管理采用一张questions表存储题型、题目、选项、正确答案,题库管理控制器对questions表进行查询、修改、更新、删除等操作,题库管理视图对界面进行渲染。 10 | 11 | 试卷管理采用一张papers表存储试卷的名称、题型分值、开始以及结束时间,再采取papers_questions表对试卷、题库进行关联,用于存储一张试卷上包含哪些题目,试卷管理控制器负责对试卷的增删查改、题目的添加等功能,视图定义了界面。 12 | 13 | 成绩管理采用一张user_paper表存储考生考试的成绩,控制器实现了考试功能,视图定义了考试、浏览试卷界面。 14 | 15 | 用户管理采用一张user表存储考生的登陆信息,比如学号、姓名、密码。为了安全性考虑,我们对密码字段进行了加密,防止考生的信息泄露。用户管理控制器实现了用户的授权、用户的添加、删除、修改等功能,视图定义了其界面。 16 | 17 | 资源管理采用了articles、categories等表存储文章、视频、分类等信息资源,控制器实现了相关功能,视图定义了界面。 18 | 19 | 我们采用MVC设计模式实现的系统,维护方便,运行效率高,从实际使用中可体现其模式的优良性。 20 | -------------------------------------------------------------------------------- /app/Article.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\User', 'uid', 'id'); 32 | } 33 | public function category() { 34 | return $this->belongsTo('App\Category', 'cid', 'id'); 35 | } 36 | // 37 | } 38 | -------------------------------------------------------------------------------- /app/Category.php: -------------------------------------------------------------------------------- 1 | hasMany('App\Article', 'cid', 'id'); 26 | } 27 | public static $base = [ 28 | '系统提示', 29 | '最新公告', 30 | '规章制度', 31 | '事故案例', 32 | '安全标识', 33 | '安全讲座', 34 | ]; 35 | 36 | // 37 | } 38 | -------------------------------------------------------------------------------- /app/Console/Commands/Inspire.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('backup:clean')->dailyAt('01:00'); 28 | $schedule->command('backup:run')->dailyAt('02:00'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | middleware($this->guestMiddleware()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | value('id'); 24 | ++$i; 25 | } 26 | $data = [ 27 | 'baseId' => $baseId, 28 | 'baseInfo' => Category::withCount('articles')->get(), 29 | 'articles_count' => Article::count(), 30 | 'systeminfo' => Article::where('cid', $baseId[0])->orderBy('created_at', 'desc')->first(), 31 | 'notices' => Article::where('cid', $baseId[1])->orderBy('created_at', 'desc')->take(8)->get(), 32 | 'papers_count' => Paper::where('full_score', '<>', 0)->count(), 33 | ]; 34 | // return view('index')->with('data', $data); 35 | return view('main.index')->with('data', $data); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 29 | \App\Http\Middleware\EncryptCookies::class, 30 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 31 | \Illuminate\Session\Middleware\StartSession::class, 32 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 33 | \App\Http\Middleware\VerifyCsrfToken::class, 34 | ], 35 | 36 | 'api' => [ 37 | 'throttle:60,1', 38 | ], 39 | ]; 40 | 41 | /** 42 | * The application's route middleware. 43 | * 44 | * These middleware may be assigned to groups or used individually. 45 | * 46 | * @var array 47 | */ 48 | protected $routeMiddleware = [ 49 | 'auth' => \App\Http\Middleware\Authenticate::class, 50 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 51 | 'can' => \Illuminate\Foundation\Http\Middleware\Authorize::class, 52 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 53 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 54 | 'manage' => ManageMiddleware::class, 55 | 'opFile' => opFileMiddleware::class, 56 | ]; 57 | } 58 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | guest()) { 21 | if ($request->ajax() || $request->wantsJson()) { 22 | return response('Unauthorized.', 401); 23 | } 24 | 25 | return redirect()->guest('login'); 26 | } 27 | 28 | return $next($request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | url()) === "connector") 20 | return $next($request); 21 | else if(Gate::denies('manage')) 22 | abort(403); 23 | return $next($request); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Http/Requests/Request.php: -------------------------------------------------------------------------------- 1 | belongsToMany('App\Question', 'paper_question', 'pid', 'qid') 14 | ->withTimestamps(); 15 | } 16 | public function users() { 17 | return $this->belongsToMany('App\User', 'user_paper', 'pid', 'uid') 18 | ->withPivot('start_time', 'end_time', 'score'); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Policies/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any application authentication / authorization services. 21 | * 22 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate 23 | * @return void 24 | */ 25 | public function boot(GateContract $gate) 26 | { 27 | $this->registerPolicies($gate); 28 | $gate->define('manage', function($user) { 29 | return $user->isAdmin() || $user->isTeacher(); 30 | }); 31 | $gate->define('manageUser', function($user) { 32 | return $user->isAdmin(); 33 | }); 34 | $gate->define('opArticle', function($user, $post) { 35 | return ($user->id === $post->uid) || $user->isAdmin(); 36 | }); 37 | // 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any other events for your application. 23 | * 24 | * @param \Illuminate\Contracts\Events\Dispatcher $events 25 | * @return void 26 | */ 27 | public function boot(DispatcherContract $events) 28 | { 29 | parent::boot($events); 30 | 31 | // 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapWebRoutes($router); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @param \Illuminate\Routing\Router $router 51 | * @return void 52 | */ 53 | protected function mapWebRoutes(Router $router) 54 | { 55 | $router->group([ 56 | 'namespace' => $this->namespace, 'middleware' => 'web', 57 | ], function ($router) { 58 | require app_path('Http/routes.php'); 59 | }); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Question.php: -------------------------------------------------------------------------------- 1 | belongsToMany('App\Paper', 'paper_question', 'qid', 'pid'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | =5.5.9", 9 | "laravel/framework": "5.2.*", 10 | "barryvdh/laravel-ide-helper": "^2.2", 11 | "doctrine/dbal": "^2.5", 12 | "barryvdh/laravel-elfinder": "^0.3.7", 13 | "rap2hpoutre/laravel-log-viewer": "^0.7.0", 14 | "spatie/laravel-backup": "^3.10", 15 | "barryvdh/laravel-debugbar": "^2.2", 16 | "maatwebsite/excel": "~2.1.0" 17 | }, 18 | "require-dev": { 19 | "fzaninotto/faker": "~1.4", 20 | "mockery/mockery": "0.9.*", 21 | "phpunit/phpunit": "~4.0", 22 | "symfony/css-selector": "2.8.*|3.0.*", 23 | "symfony/dom-crawler": "2.8.*|3.0.*" 24 | }, 25 | "autoload": { 26 | "classmap": [ 27 | "database" 28 | ], 29 | "psr-4": { 30 | "App\\": "app/" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "classmap": [ 35 | "tests/TestCase.php" 36 | ] 37 | }, 38 | "scripts": { 39 | "post-root-package-install": [ 40 | "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 41 | ], 42 | "post-create-project-cmd": [ 43 | "php artisan key:generate" 44 | ], 45 | "post-install-cmd": [ 46 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 47 | "php artisan optimize" 48 | ], 49 | "post-update-cmd": [ 50 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 51 | "php artisan ide-helper:generate", 52 | "php artisan ide-helper:meta", 53 | "php artisan optimize" 54 | ] 55 | }, 56 | "config": { 57 | "preferred-install": "dist" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'pusher'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_KEY'), 36 | 'secret' => env('PUSHER_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | ], 53 | 54 | ]; 55 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'visibility' => 'public', 55 | ], 56 | 57 | 's3' => [ 58 | 'driver' => 's3', 59 | 'key' => 'your-key', 60 | 'secret' => 'your-secret', 61 | 'region' => 'your-region', 62 | 'bucket' => 'your-bucket', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'mandrill' => [ 23 | 'secret' => env('MANDRILL_SECRET'), 24 | ], 25 | 26 | 'ses' => [ 27 | 'key' => env('SES_KEY'), 28 | 'secret' => env('SES_SECRET'), 29 | 'region' => 'us-east-1', 30 | ], 31 | 32 | 'sparkpost' => [ 33 | 'secret' => env('SPARKPOST_SECRET'), 34 | ], 35 | 36 | 'stripe' => [ 37 | 'model' => App\User::class, 38 | 'key' => env('STRIPE_KEY'), 39 | 'secret' => env('STRIPE_SECRET'), 40 | ], 41 | 42 | ]; 43 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 15 | return [ 16 | 'name' => $faker->name, 17 | 'email' => $faker->safeEmail, 18 | 'password' => bcrypt(str_random(10)), 19 | 'remember_token' => str_random(10), 20 | ]; 21 | }); 22 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('uid')->unsigned()->unique(); 18 | $table->string('name'); 19 | $table->tinyInteger('type'); 20 | $table->string('password'); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 17 | $table->string('token')->index(); 18 | $table->timestamp('created_at')->nullable(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('password_resets'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2016_08_02_110546_create_articles_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('uid')->unsigned(); 18 | $table->integer('cid')->unsigned(); 19 | $table->string('title'); 20 | $table->text('content'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('articles'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2016_08_02_110553_create_categories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name')->unique(); 18 | $table->timestamps(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('categories'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2016_08_16_142058_create_questions_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->text('content'); 18 | $table->integer('type'); 19 | $table->string('A'); 20 | $table->string('B'); 21 | $table->string('C'); 22 | $table->string('D'); 23 | $table->integer('ans'); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::drop('questions'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2016_08_21_144951_create_papers_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('title')->unique(); 18 | $table->float('multi_score'); // 单选题分数 19 | $table->float('judge_score'); // 判断题分数 20 | $table->integer('time'); // 考试时间,秒 21 | $table->float('full_score'); // 满分 22 | $table->dateTimeTz('start_time'); // 开始时间 23 | $table->dateTimeTz('end_time'); // 结束时间 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::drop('papers'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2016_08_21_152436_create_paper_question_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('qid')->unsigned(); 18 | $table->integer('pid')->unsigned(); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('paper_question'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2016_08_24_151849_create_user_paper_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('uid'); 18 | $table->integer('pid'); 19 | $table->integer('score'); 20 | $table->dateTimeTz('start_time'); 21 | $table->dateTimeTz('end_time'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('user_paper'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2016_08_26_100452_create_user_question_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('uid'); 18 | $table->integer('pid'); 19 | $table->integer('qid'); 20 | $table->integer('ans'); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('user_question'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/seeds/ArticlesSeeder.php: -------------------------------------------------------------------------------- 1 | rand(1, 3), 18 | 'cid'=>rand(1, 6), 19 | 'title'=>'标题'.$i, 20 | 'content'=>'内容'.$i 21 | ]); 22 | } 23 | // 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /database/seeds/CategoriesSeeder.php: -------------------------------------------------------------------------------- 1 | $name, 18 | ]); 19 | } 20 | // 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | $this->call(UsersSeeder::class); 16 | // $this->call(ArticlesSeeder::class); 17 | $this->call(CategoriesSeeder::class); 18 | // $this->call(QuestionsSeeder::class); 19 | // $this->call(PapersSeeder::class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/seeds/PapersSeeder.php: -------------------------------------------------------------------------------- 1 | '试卷'.$i, 18 | 'multi_score' => 2, 19 | 'judge_score' => 1, 20 | 'time' => 30, 21 | 'full_score' => 0, 22 | 'start_time' => \Carbon\Carbon::createFromDate(2016,8,21)->toDateTimeString(), 23 | 'end_time' => \Carbon\Carbon::createFromDate(2099,8,21)->toDateTimeString(), 24 | ]); 25 | // 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/seeds/QuestionsSeeder.php: -------------------------------------------------------------------------------- 1 | '单选'.($i+1), 18 | 'type' => '0', 19 | 'A' => 'A选项', 20 | 'B' => 'B选项', 21 | 'C' => 'C选项', 22 | 'D' => 'D选项', 23 | 'ans' => random_int(0, 3) 24 | ]); 25 | // 26 | for($i=0; $i<10; ++$i) 27 | Question::create([ 28 | 'content' => '判断'.($i+1), 29 | 'type' => '1', 30 | 'ans' => random_int(0, 1) 31 | ]); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/seeds/UsersSeeder.php: -------------------------------------------------------------------------------- 1 | '2014218700', 17 | 'name'=>'admin', 18 | 'type'=>'0', 19 | 'password'=>bcrypt('123456'), 20 | ]); 21 | User::create([ 22 | 'uid'=>'2014218701', 23 | 'name'=>'teacher', 24 | 'type'=>'1', 25 | 'password'=>bcrypt('123456'), 26 | ]); 27 | // User::chunk(100, function($users) { 28 | // foreach ($users as $user) { 29 | // $user->password = bcrypt($user->password); 30 | // $user->save(); 31 | // } 32 | // }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var elixir = require('laravel-elixir'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Elixir Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for our application, as well as publishing vendor resources. 11 | | 12 | */ 13 | 14 | elixir(function(mix) { 15 | mix.sass([ 16 | 'app.scss' 17 | ]).browserify([ 18 | 'app.js' 19 | ], 'public/js/app.js'); 20 | 21 | mix.browserify('app_config.js', 'public/js/app_config.js'); 22 | 23 | // mix.version([ 24 | // 'css/app.css', 25 | // 'js/app.js', 26 | // 'js/app_config.js' 27 | // ]); 28 | mix.copy('node_modules/font-awesome/fonts', 'public/fonts'); 29 | mix.copy([ 30 | 'node_modules/jquery/dist/jquery.min.js', 31 | 'node_modules/jquery-ui-dist/jquery-ui.min.js', 32 | 'node_modules/datatables.net/js/jquery.dataTables.js', 33 | 'node_modules/datatables.net-bs/js/dataTables.bootstrap.js', 34 | 'node_modules/bootstrap-material-design/dist/js/material.min.js', 35 | 'node_modules/bootstrap-material-design/dist/js/ripples.min.js' 36 | ], 'public/js'); 37 | mix.copy([ 38 | 'node_modules/jquery-ui-dist/jquery-ui.min.css', 39 | 'node_modules/datatables.net-bs/css/dataTables.bootstrap.css', 40 | 'node_modules/bootstrap-material-design/dist/css/bootstrap-material-design.min.css', 41 | 'node_modules/bootstrap-material-design/dist/css/ripples.min.css' 42 | ], 'public/css'); 43 | 44 | mix.copy('node_modules/jquery-ui-dist/images', 'public/css/images'); 45 | mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/', 'public/fonts/bootstrap'); 46 | mix.browserSync({ 47 | proxy: 'chemlab.app' 48 | }); 49 | }); 50 | -------------------------------------------------------------------------------- /npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "prod": "gulp --production", 5 | "dev": "gulp watch" 6 | }, 7 | "devDependencies": { 8 | "gulp": "^3.9.1", 9 | "laravel-elixir": "^5.0.0", 10 | "bootstrap-sass": "^3.3.7" 11 | }, 12 | "dependencies": { 13 | "babel-cli": "^6.11.4", 14 | "babel-preset-es2015": "^6.13.2", 15 | "babel-preset-react": "^6.11.1", 16 | "bootstrap-material-design": "^0.5.10", 17 | "datatables.net": "^1.10.12", 18 | "datatables.net-bs": "^1.10.12", 19 | "font-awesome": "^4.6.3", 20 | "gulp": "^3.9.1", 21 | "gulp-cli": "^1.2.2", 22 | "jquery": "^3.1.0", 23 | "jquery-ui-dist": "^1.12.0", 24 | "toastr": "^2.1.2" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | ./app/Http/routes.php 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /public/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /public/.tmb/.gitignore: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /public/css/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/css/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/css/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/css/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/css/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/css/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/css/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /public/css/ripples.min.css: -------------------------------------------------------------------------------- 1 | .withripple{position:relative}.ripple-container{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;overflow:hidden;border-radius:inherit;pointer-events:none}.ripple{position:absolute;width:20px;height:20px;margin-left:-10px;margin-top:-10px;border-radius:100%;background-color:#000;background-color:rgba(0,0,0,.05);-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);-webkit-transform-origin:50%;-ms-transform-origin:50%;-o-transform-origin:50%;transform-origin:50%;opacity:0;pointer-events:none}.ripple.ripple-on{-webkit-transition:opacity .15s ease-in 0s,-webkit-transform .5s cubic-bezier(.4,0,.2,1) .1s;-o-transition:opacity .15s ease-in 0s,-o-transform .5s cubic-bezier(.4,0,.2,1) .1s;transition:opacity .15s ease-in 0s,transform .5s cubic-bezier(.4,0,.2,1) .1s;opacity:.1}.ripple.ripple-out{-webkit-transition:opacity .1s linear 0s!important;-o-transition:opacity .1s linear 0s!important;transition:opacity .1s linear 0s!important;opacity:0} 2 | /*# sourceMappingURL=ripples.min.css.map */ -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/bg.jpg -------------------------------------------------------------------------------- /public/images/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/dot.png -------------------------------------------------------------------------------- /public/images/hfut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/hfut.png -------------------------------------------------------------------------------- /public/images/ii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/ii.png -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/logo.png -------------------------------------------------------------------------------- /public/images/q1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q1.jpg -------------------------------------------------------------------------------- /public/images/q2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q2.jpg -------------------------------------------------------------------------------- /public/images/q3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q3.jpg -------------------------------------------------------------------------------- /public/images/q4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q4.png -------------------------------------------------------------------------------- /public/images/q5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q5.png -------------------------------------------------------------------------------- /public/images/q6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q6.png -------------------------------------------------------------------------------- /public/images/q7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q7.png -------------------------------------------------------------------------------- /public/images/q8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q8.png -------------------------------------------------------------------------------- /public/images/q9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/q9.png -------------------------------------------------------------------------------- /public/images/w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/w.png -------------------------------------------------------------------------------- /public/images/w1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/w1.png -------------------------------------------------------------------------------- /public/images/w2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/images/w2.png -------------------------------------------------------------------------------- /public/img/chemlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/chemlab.png -------------------------------------------------------------------------------- /public/img/gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/gate.png -------------------------------------------------------------------------------- /public/img/gate2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/gate2.jpg -------------------------------------------------------------------------------- /public/img/hfut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/hfut.png -------------------------------------------------------------------------------- /public/img/hfut_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/hfut_logo.png -------------------------------------------------------------------------------- /public/img/scrollbar_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/scrollbar_arrow.png -------------------------------------------------------------------------------- /public/img/事故案例.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/事故案例.png -------------------------------------------------------------------------------- /public/img/在线学习.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/在线学习.png -------------------------------------------------------------------------------- /public/img/在线考试.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/在线考试.png -------------------------------------------------------------------------------- /public/img/安全标识.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/安全标识.png -------------------------------------------------------------------------------- /public/img/安全讲座.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/安全讲座.png -------------------------------------------------------------------------------- /public/img/规章制度.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/img/规章制度.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/js/app_config.js: -------------------------------------------------------------------------------- 1 | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;oul",c),tLi=$(">li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$(">li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+(i-1)*o.scroll:i-1)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){try{return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')}catch(ex){return 0}};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery); -------------------------------------------------------------------------------- /public/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 | -------------------------------------------------------------------------------- /public/js/tinymce/plugins/advlist/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function c(b,c){a.undoManager.transact(function(){var d,e=a.dom,f=a.selection;if(d=e.getParent(f.getNode(),"ol,ul"),!d||d.nodeName!=b||c===!1){var h={"list-style-type":c?c:""};a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList",!1,h)}c=c===!1?g[b]:c,g[b]=c,d=e.getParent(f.getNode(),"ol,ul"),d&&(e.setStyle(d,"listStyleType",c?c:null),d.removeAttribute("data-mce-style")),a.focus()})}function d(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var e,f,g={};e=b("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),f=b("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square")),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:e,onshow:d,onselect:function(a){c("OL",a.control.settings.data)},onclick:function(){c("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:d,onselect:function(a){c("UL",a.control.settings.data)},onclick:function(){c("UL",!1)}})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/anchor/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("anchor",function(a){function b(){var b=a.selection.getNode(),c="",d="A"==b.tagName&&""===a.dom.getAttrib(b,"href");d&&(c=b.name||b.id||""),a.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(c){var e=c.data.name;d?b.id=e:(a.selection.collapse(!0),a.execCommand("mceInsertContent",!1,a.dom.createHTML("a",{id:e})))}})}a.addCommand("mceAnchor",b),a.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:b,stateSelector:"a:not([href])"}),a.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:b})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/autolink/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){1!=a.nodeType||a.hasChildNodes()?h.setStart(a,d(a,b)):h.setStartBefore(a)}function f(a,b){1!=a.nodeType||a.hasChildNodes()?h.setEnd(a,d(a,b)):h.setEndAfter(a)}var h,i,j,k,l,m,n,o,p,q;if("A"!=a.selection.getNode().tagName){if(h=a.selection.getRng(!0).cloneRange(),h.startOffset<5){if(o=h.endContainer.previousSibling,!o){if(!h.endContainer.firstChild||!h.endContainer.firstChild.nextSibling)return;o=h.endContainer.firstChild.nextSibling}if(p=o.length,e(o,p),f(o,p),h.endOffset<5)return;i=h.endOffset,k=o}else{if(k=h.endContainer,3!=k.nodeType&&k.firstChild){for(;3!=k.nodeType&&k.firstChild;)k=k.firstChild;3==k.nodeType&&(e(k,0),f(k,k.nodeValue.length))}i=1==h.endOffset?2:h.endOffset-1-b}j=i;do e(k,i>=2?i-2:0),f(k,i>=1?i-1:0),i-=1,q=h.toString();while(" "!=q&&""!==q&&160!=q.charCodeAt(0)&&i-2>=0&&q!=c);h.toString()==c||160==h.toString().charCodeAt(0)?(e(k,i),f(k,j),i+=1):0===h.startOffset?(e(k,0),f(k,j)):(e(k,i),f(k,j)),m=h.toString(),"."==m.charAt(m.length-1)&&f(k,j-1),m=h.toString(),n=m.match(g),n&&("www."==n[1]?n[1]="http://www.":/@$/.test(n[1])&&!/^mailto:/.test(n[1])&&(n[1]="mailto:"+n[1]),l=a.selection.getBookmark(),a.selection.setRng(h),a.execCommand("createlink",!1,n[1]+n[2]),a.selection.moveToBookmark(l),a.nodeChanged())}}var f,g=/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i;return a.settings.autolink_pattern&&(g=a.settings.autolink_pattern),a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/autoresize/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(d){var g,h,i,j,k,l,m,n,o,p,q,r,s=tinymce.DOM;if(h=a.getDoc()){if(i=h.body,j=h.documentElement,k=e.autoresize_min_height,!i||d&&"setcontent"===d.type&&d.initial||b())return void(i&&j&&(i.style.overflowY="auto",j.style.overflowY="auto"));m=a.dom.getStyle(i,"margin-top",!0),n=a.dom.getStyle(i,"margin-bottom",!0),o=a.dom.getStyle(i,"padding-top",!0),p=a.dom.getStyle(i,"padding-bottom",!0),q=a.dom.getStyle(i,"border-top-width",!0),r=a.dom.getStyle(i,"border-bottom-width",!0),l=i.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||0>=l)&&(l=tinymce.Env.ie?i.scrollHeight:tinymce.Env.webkit&&0===i.clientHeight?0:i.offsetHeight),l>e.autoresize_min_height&&(k=l),e.autoresize_max_height&&l>e.autoresize_max_height?(k=e.autoresize_max_height,i.style.overflowY="auto",j.style.overflowY="auto"):(i.style.overflowY="hidden",j.style.overflowY="hidden",i.scrollTop=0),k!==f&&(g=k-f,s.setStyle(a.iframeElement,"height",k+"px"),f=k,tinymce.isWebKit&&0>g&&c(d))}}function d(b,e,f){tinymce.util.Delay.setEditorTimeout(a,function(){c({}),b--?d(b,e,f):f&&f()},e)}var e=a.settings,f=0;a.settings.inline||(e.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),e.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),a.on("init",function(){var b,c;b=a.getParam("autoresize_overflow_padding",1),c=a.getParam("autoresize_bottom_margin",50),b!==!1&&a.dom.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),c!==!1&&a.dom.setStyles(a.getBody(),{paddingBottom:c})}),a.on("nodechange setcontent keyup FullscreenStateChanged",c),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){d(20,100,function(){d(5,1e3)})}),a.addCommand("mceAutoResize",c))}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/autosave/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce._beforeUnloadHandler=function(){var a;return tinymce.each(tinymce.editors,function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",!0)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a},tinymce.PluginManager.add("autosave",function(a){function b(a,b){var c={s:1e3,m:6e4};return a=/^(\d+)([ms]?)$/.exec(""+(a||b)),(a[2]?c[a[2]]:1)*parseInt(a,10)}function c(){var a=parseInt(n.getItem(k+"time"),10)||0;return(new Date).getTime()-a>m.autosave_retention?(d(!1),!1):!0}function d(b){n.removeItem(k+"draft"),n.removeItem(k+"time"),b!==!1&&a.fire("RemoveDraft")}function e(){!j()&&a.isDirty()&&(n.setItem(k+"draft",a.getContent({format:"raw",no_events:!0})),n.setItem(k+"time",(new Date).getTime()),a.fire("StoreDraft"))}function f(){c()&&(a.setContent(n.getItem(k+"draft"),{format:"raw"}),a.fire("RestoreDraft"))}function g(){l||(setInterval(function(){a.removed||e()},m.autosave_interval),l=!0)}function h(){var b=this;b.disabled(!c()),a.on("StoreDraft RestoreDraft RemoveDraft",function(){b.disabled(!c())}),g()}function i(){a.undoManager.beforeChange(),f(),d(),a.undoManager.add()}function j(b){var c=a.settings.forced_root_block;return b=tinymce.trim("undefined"==typeof b?a.getBody().innerHTML:b),""===b||new RegExp("^<"+c+"[^>]*>((\xa0| |[ ]|]*>)+?|)|
$","i").test(b)}var k,l,m=a.settings,n=tinymce.util.LocalStorage;k=m.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",k=k.replace(/\{path\}/g,document.location.pathname),k=k.replace(/\{query\}/g,document.location.search),k=k.replace(/\{id\}/g,a.id),m.autosave_interval=b(m.autosave_interval,"30s"),m.autosave_retention=b(m.autosave_retention,"20m"),a.addButton("restoredraft",{title:"Restore last draft",onclick:i,onPostRender:h}),a.addMenuItem("restoredraft",{text:"Restore last draft",onclick:i,onPostRender:h,context:"file"}),a.settings.autosave_restore_when_empty!==!1&&(a.on("init",function(){c()&&j()&&f()}),a.on("saveContent",function(){d()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=c,this.storeDraft=e,this.restoreDraft=f,this.removeDraft=d,this.isEmpty=j}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/code/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/colorpicker/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("colorpicker",function(a){function b(b,c){function d(a){var b=new tinymce.util.Color(a),c=b.toRgb();f.fromJSON({r:c.r,g:c.g,b:c.b,hex:b.toHex().substr(1)}),e(b.toHex())}function e(a){f.find("#preview")[0].getEl().style.background=a}var f=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:c,onchange:function(){var a=this.rgb();f&&(f.find("#r").value(a.r),f.find("#g").value(a.g),f.find("#b").value(a.b),f.find("#hex").value(this.value().substr(1)),e(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=f.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,d(b),void c.value(b)):(b={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()},c.value(b),void d(b))}},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(){b("#"+this.toJSON().hex)}});d(c)}a.settings.color_picker_callback||(a.settings.color_picker_callback=b)}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/contextmenu/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h'}),a+=""}),a+=""}var d=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:c,onclick:function(b){var c=a.dom.getParent(b.target,"a");c&&(a.insertContent(''+c.getAttribute('),this.hide())}},tooltip:"Emoticons"})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/example/dialog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Custom dialog

5 | Input some text: 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/js/tinymce/plugins/example/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("example",function(a,b){a.addButton("example",{text:"My button",icon:!1,onclick:function(){a.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(b){a.insertContent("Title: "+b.data.title)}})}}),a.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){a.windowManager.open({title:"TinyMCE site",url:b+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var b=a.windowManager.getWindows()[0];a.insertContent(b.getContentWindow().document.getElementById("content").value),b.close()}},{text:"Close",onclick:"close"}]})}})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/example_dependency/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("example_dependency",function(){},["example"]); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/fullscreen/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){var a=tinymce.DOM.getViewPort();return{x:a.x,y:a.y}}function d(a){scrollTo(a.x,a.y)}function e(){function e(){m.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;l=!l,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,l?(k=c(),f=q.width,g=q.height,q.width=q.height="100%",i=n.width,j=n.height,n.width=n.height="",m.addClass(r,"mce-fullscreen"),m.addClass(s,"mce-fullscreen"),m.addClass(o,"mce-fullscreen"),m.bind(window,"resize",e),e(),h=e):(q.width=f,q.height=g,i&&(n.width=i),j&&(n.height=j),m.removeClass(r,"mce-fullscreen"),m.removeClass(s,"mce-fullscreen"),m.removeClass(o,"mce-fullscreen"),m.unbind(window,"resize",h),d(k)),a.fire("FullscreenStateChanged",{state:l})}var f,g,h,i,j,k,l=!1,m=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Ctrl+Shift+F","",e)}),a.on("remove",function(){h&&m.unbind(window,"resize",h)}),a.addCommand("mceFullScreen",e),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,onClick:function(){e(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:e,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return l}})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"
")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/importcss/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("importcss",function(a){function b(a){var b=tinymce.Env.cacheSuffix;return"string"==typeof a&&(a=a.replace("?"+b,"").replace("&"+b,"")),a}function c(b){var c=a.settings,d=c.skin!==!1?c.skin||"lightgray":!1;if(d){var e=c.skin_url;return e=e?a.documentBaseURI.toAbsolute(e):tinymce.baseURL+"/skins/"+d,b===e+"/content"+(a.inline?".inline":"")+".min.css"}return!1}function d(a){return"string"==typeof a?function(b){return-1!==b.indexOf(a)}:a instanceof RegExp?function(b){return a.test(b)}:a}function e(d,e){function f(a,d){var i,j=a.href;if(j=b(j),j&&e(j,d)&&!c(j)){h(a.imports,function(a){f(a,!0)});try{i=a.cssRules||a.rules}catch(k){}h(i,function(a){a.styleSheet?f(a.styleSheet,!0):a.selectorText&&h(a.selectorText.split(","),function(a){g.push(tinymce.trim(a))})})}}var g=[],i={};h(a.contentCSS,function(a){i[a]=!0}),e||(e=function(a,b){return b||i[a]});try{h(d.styleSheets,function(a){f(a)})}catch(j){}return g}function f(b){var c,d=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(b);if(d){var e=d[1],f=d[2].substr(1).split(".").join(" "),g=tinymce.makeMap("a,img");return d[1]?(c={title:b},a.schema.getTextBlockElements()[e]?c.block=e:a.schema.getBlockElements()[e]||g[e.toLowerCase()]?c.selector=e:c.inline=e):d[2]&&(c={inline:"span",title:b.substr(1),classes:f}),a.settings.importcss_merge_classes!==!1?c.classes=f:c.attributes={"class":f},c}}var g=this,h=tinymce.each;a.on("renderFormatsMenu",function(b){var c=a.settings,i={},j=c.importcss_selector_converter||f,k=d(c.importcss_selector_filter),l=b.control;a.settings.importcss_append||l.items().remove();var m=[];tinymce.each(c.importcss_groups,function(a){a=tinymce.extend({},a),a.filter=d(a.filter),m.push(a)}),h(e(b.doc||a.getDoc(),d(c.importcss_file_filter)),function(b){if(-1===b.indexOf(".mce-")&&!i[b]&&(!k||k(b))){var c,d=j.call(g,b);if(d){var e=d.name||tinymce.DOM.uniqueId();if(m)for(var f=0;f'+d+"";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var d,e,f="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),g="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),h="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" "),j=[];a.addCommand("mceInsertDate",function(){c(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){c(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){c(d||e)},menu:j}),tinymce.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){e||(e=a),j.push({text:b(a),onclick:function(){d=a,c(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:j,context:"insert"})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/media/moxieplayer.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/plugins/media/moxieplayer.swf -------------------------------------------------------------------------------- /public/js/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("nonbreaking",function(a){var b=a.getParam("nonbreaking_force_tab");if(a.addCommand("mceNonBreaking",function(){a.insertContent(a.plugins.visualchars&&a.plugins.visualchars.state?' ':" "),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;c>d;d++)a.execCommand("mceNonBreaking")}})}}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/noneditable/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("noneditable",function(a){function b(a){return function(b){return-1!==(" "+b.attr("class")+" ").indexOf(a)}}function c(b){function c(b){var c=arguments,d=c[c.length-2];return d>0&&'"'==g.charAt(d-1)?b:''+a.dom.encode("string"==typeof c[1]?c[1]:c[0])+""}var d=f.length,g=b.content,h=tinymce.trim(e);if("raw"!=b.format){for(;d--;)g=g.replace(f[d],c);b.content=g}}var d,e,f,g="contenteditable";d=" "+tinymce.trim(a.getParam("noneditable_editable_class","mceEditable"))+" ",e=" "+tinymce.trim(a.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";var h=b(d),i=b(e);f=a.getParam("noneditable_regexp"),f&&!f.length&&(f=[f]),a.on("PreInit",function(){f&&a.on("BeforeSetContent",c),a.parser.addAttributeFilter("class",function(a){for(var b,c=a.length;c--;)b=a[c],h(b)?b.attr(g,"true"):i(b)&&b.attr(g,"false")}),a.serializer.addAttributeFilter(g,function(a){for(var b,c=a.length;c--;)b=a[c],(h(b)||i(b))&&(f&&b.attr("data-mce-content")?(b.name="#text",b.type=3,b.raw=!0,b.value=b.attr("data-mce-content")):b.attr(g,null))})})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/pagebreak/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator",""),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("

"+e+"

"):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/preview/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='',tinymce.each(a.contentCSS,function(b){e+=''});var f=b.body_id||"tinymce";-1!=f.indexOf("=")&&(f=a.getParam("body_id","","hash"),f=f[a.id]||f);var g=b.body_class||"";-1!=g.indexOf("=")&&(g=a.getParam("body_class","","hash"),g=g[a.id]||"");var h=' ',i=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(d=""+e+'"+a.getContent()+h+"",c)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d);else{var j=this.getEl("body").firstChild.contentWindow.document;j.open(),j.write(d),j.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("print",function(a){a.addCommand("mcePrint",function(){a.getWin().print()}),a.addButton("print",{title:"Print",cmd:"mcePrint"}),a.addShortcut("Meta+P","","mcePrint"),a.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/save/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("save",function(a){function b(){var b;return b=tinymce.DOM.getParent(a.id,"form"),!a.getParam("save_enablewhendirty",!0)||a.isDirty()?(tinymce.triggerSave(),a.getParam("save_onsavecallback")?(a.execCallback("save_onsavecallback",a),void a.nodeChanged()):void(b?(a.setDirty(!1),b.onsubmit&&!b.onsubmit()||("function"==typeof b.submit?b.submit():c(a.translate("Error: Form submit field collision."))),a.nodeChanged()):c(a.translate("Error: No form element found.")))):void 0}function c(b){a.notificationManager.open({text:b,type:"error"})}function d(){var b=tinymce.trim(a.startContent);return a.getParam("save_oncancelcallback")?void a.execCallback("save_oncancelcallback",a):(a.setContent(b),a.undoManager.clear(),void a.nodeChanged())}function e(){var b=this;a.on("nodeChange dirty",function(){b.disabled(a.getParam("save_enablewhendirty",!0)&&!a.isDirty())})}a.addCommand("mceSave",b),a.addCommand("mceCancel",d),a.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:e}),a.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:e}),a.addShortcut("Meta+S","","mceSave")}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/tabfocus/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(c){function f(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&f(a.parentNode)}function i(a){return/INPUT|TEXTAREA|BUTTON/.test(a.tagName)&&tinymce.get(b.id)&&-1!=a.tabIndex&&f(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),c>0){for(j=g+1;j=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():tinymce.util.Delay.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/visualblocks/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("visualblocks",function(a,b){function c(){var b=this;b.active(f),a.on("VisualBlocks",function(){b.active(a.dom.hasClass(a.getBody(),"mce-visualblocks"))})}var d,e,f;window.NodeList&&(a.addCommand("mceVisualBlocks",function(){var c,g=a.dom;d||(d=g.uniqueId(),c=g.create("link",{id:d,rel:"stylesheet",href:b+"/css/visualblocks.css"}),a.getDoc().getElementsByTagName("head")[0].appendChild(c)),a.on("PreviewFormats AfterPreviewFormats",function(b){f&&g.toggleClass(a.getBody(),"mce-visualblocks","afterpreviewformats"==b.type)}),g.toggleClass(a.getBody(),"mce-visualblocks"),f=a.dom.hasClass(a.getBody(),"mce-visualblocks"),e&&e.active(g.hasClass(a.getBody(),"mce-visualblocks")),a.fire("VisualBlocks")}),a.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:c}),a.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("init",function(){a.settings.visualblocks_default_state&&a.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),a.on("remove",function(){a.dom.removeClass(a.getBody(),"mce-visualblocks")}))}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/visualchars/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("visualchars",function(a){function b(b){function c(a){return''+a+""}function f(){var a,b="";for(a in n)b+=a;return new RegExp("["+b+"]","g")}function g(){var a,b="";for(a in n)b&&(b+=","),b+="span.mce-"+n[a];return b}var h,i,j,k,l,m,n,o,p=a.getBody(),q=a.selection;if(n={"\xa0":"nbsp","\xad":"shy"},d=!d,e.state=d,a.fire("VisualChars",{state:d}),o=f(),b&&(m=q.getBookmark()),d)for(i=[],tinymce.walk(p,function(a){3==a.nodeType&&a.nodeValue&&o.test(a.nodeValue)&&i.push(a)},"childNodes"),j=0;j=0;j--)a.dom.remove(i[j],1);q.moveToBookmark(m)}function c(){var b=this;a.on("VisualChars",function(a){b.active(a.state)})}var d,e=this;a.addCommand("mceVisualChars",b),a.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c}),a.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("beforegetcontent",function(a){d&&"raw"!=a.format&&!a.draft&&(d=!0,b(!1))})}); -------------------------------------------------------------------------------- /public/js/tinymce/plugins/wordcount/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("wordcount",function(a){function b(){a.theme.panel.find("#wordcount").text(["Words: {0}",e.getCount()])}var c,d,e=this;c=a.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),d=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),a.on("init",function(){var c=a.theme.panel&&a.theme.panel.find("#statusbar")[0];c&&tinymce.util.Delay.setEditorTimeout(a,function(){c.insert({type:"label",name:"wordcount",text:["Words: {0}",e.getCount()],classes:"wordcount",disabled:a.settings.readonly},0),a.on("setcontent beforeaddundo",b),a.on("keyup",function(a){32==a.keyCode&&b()})},0)}),e.getCount=function(){var b=a.getContent({format:"raw"}),e=0;if(b){b=b.replace(/\.\.\./g," "),b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),b=b.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),b=b.replace(d,"");var f=b.match(c);f&&(e=f.length)}return e}}); -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /public/js/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/js/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/config/bolt/atomic.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | configs: [ 3 | './prod.js' 4 | ] 5 | }); 6 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/config/bolt/browser.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | configs: [ 3 | './prod.js' 4 | ], 5 | sources: [ 6 | source('amd', 'ephox/tinymce', '', mapper.constant('../../../../../tinymce')), 7 | source('amd', 'ephox.mcagar', '../../lib/test', mapper.flat), 8 | source('amd', 'ephox', '../../lib/test', mapper.flat) 9 | ] 10 | }); 11 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/config/bolt/demo.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | configs: [ 3 | './prod.js' 4 | ], 5 | sources: [ 6 | source('amd', 'tinymce/inlite/Demo', '../../src/demo/js', mapper.hierarchical) 7 | ] 8 | }); 9 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/config/bolt/prod.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | sources: [ 3 | source('amd', 'tinymce/inlite', '../../src/main/js', mapper.hierarchical) 4 | ] 5 | }); 6 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/config/dent/depend.js: -------------------------------------------------------------------------------- 1 | var lib = 'lib'; 2 | var run = lib + '/run'; 3 | var depend = run + '/depend'; 4 | var licenses = run + '/licenses'; 5 | var demo = lib + '/demo'; 6 | var test = lib + '/test'; 7 | var config = lib + '/config'; 8 | 9 | var cleanDirs = [ lib ]; 10 | 11 | var dependencies = [ 12 | { 13 | name: 'mcagar', 14 | repository: 'buildrepo2', 15 | source: 'mcagar.zip', 16 | targets: [ 17 | { name: 'module/*.js', path: test }, 18 | { name: 'depend/*.js', path: test } 19 | ] 20 | } 21 | ]; 22 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/demo/css/demo.css: -------------------------------------------------------------------------------- 1 | blockquote { 2 | border-left: 3px solid rgba(0,0,0,.8); 3 | padding-left: 20px; 4 | margin: 0; 5 | } 6 | 7 | .mce-edit-focus { 8 | outline: 1px solid blue; 9 | } 10 | 11 | .tinymce { 12 | margin: 10px; 13 | padding: 10px; 14 | overflow: auto; 15 | border: 1px solid gray; 16 | } 17 | 18 | table, td { 19 | border: 1px dashed gray; 20 | } 21 | 22 | /*.mce-tinymce-inline { 23 | transition: left 50ms ease-in-out, top 50ms ease-in-out; 24 | } 25 | */ -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Demo.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*eslint no-console:0 */ 12 | 13 | define('tinymce/inlite/Demo', [ 14 | 'tinymce/inlite/Theme', 15 | 'global!tinymce' 16 | ], function(Theme, tinymce) { 17 | tinymce.init({ 18 | selector: 'div.tinymce', 19 | theme: 'inlite', 20 | plugins: 'image table link paste contextmenu textpattern autolink', 21 | insert_toolbar: 'quickimage quicktable', 22 | selection_toolbar: 'bold italic | quicklink h2 h3 blockquote', 23 | inline: true, 24 | paste_data_images: true 25 | }); 26 | 27 | return function() {}; 28 | }); 29 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Arr.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/alien/Arr', [ 12 | ], function () { 13 | var flatten = function (arr) { 14 | return arr.reduce(function (results, item) { 15 | return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item); 16 | }, []); 17 | }; 18 | 19 | return { 20 | flatten: flatten 21 | }; 22 | }); 23 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Uuid.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Generates unique ids this is the same as in core but since 13 | * it's not exposed as a global we can't access it. 14 | */ 15 | define("tinymce/inlite/alien/Uuid", [ 16 | ], function() { 17 | var count = 0; 18 | 19 | var seed = function () { 20 | var rnd = function () { 21 | return Math.round(Math.random() * 0xFFFFFFFF).toString(36); 22 | }; 23 | 24 | return 's' + Date.now().toString(36) + rnd() + rnd() + rnd(); 25 | }; 26 | 27 | var uuid = function (prefix) { 28 | return prefix + (count++) + seed(); 29 | }; 30 | 31 | return { 32 | uuid: uuid 33 | }; 34 | }); 35 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Convert.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/Convert', [ 12 | ], function () { 13 | var fromClientRect = function (clientRect) { 14 | return { 15 | x: clientRect.left, 16 | y: clientRect.top, 17 | w: clientRect.width, 18 | h: clientRect.height 19 | }; 20 | }; 21 | 22 | var toClientRect = function (geomRect) { 23 | return { 24 | left: geomRect.x, 25 | top: geomRect.y, 26 | width: geomRect.w, 27 | height: geomRect.h, 28 | right: geomRect.x + geomRect.w, 29 | bottom: geomRect.y + geomRect.h 30 | }; 31 | }; 32 | 33 | return { 34 | fromClientRect: fromClientRect, 35 | toClientRect: toClientRect 36 | }; 37 | }); 38 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ElementMatcher.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/ElementMatcher', [ 12 | 'tinymce/inlite/core/Matcher', 13 | 'tinymce/inlite/core/Measure' 14 | ], function (Matcher, Measure) { 15 | // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null) 16 | var element = function (element, predicateIds) { 17 | return function (editor) { 18 | for (var i = 0; i < predicateIds.length; i++) { 19 | if (predicateIds[i].predicate(element)) { 20 | return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element)); 21 | } 22 | } 23 | 24 | return null; 25 | }; 26 | }; 27 | 28 | // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null) 29 | var parent = function (elements, predicateIds) { 30 | return function (editor) { 31 | for (var i = 0; i < elements.length; i++) { 32 | for (var x = 0; x < predicateIds.length; x++) { 33 | if (predicateIds[x].predicate(elements[i])) { 34 | return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i])); 35 | } 36 | } 37 | } 38 | 39 | return null; 40 | }; 41 | }; 42 | 43 | return { 44 | element: element, 45 | parent: parent 46 | }; 47 | }); 48 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Matcher.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/Matcher', [ 12 | ], function () { 13 | // result :: String, Rect -> Matcher.result 14 | var result = function (id, rect) { 15 | return { 16 | id: id, 17 | rect: rect 18 | }; 19 | }; 20 | 21 | // match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null 22 | var match = function (editor, matchers) { 23 | for (var i = 0; i < matchers.length; i++) { 24 | var f = matchers[i]; 25 | var result = f(editor); 26 | 27 | if (result) { 28 | return result; 29 | } 30 | } 31 | 32 | return null; 33 | }; 34 | 35 | return { 36 | match: match, 37 | result: result 38 | }; 39 | }); 40 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Measure.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/Measure', [ 12 | 'global!tinymce.DOM', 13 | 'global!tinymce.geom.Rect', 14 | 'tinymce/inlite/core/Convert' 15 | ], function (DOM, Rect, Convert) { 16 | var toAbsolute = function (rect) { 17 | var vp = DOM.getViewPort(); 18 | 19 | return { 20 | x: rect.x + vp.x, 21 | y: rect.y + vp.y, 22 | w: rect.w, 23 | h: rect.h 24 | }; 25 | }; 26 | 27 | var measureElement = function (elm) { 28 | var clientRect = elm.getBoundingClientRect(); 29 | 30 | return toAbsolute({ 31 | x: clientRect.left, 32 | y: clientRect.top, 33 | w: Math.max(elm.clientWidth, elm.offsetWidth), 34 | h: Math.max(elm.clientHeight, elm.offsetHeight) 35 | }); 36 | }; 37 | 38 | var getElementRect = function (editor, elm) { 39 | return measureElement(elm); 40 | }; 41 | 42 | var getPageAreaRect = function (editor) { 43 | return measureElement(editor.getElement().ownerDocument.body); 44 | }; 45 | 46 | var getContentAreaRect = function (editor) { 47 | return measureElement(editor.getContentAreaContainer() || editor.getBody()); 48 | }; 49 | 50 | var getSelectionRect = function (editor) { 51 | var clientRect = editor.selection.getBoundingClientRect(); 52 | return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null; 53 | }; 54 | 55 | return { 56 | getElementRect: getElementRect, 57 | getPageAreaRect: getPageAreaRect, 58 | getContentAreaRect: getContentAreaRect, 59 | getSelectionRect: getSelectionRect 60 | }; 61 | }); 62 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js: -------------------------------------------------------------------------------- 1 | /** 2 | * PredicateId.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/PredicateId', [ 12 | 'global!tinymce.util.Tools' 13 | ], function (Tools) { 14 | var create = function (id, predicate) { 15 | return { 16 | id: id, 17 | predicate: predicate 18 | }; 19 | }; 20 | 21 | // fromContextToolbars :: [ContextToolbar] -> [PredicateId] 22 | var fromContextToolbars = function (toolbars) { 23 | return Tools.map(toolbars, function (toolbar) { 24 | return create(toolbar.id, toolbar.predicate); 25 | }); 26 | }; 27 | 28 | return { 29 | create: create, 30 | fromContextToolbars: fromContextToolbars 31 | }; 32 | }); 33 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SelectionMatcher.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/SelectionMatcher', [ 12 | 'tinymce/inlite/core/Matcher', 13 | 'tinymce/inlite/core/Measure' 14 | ], function (Matcher, Measure) { 15 | // textSelection :: String -> (Editor -> Matcher.result | Null) 16 | var textSelection = function (id) { 17 | return function (editor) { 18 | if (!editor.selection.isCollapsed()) { 19 | return Matcher.result(id, Measure.getSelectionRect(editor)); 20 | } 21 | 22 | return null; 23 | }; 24 | }; 25 | 26 | // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null) 27 | var emptyTextBlock = function (elements, id) { 28 | return function (editor) { 29 | var i, textBlockElementsMap = editor.schema.getTextBlockElements(); 30 | 31 | for (i = 0; i < elements.length; i++) { 32 | if (elements[i].nodeName === 'TABLE') { 33 | return null; 34 | } 35 | } 36 | 37 | for (i = 0; i < elements.length; i++) { 38 | if (elements[i].nodeName in textBlockElementsMap) { 39 | if (editor.dom.isEmpty(elements[i])) { 40 | return Matcher.result(id, Measure.getSelectionRect(editor)); 41 | } 42 | 43 | return null; 44 | } 45 | } 46 | 47 | return null; 48 | }; 49 | }; 50 | 51 | return { 52 | textSelection: textSelection, 53 | emptyTextBlock: emptyTextBlock 54 | }; 55 | }); 56 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SkinLoader.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/SkinLoader', [ 12 | 'global!tinymce.EditorManager', 13 | 'global!tinymce.DOM' 14 | ], function (EditorManager, DOM) { 15 | var fireSkinLoaded = function (editor, callback) { 16 | var done = function () { 17 | editor.fire('SkinLoaded'); 18 | callback(); 19 | }; 20 | 21 | if (editor.initialized) { 22 | done(); 23 | } else { 24 | editor.on('init', done); 25 | } 26 | }; 27 | 28 | var load = function (editor, skin, callback) { 29 | var baseUrl = EditorManager.baseURL; 30 | var skinUrl = baseUrl + '/skins/' + skin; 31 | 32 | var done = function () { 33 | fireSkinLoaded(editor, callback); 34 | }; 35 | 36 | DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done); 37 | editor.contentCSS.push(skinUrl + '/content.inline.min.css'); 38 | }; 39 | 40 | return { 41 | load: load 42 | }; 43 | }); 44 | 45 | 46 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UrlType.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/UrlType', [ 12 | ], function () { 13 | var isDomainLike = function (href) { 14 | return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim()); 15 | }; 16 | 17 | var isAbsolute = function (href) { 18 | return /^https?:\/\//.test(href.trim()); 19 | }; 20 | 21 | return { 22 | isDomainLike: isDomainLike, 23 | isAbsolute: isAbsolute 24 | }; 25 | }); 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Conversions.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/file/Conversions', [ 12 | 'global!tinymce.util.Promise' 13 | ], function (Promise) { 14 | var blobToBase64 = function (blob) { 15 | return new Promise(function(resolve) { 16 | var reader = new FileReader(); 17 | 18 | reader.onloadend = function() { 19 | resolve(reader.result.split(',')[1]); 20 | }; 21 | 22 | reader.readAsDataURL(blob); 23 | }); 24 | }; 25 | 26 | return { 27 | blobToBase64: blobToBase64 28 | }; 29 | }); 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Picker.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/file/Picker', [ 12 | 'global!tinymce.util.Promise' 13 | ], function (Promise) { 14 | var pickFile = function () { 15 | return new Promise(function (resolve) { 16 | var fileInput; 17 | 18 | fileInput = document.createElement("input"); 19 | fileInput.type = "file"; 20 | fileInput.style.position = 'fixed'; 21 | fileInput.style.left = 0; 22 | fileInput.style.top = 0; 23 | fileInput.style.opacity = 0.001; 24 | document.body.appendChild(fileInput); 25 | 26 | fileInput.onchange = function(e) { 27 | resolve(Array.prototype.slice.call(e.target.files)); 28 | }; 29 | 30 | fileInput.click(); 31 | fileInput.parentNode.removeChild(fileInput); 32 | }); 33 | }; 34 | 35 | return { 36 | pickFile: pickFile 37 | }; 38 | }); 39 | 40 | 41 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Buttons.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/ui/Buttons', [ 12 | 'tinymce/inlite/ui/Panel', 13 | 'tinymce/inlite/file/Conversions', 14 | 'tinymce/inlite/file/Picker', 15 | 'tinymce/inlite/core/Actions' 16 | ], function (Panel, Conversions, Picker, Actions) { 17 | var addHeaderButtons = function (editor) { 18 | var formatBlock = function (name) { 19 | return function () { 20 | Actions.formatBlock(editor, name); 21 | }; 22 | }; 23 | 24 | for (var i = 1; i < 6; i++) { 25 | var name = 'h' + i; 26 | 27 | editor.addButton(name, { 28 | text: name.toUpperCase(), 29 | tooltip: 'Heading ' + i, 30 | stateSelector: name, 31 | onclick: formatBlock(name), 32 | onPostRender: function () { 33 | // TODO: Remove this hack that produces bold H1-H6 when we have proper icons 34 | var span = this.getEl().firstChild.firstChild; 35 | span.style.fontWeight = 'bold'; 36 | } 37 | }); 38 | } 39 | }; 40 | 41 | var addToEditor = function (editor, panel) { 42 | editor.addButton('quicklink', { 43 | icon: 'link', 44 | tooltip: 'Insert/Edit link', 45 | stateSelector: 'a[href]', 46 | onclick: function () { 47 | panel.showForm(editor, 'quicklink'); 48 | } 49 | }); 50 | 51 | editor.addButton('quickimage', { 52 | icon: 'image', 53 | tooltip: 'Insert image', 54 | onclick: function () { 55 | Picker.pickFile().then(function (files) { 56 | var blob = files[0]; 57 | 58 | Conversions.blobToBase64(blob).then(function (base64) { 59 | Actions.insertBlob(editor, base64, blob); 60 | }); 61 | }); 62 | } 63 | }); 64 | 65 | editor.addButton('quicktable', { 66 | icon: 'table', 67 | tooltip: 'Insert table', 68 | onclick: function () { 69 | panel.hide(); 70 | Actions.insertTable(editor, 2, 2); 71 | } 72 | }); 73 | 74 | addHeaderButtons(editor); 75 | }; 76 | 77 | return { 78 | addToEditor: addToEditor 79 | }; 80 | }); 81 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "amd": true 5 | }, 6 | 7 | "globals": { 8 | "assert": true, 9 | "test": true, 10 | "asynctest": true 11 | }, 12 | 13 | "extends": "../../../../../../.eslintrc" 14 | } 15 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js: -------------------------------------------------------------------------------- 1 | test('atomic/alien/ArrTest', [ 2 | 'tinymce/inlite/alien/Arr' 3 | ], function (Arr) { 4 | var testFlatten = function () { 5 | assert.eq(Arr.flatten([1, 2, [3, 4, [5, 6]], [7, 8], 9]), [1, 2, 3, 4, 5, 6, 7, 8, 9]); 6 | }; 7 | 8 | testFlatten(); 9 | }); 10 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js: -------------------------------------------------------------------------------- 1 | test('atomic/alien/UuidTest', [ 2 | 'tinymce/inlite/alien/Uuid' 3 | ], function (Uuid) { 4 | var testUuid = function () { 5 | assert.eq(Uuid.uuid('mce').indexOf('mce'), 0); 6 | assert.eq(Uuid.uuid('mce') !== Uuid.uuid('mce'), true); 7 | }; 8 | 9 | testUuid(); 10 | }); 11 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js: -------------------------------------------------------------------------------- 1 | test('atomic/core/ConvertTest', [ 2 | 'tinymce/inlite/core/Convert' 3 | ], function (Convert) { 4 | var testConvert = function () { 5 | assert.eq({x: 1, y: 2, w: 3, h: 4}, Convert.fromClientRect({left: 1, top: 2, width: 3, height: 4})); 6 | assert.eq({x: 2, y: 3, w: 4, h: 5}, Convert.fromClientRect({left: 2, top: 3, width: 4, height: 5})); 7 | assert.eq({left: 1, top: 2, width: 3, height: 4, bottom: 2 + 4, right: 1 + 3}, Convert.toClientRect({x: 1, y: 2, w: 3, h: 4})); 8 | assert.eq({left: 2, top: 3, width: 4, height: 5, bottom: 3 + 5, right: 2 + 4}, Convert.toClientRect({x: 2, y: 3, w: 4, h: 5})); 9 | }; 10 | 11 | testConvert(); 12 | }); 13 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js: -------------------------------------------------------------------------------- 1 | test('browser/atomic/MatcherTest', [ 2 | 'tinymce/inlite/core/Matcher' 3 | ], function (Matcher) { 4 | var testMatch = function (mockEditor, matches, expectedResult) { 5 | var result; 6 | 7 | result = Matcher.match(mockEditor, matches); 8 | assert.eq(expectedResult, result); 9 | }; 10 | 11 | var match = function (key) { 12 | return function (editor) { 13 | return editor[key]; 14 | }; 15 | }; 16 | 17 | var testMatcher = function () { 18 | var mockEditor = { 19 | success1: 'success1', 20 | success2: 'success2', 21 | failure: null 22 | }; 23 | 24 | testMatch(mockEditor, [ 25 | match('success1') 26 | ], 'success1'); 27 | 28 | testMatch(mockEditor, [ 29 | match(null), 30 | match('success2') 31 | ], 'success2'); 32 | 33 | testMatch(mockEditor, [ 34 | match('success1'), 35 | match('success2') 36 | ], 'success1'); 37 | 38 | testMatch(mockEditor, [ 39 | match(null) 40 | ], null); 41 | 42 | testMatch(mockEditor, [ 43 | match(null), 44 | match(null) 45 | ], null); 46 | 47 | testMatch(mockEditor, [], null); 48 | }; 49 | 50 | testMatcher(); 51 | }); 52 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js: -------------------------------------------------------------------------------- 1 | test('atomic/core/UrlTypeTest', [ 2 | 'tinymce/inlite/core/UrlType' 3 | ], function (UrlType) { 4 | var testIsDomainLike = function () { 5 | var mostUsedTopLevelDomains = [ 6 | 'com', 'org', 'edu', 'gov', 'uk', 'net', 'ca', 'de', 'jp', 7 | 'fr', 'au', 'us', 'ru', 'ch', 'it', 'nl', 'se', 'no', 'es', 'mil' 8 | ]; 9 | 10 | assert.eq(UrlType.isDomainLike('www.site.com'), true); 11 | assert.eq(UrlType.isDomainLike('www.site.xyz'), true); 12 | assert.eq(UrlType.isDomainLike(' www.site.xyz'), true); 13 | assert.eq(UrlType.isDomainLike('site.xyz'), false); 14 | 15 | mostUsedTopLevelDomains.forEach(function (tld) { 16 | assert.eq(UrlType.isDomainLike('site.' + tld), true); 17 | assert.eq(UrlType.isDomainLike(' site.' + tld), true); 18 | assert.eq(UrlType.isDomainLike('site.' + tld + ' '), true); 19 | }); 20 | 21 | assert.eq(UrlType.isDomainLike('/a/b'), false); 22 | }; 23 | 24 | var testIsAbsoluteUrl = function () { 25 | assert.eq(UrlType.isAbsolute('http://www.site.com'), true); 26 | assert.eq(UrlType.isAbsolute('https://www.site.com'), true); 27 | assert.eq(UrlType.isAbsolute('www.site.com'), false); 28 | assert.eq(UrlType.isAbsolute('file.gif'), false); 29 | }; 30 | 31 | testIsDomainLike(); 32 | testIsAbsoluteUrl(); 33 | }); 34 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js: -------------------------------------------------------------------------------- 1 | asynctest('browser/alien/UnlinkTest', [ 2 | 'ephox.mcagar.api.TinyLoader', 3 | 'ephox.mcagar.api.TinyApis', 4 | 'tinymce/inlite/alien/Unlink', 5 | 'ephox.agar.api.Pipeline', 6 | 'ephox.agar.api.Step', 7 | 'ephox.agar.api.GeneralSteps' 8 | ], function (TinyLoader, TinyApis, Unlink, Pipeline, Step, GeneralSteps) { 9 | var success = arguments[arguments.length - 2]; 10 | var failure = arguments[arguments.length - 1]; 11 | 12 | var sUnlinkSelection = function (editor) { 13 | return Step.sync(function () { 14 | Unlink.unlinkSelection(editor); 15 | }); 16 | }; 17 | 18 | TinyLoader.setup(function (editor, onSuccess, onFailure) { 19 | var tinyApis = TinyApis(editor); 20 | 21 | var sAssertUnlink = function (inputHtml, startPath, startOffset, finishPath, finishOffset, expectedHtml) { 22 | return GeneralSteps.sequence([ 23 | tinyApis.sSetContent(inputHtml), 24 | tinyApis.sSetSelection(startPath, startOffset, finishPath, finishOffset), 25 | sUnlinkSelection(editor), 26 | tinyApis.sAssertContent(expectedHtml, 'Should match expected anchor less html') 27 | ]); 28 | }; 29 | 30 | Pipeline.async({}, [ 31 | sAssertUnlink('

a

', [0, 0, 0], 0, [0, 0, 0], 1, '

a

'), 32 | sAssertUnlink('

ab

', [0, 0, 0], 0, [0, 1], 1, '

ab

'), 33 | sAssertUnlink('

a

b', [0, 0, 0], 0, [0, 0, 0], 1, '

a

\n

b

'), 34 | sAssertUnlink('

a

b', [0, 0, 0], 0, [1, 0, 0], 1, '

a

\n

b

') 35 | ], onSuccess, onFailure); 36 | }, { 37 | }, success, failure); 38 | }); 39 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js: -------------------------------------------------------------------------------- 1 | asynctest('browser/core/ElementMatcherTest', [ 2 | 'ephox.mcagar.api.TinyLoader', 3 | 'ephox.mcagar.api.TinyApis', 4 | 'ephox.agar.api.Step', 5 | 'ephox.agar.api.Assertions', 6 | 'tinymce/inlite/core/ElementMatcher', 7 | 'tinymce/inlite/core/PredicateId', 8 | 'ephox.agar.api.Pipeline' 9 | ], function (TinyLoader, TinyApis, Step, Assertions, ElementMatcher, PredicateId, Pipeline) { 10 | var success = arguments[arguments.length - 2]; 11 | var failure = arguments[arguments.length - 1]; 12 | 13 | var eq = function (target) { 14 | return function (elm) { 15 | return elm === target; 16 | }; 17 | }; 18 | 19 | var constantFalse = function (/*elm*/) { 20 | return false; 21 | }; 22 | 23 | var sElementTest = function (tinyApis, editor, inputHtml, selector) { 24 | return Step.sync(function () { 25 | var target, result; 26 | 27 | editor.setContent(inputHtml); 28 | target = editor.dom.select(selector)[0]; 29 | 30 | result = ElementMatcher.element(target, [ 31 | PredicateId.create('a', constantFalse), 32 | PredicateId.create('b', eq(target)) 33 | ])(editor); 34 | 35 | Assertions.assertEq(result.id, 'b', 'Should be matching B'); 36 | Assertions.assertEq(result.rect.w > 0, true, 'Should be have width'); 37 | }); 38 | }; 39 | 40 | var sParentTest = function (tinyApis, editor, inputHtml, selector) { 41 | return Step.sync(function () { 42 | var target, parents, result; 43 | 44 | editor.setContent(inputHtml); 45 | target = editor.dom.select(selector)[0]; 46 | parents = editor.dom.getParents(target); 47 | 48 | result = ElementMatcher.parent(parents, [ 49 | PredicateId.create('a', constantFalse), 50 | PredicateId.create('b', eq(parents[1])), 51 | PredicateId.create('c', eq(parents[0])) 52 | ])(editor); 53 | 54 | Assertions.assertEq(result.id, 'c', 'Should be matching C the closest one'); 55 | Assertions.assertEq(result.rect.w > 0, true, 'Should be have width'); 56 | }); 57 | }; 58 | 59 | TinyLoader.setup(function (editor, onSuccess, onFailure) { 60 | var tinyApis = TinyApis(editor); 61 | 62 | Pipeline.async({}, [ 63 | sElementTest(tinyApis, editor, '

a

', 'p'), 64 | sParentTest(tinyApis, editor, '

a

', 'em') 65 | ], onSuccess, onFailure); 66 | }, { 67 | inline: true 68 | }, success, failure); 69 | }); 70 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js: -------------------------------------------------------------------------------- 1 | asynctest('browser/core/MeasureTest', [ 2 | 'ephox.mcagar.api.TinyLoader', 3 | 'tinymce/inlite/core/Measure', 4 | 'ephox.agar.api.Pipeline', 5 | 'ephox.mcagar.api.TinyApis', 6 | 'ephox.agar.api.Step', 7 | 'ephox.agar.api.Chain', 8 | 'ephox.agar.api.UiFinder', 9 | 'ephox.agar.api.Assertions' 10 | ], function (TinyLoader, Measure, Pipeline, TinyApis, Step, Chain, UiFinder, Assertions) { 11 | var success = arguments[arguments.length - 2]; 12 | var failure = arguments[arguments.length - 1]; 13 | 14 | var containsXY = function (r, x, y) { 15 | return x >= r.x && x <= r.x + r.w && y >= r.y && y <= r.y + r.h; 16 | }; 17 | 18 | var contains = function (a, b) { 19 | return containsXY(a, b.x, b.y) && containsXY(a, b.x + b.w, b.y + b.h); 20 | }; 21 | 22 | var sAssertRect = function (editor, measure) { 23 | return Step.sync(function () { 24 | var elementRect = measure(); 25 | var pageAreaRect = Measure.getPageAreaRect(editor); 26 | var contentAreaRect = Measure.getContentAreaRect(editor); 27 | 28 | Assertions.assertEq('Rect is not in page area rect', contains(pageAreaRect, elementRect), true); 29 | Assertions.assertEq('Rect is not in content area rect', contains(contentAreaRect, elementRect), true); 30 | Assertions.assertEq('Rect should have width', elementRect.w > 0, true); 31 | Assertions.assertEq('Rect should have height', elementRect.h > 0, true); 32 | }); 33 | }; 34 | 35 | var getElementRectFromSelector = function (editor, selector) { 36 | return function () { 37 | var elm = editor.dom.select(selector)[0]; 38 | var rect = Measure.getElementRect(editor, elm); 39 | return rect; 40 | }; 41 | }; 42 | 43 | var getSelectionRectFromSelector = function (editor) { 44 | return function () { 45 | var rect = Measure.getSelectionRect(editor); 46 | return rect; 47 | }; 48 | }; 49 | 50 | TinyLoader.setup(function (editor, onSuccess, onFailure) { 51 | var tinyApis = TinyApis(editor); 52 | 53 | Pipeline.async({}, [ 54 | tinyApis.sSetContent('

a

b

c

'), 55 | sAssertRect(editor, getElementRectFromSelector(editor, 'p:nth-child(1)')), 56 | tinyApis.sSetCursor([0, 0], 0), 57 | sAssertRect(editor, getSelectionRectFromSelector(editor)) 58 | ], onSuccess, onFailure); 59 | }, { 60 | inline: true 61 | }, success, failure); 62 | }); 63 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js: -------------------------------------------------------------------------------- 1 | test('browser/core/PredicateIdTest', [ 2 | 'ephox/tinymce', 3 | 'tinymce/inlite/core/PredicateId' 4 | ], function (tinymce, PredicateId) { 5 | var testFromContextToolbars = function () { 6 | var isTrue = function () { 7 | return true; 8 | }; 9 | 10 | var isFalse = function () { 11 | return false; 12 | }; 13 | 14 | var predIds = PredicateId.fromContextToolbars([ 15 | {toolbar: 'a b c', predicate: isTrue, id: 'a'}, 16 | {toolbar: 'd e', predicate: isFalse, id: 'b'} 17 | ]); 18 | 19 | assert.eq([ 20 | PredicateId.create('a', isTrue), 21 | PredicateId.create('b', isFalse) 22 | ], predIds); 23 | }; 24 | 25 | testFromContextToolbars(); 26 | }); 27 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js: -------------------------------------------------------------------------------- 1 | asynctest('atomic/core/ConvertTest', [ 2 | 'ephox/tinymce', 3 | 'tinymce/inlite/file/Conversions', 4 | 'ephox.agar.api.Step', 5 | 'ephox.agar.api.Pipeline', 6 | 'ephox.agar.api.Assertions' 7 | ], function (tinymce, Conversions, Step, Pipeline, Assertions) { 8 | var success = arguments[arguments.length - 2]; 9 | var failure = arguments[arguments.length - 1]; 10 | 11 | var base64ToBlob = function (base64, type) { 12 | var buff = atob(base64); 13 | var bytes = new Uint8Array(buff.length); 14 | 15 | for (var i = 0; i < bytes.length; i++) { 16 | bytes[i] = buff.charCodeAt(i); 17 | } 18 | 19 | return new Blob([bytes], {type: type}); 20 | }; 21 | 22 | var sBlobToBase64 = function () { 23 | return Step.async(function (next) { 24 | var base64 = 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; 25 | var blob = base64ToBlob(base64, 'image/gif'); 26 | 27 | Conversions.blobToBase64(blob).then(function (convertedBase64) { 28 | Assertions.assertEq('Not the correct base64', base64, convertedBase64); 29 | next(); 30 | }); 31 | }); 32 | }; 33 | 34 | Pipeline.async({}, [ 35 | sBlobToBase64() 36 | ], function () { 37 | success(); 38 | }, function () { 39 | failure(); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /public/js/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SelectionMatcher.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/SelectionMatcher', [ 12 | 'tinymce/inlite/core/Matcher', 13 | 'tinymce/inlite/core/Measure' 14 | ], function (Matcher, Measure) { 15 | // textSelection :: String -> (Editor -> Matcher.result | Null) 16 | var textSelection = function (id) { 17 | return function (editor) { 18 | if (!editor.selection.isCollapsed()) { 19 | return Matcher.result(id, Measure.getSelectionRect(editor)); 20 | } 21 | 22 | return null; 23 | }; 24 | }; 25 | 26 | // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null) 27 | var emptyTextBlock = function (elements, id) { 28 | return function (editor) { 29 | var i, textBlockElementsMap = editor.schema.getTextBlockElements(); 30 | 31 | for (i = 0; i < elements.length; i++) { 32 | if (elements[i].nodeName === 'TABLE') { 33 | return null; 34 | } 35 | } 36 | 37 | for (i = 0; i < elements.length; i++) { 38 | if (elements[i].nodeName in textBlockElementsMap) { 39 | if (editor.dom.isEmpty(elements[i])) { 40 | return Matcher.result(id, Measure.getSelectionRect(editor)); 41 | } 42 | 43 | return null; 44 | } 45 | } 46 | 47 | return null; 48 | }; 49 | }; 50 | 51 | return { 52 | textSelection: textSelection, 53 | emptyTextBlock: emptyTextBlock 54 | }; 55 | }); 56 | -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/arrows-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/arrows-active.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/arrows-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/arrows-normal.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/crop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/crop.gif -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/dialogs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/dialogs.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/icons-big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/icons-big.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/icons-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/icons-small.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/logo.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/progress.gif -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/quicklook-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/quicklook-bg.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/quicklook-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/quicklook-icons.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/resize.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/spinner-mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/spinner-mini.gif -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/toolbar.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/volume_icon_dropbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/volume_icon_dropbox.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/volume_icon_ftp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/volume_icon_ftp.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/volume_icon_googledrive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/volume_icon_googledrive.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/volume_icon_local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/volume_icon_local.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/img/volume_icon_sql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netcan/HFUT_ChemLab/c217936a4c74f649e535ec36d50b9d44f548e5ed/public/packages/barryvdh/elfinder/img/volume_icon_sql.png -------------------------------------------------------------------------------- /public/packages/barryvdh/elfinder/js/extras/quicklook.googledocs.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | try { 4 | if (! elFinder.prototype.commands.quicklook.plugins) { 5 | elFinder.prototype.commands.quicklook.plugins = []; 6 | } 7 | elFinder.prototype.commands.quicklook.plugins.push(function(ql) { 8 | var fm = ql.fm, 9 | preview = ql.preview; 10 | 11 | preview.on('update', function(e) { 12 | var win = ql.window, 13 | file = e.file, node, loading; 14 | 15 | if (file.mime.indexOf('application/vnd.google-apps.') === 0) { 16 | if (file.url == '1') { 17 | $('
').appendTo(ql.info.find('.elfinder-quicklook-info')) 18 | .on('click', function() { 19 | $(this).html(''); 20 | fm.request({ 21 | data : {cmd : 'url', target : file.hash}, 22 | preventDefault : true 23 | }) 24 | .always(function() { 25 | $(this).html(''); 26 | }) 27 | .done(function(data) { 28 | var rfile = fm.file(file.hash); 29 | ql.value.url = rfile.url = data.url || ''; 30 | if (ql.value.url) { 31 | preview.trigger($.Event('update', {file : ql.value})); 32 | } 33 | }); 34 | }); 35 | } 36 | if (file.url !== '' && file.url != '1') { 37 | e.stopImmediatePropagation(); 38 | preview.one('change', function() { 39 | loading.remove(); 40 | node.off('load').remove(); 41 | }); 42 | 43 | loading = $('
Now loading...
').appendTo(ql.info.find('.elfinder-quicklook-info')); 44 | 45 | node = $('