From 86d8ae81ec27ce788147946c95922df0c9902b85 Mon Sep 17 00:00:00 2001 From: Naeltard Date: Wed, 1 Apr 2015 20:52:52 +0200 Subject: [PATCH] readded submodules for slingit --- system/.gitignore | 3 + system/api/api.php | 219 + system/api/api_default.php | 24 + system/api/api_login.php | 30 + system/api/api_system.php | 22 + system/api/autoload.inc.php | 2 + system/api/verify.php | 20 + system/autoload.inc.php | 23 + system/cache/autoload.inc.php | 2 + system/cache/cache.php | 30 + system/config/autoload.inc.php | 2 + system/config/config.php | 28 + system/config/config_ids.php | 33 + system/cron/autoload.inc.php | 2 + system/cron/cron.php | 58 + system/cron/cron_log2sqlite.php | 70 + system/cron/cronjob.php | 6 + system/cron/cronstatus.php | 29 + system/cron/crontime.php | 58 + system/db/autoload.inc.php | 6 + system/db/connection/Connection.php | 47 + system/db/connection/ConnectionAMQP.php | 66 + system/db/connection/ConnectionAbstr.php | 28 + system/db/connection/ConnectionMYS.php | 56 + system/db/connection/ConnectionPG.php | 61 + system/db/connection/ConnectionSQLite.php | 48 + system/db/dbinfo/DBInfo.php | 13 + system/db/dbinfo/DBInfoAMQP.php | 19 + system/db/dbinfo/DBInfoMYS.php | 19 + system/db/dbinfo/DBInfoPG.php | 19 + system/db/dbinfo/DBInfoSQLite.php | 15 + system/db/qq/QP.php | 35 + system/db/qq/QQ.php | 34 + system/db/qq/QQuery.php | 16 + system/db/result/Result.php | 16 + system/db/result/ResultAMQP.php | 37 + system/db/result/ResultMysqli.php | 37 + system/db/result/ResultMysqliPrepare.php | 58 + system/db/result/ResultPostgres.php | 39 + system/db/result/ResultSQLite.php | 81 + system/dbd/autoload.inc.php | 3 + system/dbd/qq/SYS_API_TREE.php | 15 + system/dbd/qq/SYS_CACHE_CHECK.php | 12 + system/dbd/qq/SYS_CACHE_DELETE.php | 12 + system/dbd/qq/SYS_CACHE_PUT.php | 11 + system/dbd/qq/SYS_CRON_GET.php | 11 + system/dbd/qq/SYS_CRON_LAST_VISIT.php | 11 + system/dbd/qq/SYS_CRON_LIST.php | 11 + system/dbd/qq/SYS_CRON_UPD.php | 11 + system/dbd/qq/SYS_LOCALE_SET_LOCALE.php | 15 + system/dbd/qq/SYS_LOG_INSERT.php | 30 + system/dbd/qq/SYS_LOG_MONTH.php | 11 + system/dbd/qq/SYS_LOG_MONTH_DEL.php | 11 + system/dbd/qq/SYS_LOG_OLDEST.php | 11 + system/dbd/qq/SYS_PAGE_GROUP.php | 17 + system/dbd/qq/SYS_SECURITY_AVAILABLE.php | 13 + system/dbd/qq/SYS_SECURITY_CHECK.php | 15 + system/dbd/qq/SYS_SECURITY_CREATE.php | 17 + system/dbd/qq/SYS_SECURITY_LOGIN_MD5.php | 15 + system/dbd/qq/SYS_SECURITY_LOGIN_SHA1.php | 15 + .../dbd/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php | 19 + system/dbd/qq/SYS_SECURITY_UPDATE_PW.php | 15 + .../sql/mysql/data/basic_locale_string.sql | 26 + system/dbd/sql/mysql/data/sai_api.sql | 151 + .../mysql/data/sai_error_locale_string.sql | 9 + .../dbd/sql/mysql/data/sai_locale_string.sql | 2 + system/dbd/sql/mysql/data/system_api.sql | 25 + .../dbd/sql/mysql/data/system_api_default.sql | 2 + system/dbd/sql/mysql/data/system_cron.sql | 1 + system/dbd/sql/mysql/data/system_rights.sql | 13 + system/dbd/sql/mysql/schema/system_api.sql | 12 + system/dbd/sql/mysql/schema/system_cache.sql | 9 + system/dbd/sql/mysql/schema/system_cron.sql | 13 + .../sql/mysql/schema/system_locale_string.sql | 10 + system/dbd/sql/mysql/schema/system_log.sql | 24 + system/dbd/sql/mysql/schema/system_page.sql | 11 + system/dbd/sql/mysql/schema/system_rights.sql | 9 + system/dbd/sql/mysql/schema/system_todo.sql | 29 + system/dbd/sql/mysql/schema/system_user.sql | 15 + .../mysql/schema/system_user_to_rights.sql | 7 + .../dbd/sql/pg/data/basic_locale_string.sql | 23 + system/dbd/sql/pg/data/sai_api.sql | 129 + .../sql/pg/data/sai_error_locale_string.sql | 9 + system/dbd/sql/pg/data/sai_locale_string.sql | 2 + system/dbd/sql/pg/data/system_api.sql | 19 + system/dbd/sql/pg/data/system_rights.sql | 13 + system/dbd/sql/pg/schema/schema.sql | 2 + system/dbd/sql/pg/schema/system_api.sql | 16 + system/dbd/sql/pg/schema/system_cache.sql | 32 + system/dbd/sql/pg/schema/system_cron.sql | 17 + .../sql/pg/schema/system_locale_string.sql | 13 + system/dbd/sql/pg/schema/system_log.sql | 30 + system/dbd/sql/pg/schema/system_rights.sql | 12 + system/dbd/sql/pg/schema/system_todo.sql | 34 + system/dbd/sql/pg/schema/system_user.sql | 18 + .../sql/pg/schema/system_user_to_rights.sql | 16 + .../sql/pg/util_copy_api_table_by_groupa.sql | 13 + system/dbd/tbl/UserLoginsTable.php | 14 + system/dbd/tbl/UserRightsTable.php | 12 + system/dbd/tbl/system_api.php | 22 + system/dbd/tbl/system_cron.php | 18 + system/dbd/tbl/system_locale_string.php | 22 + system/dbd/tbl/system_log.php | 26 + system/dbd/tbl/system_page.php | 15 + system/dbd/tbl/system_todo.php | 35 + system/dbd/tbl/system_user.php | 19 + system/docu/apiclass/ApiClass.php | 345 + system/docu/apiclass/ApiVerify.php | 17 + system/docu/apiclass/PageApi.php | 110 + system/docu/autoload.inc.php | 4 + system/docu/code_docu.php | 63 + system/docu/docu.php | 25 + system/docu/docu_categories.php | 6 + system/docu/index/api.php | 119 + system/docu/index/index.php | 36 + system/docu/register_sys_docu.php | 2 + system/docu/system/1.system.md | 32 + system/docu/system/2.license.md | 21 + system/docu/system/3.getting started.md | 88 + system/docu/system/system.api.md | 69 + system/docu/system/system.cache.md | 2 + system/docu/system/system.config.md | 2 + system/docu/system/system.db.md | 2 + system/docu/system/system.db.qq.md | 76 + system/docu/system/system.docu.md | 0 system/docu/system/system.log.md | 0 system/docu/system/system.page.md | 0 system/docu/system/system.sai.md | 0 system/docu/system/system.security.md | 0 system/docu/system/system.system.md | 188 + system/files/autoload.inc.php | 3 + system/files/files.php | 81 + system/files/sys/system.js | 134 + system/lib/EpicEditor/js/epiceditor.js | 2899 ++++++++ system/lib/EpicEditor/js/epiceditor.min.js | 5 + .../lib/EpicEditor/themes/base/epiceditor.css | 70 + .../EpicEditor/themes/editor/epic-dark.css | 13 + .../EpicEditor/themes/editor/epic-light.css | 12 + .../lib/EpicEditor/themes/preview/bartik.css | 167 + .../lib/EpicEditor/themes/preview/github.css | 368 + .../themes/preview/preview-dark.css | 121 + system/lib/Michelf/Markdown.php | 3096 +++++++++ system/lib/Michelf/MarkdownExtra.php | 40 + system/lib/Michelf/extra/License.md | 36 + system/lib/Michelf/extra/Readme.md | 259 + system/lib/Michelf/extra/Readme.php | 31 + system/lib/Michelf/extra/composer.json | 31 + system/lib/autoload.inc.php | 2 + system/log/autoload.inc.php | 5 + system/log/error_handler/error_handler.php | 12 + .../error_handler/error_handler_dbwriter.php | 31 + .../error_handler_jsonoutput.php | 15 + system/log/exceptions/COUNTER.php | 5 + system/log/exceptions/CRON.php | 5 + system/log/exceptions/DEPRECATED.php | 4 + system/log/exceptions/ERROR.php | 4 + system/log/exceptions/ERROR_EXCEPTION.php | 4 + system/log/exceptions/INFO.php | 5 + system/log/exceptions/SHUTDOWN_EXCEPTION.php | 4 + .../log/exceptions/SYSTEM_ERROR_EXCEPTION.php | 11 + system/log/exceptions/SYSTEM_EXCEPTION.php | 12 + system/log/exceptions/TODO.php | 8 + system/log/exceptions/TranslatableError.php | 13 + system/log/exceptions/WARNING.php | 4 + system/log/exceptions_shortcut/DEPRECATED.php | 2 + system/log/exceptions_shortcut/ERROR.php | 2 + system/log/exceptions_shortcut/INFO.php | 3 + system/log/exceptions_shortcut/TODO.php | 2 + system/log/exceptions_shortcut/WARNING.php | 2 + system/log/log.php | 52 + system/log/register_exception_shortcut.php | 2 + system/log/register_result_shortcut.php | 2 + system/log/result/AbstractResult.php | 15 + system/log/result/JsonResult.php | 54 + system/log/result_shortcut/JsonResult.php | 3 + system/page/Page.php | 9 + system/page/State.php | 21 + system/page/autoload.inc.php | 2 + system/page/replace.php | 21 + system/readme.md | 26 + system/sai/autoload.inc.php | 5 + system/sai/js/crypto/jquery.md5.js | 269 + system/sai/js/crypto/jquery.sha1.js | 170 + system/sai/js/jqBootstrapValidation.js | 912 +++ system/sai/modules/autoload.inc | 16 + .../sai/modules/saimod_sys_api/autoload.inc | 5 + .../saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php | 11 + .../saimod_sys_api/qq/SYS_SAIMOD_API_DEL.php | 11 + .../qq/SYS_SAIMOD_API_SINGLE_SELECT.php | 11 + .../modules/saimod_sys_api/saimod_sys_api.css | 64 + .../modules/saimod_sys_api/saimod_sys_api.js | 98 + .../modules/saimod_sys_api/saimod_sys_api.php | 104 + .../saimod_sys_api/tpl/delete_dialog.tpl | 26 + .../modules/saimod_sys_api/tpl/list_entry.tpl | 9 + system/sai/modules/saimod_sys_api/tpl/tab.tpl | 14 + .../sai/modules/saimod_sys_api/tpl/tabopt.tpl | 1 + .../sai/modules/saimod_sys_api/tpl/tabs.tpl | 36 + .../sai/modules/saimod_sys_cache/autoload.inc | 5 + system/sai/modules/saimod_sys_cache/qq/dummy | 0 .../saimod_sys_cache/saimod_sys_cache.php | 48 + .../modules/saimod_sys_config/autoload.inc | 5 + system/sai/modules/saimod_sys_config/qq/dummy | 0 .../saimod_sys_config/saimod_sys_config.php | 41 + .../sai/modules/saimod_sys_cron/autoload.inc | 5 + .../saimod_sys_cron/css/saimod_sys_cron.css | 64 + .../saimod_sys_cron/js/saimod_sys_cron.js | 83 + .../saimod_sys_cron/qq/SYS_SAIMOD_CRON.php | 11 + .../qq/SYS_SAIMOD_CRON_ADD.php | 12 + .../qq/SYS_SAIMOD_CRON_CHANGE.php | 11 + .../qq/SYS_SAIMOD_CRON_DEL.php | 11 + .../qq/SYS_SAIMOD_CRON_SINGLE_SELECT.php | 11 + .../saimod_sys_cron/saimod_sys_cron.php | 52 + .../saimod_sys_cron/tpl/list_entry.tpl | 23 + .../sai/modules/saimod_sys_cron/tpl/tabs.tpl | 35 + .../sai/modules/saimod_sys_docu/autoload.inc | 5 + system/sai/modules/saimod_sys_docu/qq/dummy | 0 .../saimod_sys_docu/saimod_sys_docu.js | 16 + .../saimod_sys_docu/saimod_sys_docu.php | 53 + .../sai/modules/saimod_sys_docu/tpl/tab.tpl | 12 + .../sai/modules/saimod_sys_docu/tpl/tab2.tpl | 8 + .../modules/saimod_sys_docu/tpl/tabopt.tpl | 1 + .../sai/modules/saimod_sys_docu/tpl/tabs.tpl | 10 + .../sai/modules/saimod_sys_files/autoload.inc | 5 + system/sai/modules/saimod_sys_files/qq/dummy | 0 .../saimod_sys_files/saimod_sys_files.js | 59 + .../saimod_sys_files/saimod_sys_files.php | 52 + .../saimod_sys_files/tpl/saimod_sys_files.tpl | 10 + .../tpl/saimod_sys_files_tab.tpl | 1 + .../tpl/saimod_sys_files_tabfull.tpl | 16 + .../tpl/saimod_sys_files_tableentry.tpl | 12 + .../tpl/saimod_sys_files_tabopt.tpl | 1 + .../modules/saimod_sys_locale/autoload.inc | 5 + .../qq/SYS_SAIMOD_LOCALE_ADD.php | 11 + .../qq/SYS_SAIMOD_LOCALE_CATEGORY.php | 11 + .../qq/SYS_SAIMOD_LOCALE_DEL.php | 11 + .../qq/SYS_SAIMOD_LOCALE_ID.php | 11 + .../qq/SYS_SAIMOD_LOCALE_SELECT.php | 11 + .../qq/SYS_SAIMOD_LOCALE_SELECT_LANG.php | 11 + .../saimod_sys_locale/saimod_sys_locale.js | 275 + .../saimod_sys_locale/saimod_sys_locale.php | 94 + .../saimod_sys_locale/tinymce/LICENSE.TXT | 504 ++ .../tinymce/jquery.tinymce.min.js | 1 + .../saimod_sys_locale/tinymce/langs/readme.md | 3 + .../tinymce/plugins/advlist/plugin.min.js | 1 + .../tinymce/plugins/anchor/plugin.min.js | 1 + .../tinymce/plugins/autolink/plugin.min.js | 1 + .../tinymce/plugins/autoresize/plugin.min.js | 1 + .../tinymce/plugins/autosave/plugin.min.js | 1 + .../tinymce/plugins/bbcode/plugin.min.js | 1 + .../tinymce/plugins/charmap/plugin.min.js | 1 + .../tinymce/plugins/code/plugin.min.js | 1 + .../tinymce/plugins/contextmenu/plugin.min.js | 1 + .../plugins/directionality/plugin.min.js | 1 + .../plugins/emoticons/img/smiley-cool.gif | Bin 0 -> 354 bytes .../plugins/emoticons/img/smiley-cry.gif | Bin 0 -> 329 bytes .../emoticons/img/smiley-embarassed.gif | Bin 0 -> 331 bytes .../emoticons/img/smiley-foot-in-mouth.gif | Bin 0 -> 342 bytes .../plugins/emoticons/img/smiley-frown.gif | Bin 0 -> 340 bytes .../plugins/emoticons/img/smiley-innocent.gif | Bin 0 -> 336 bytes .../plugins/emoticons/img/smiley-kiss.gif | Bin 0 -> 338 bytes .../plugins/emoticons/img/smiley-laughing.gif | Bin 0 -> 343 bytes .../emoticons/img/smiley-money-mouth.gif | Bin 0 -> 321 bytes .../plugins/emoticons/img/smiley-sealed.gif | Bin 0 -> 323 bytes .../plugins/emoticons/img/smiley-smile.gif | Bin 0 -> 344 bytes .../emoticons/img/smiley-surprised.gif | Bin 0 -> 338 bytes .../emoticons/img/smiley-tongue-out.gif | Bin 0 -> 328 bytes .../emoticons/img/smiley-undecided.gif | Bin 0 -> 337 bytes .../plugins/emoticons/img/smiley-wink.gif | Bin 0 -> 350 bytes .../plugins/emoticons/img/smiley-yell.gif | Bin 0 -> 336 bytes .../tinymce/plugins/emoticons/plugin.min.js | 1 + .../tinymce/plugins/example/plugin.min.js | 1 + .../plugins/example_dependency/plugin.min.js | 1 + .../tinymce/plugins/fullpage/plugin.min.js | 1 + .../tinymce/plugins/fullscreen/plugin.min.js | 1 + .../tinymce/plugins/hr/plugin.min.js | 1 + .../tinymce/plugins/image/plugin.min.js | 1 + .../tinymce/plugins/importcss/plugin.min.js | 1 + .../plugins/insertdatetime/plugin.min.js | 1 + .../tinymce/plugins/layer/plugin.min.js | 1 + .../plugins/legacyoutput/plugin.min.js | 1 + .../tinymce/plugins/link/plugin.min.js | 1 + .../tinymce/plugins/lists/plugin.min.js | 1 + .../tinymce/plugins/media/moxieplayer.swf | Bin 0 -> 20017 bytes .../tinymce/plugins/media/plugin.min.js | 1 + .../plugins/moxiemanager/plugin.min.js | 1 + .../tinymce/plugins/nonbreaking/plugin.min.js | 1 + .../tinymce/plugins/noneditable/plugin.min.js | 1 + .../tinymce/plugins/pagebreak/plugin.min.js | 1 + .../tinymce/plugins/paste/plugin.min.js | 1 + .../tinymce/plugins/preview/plugin.min.js | 1 + .../tinymce/plugins/print/plugin.min.js | 1 + .../tinymce/plugins/save/plugin.min.js | 1 + .../plugins/searchreplace/plugin.min.js | 1 + .../plugins/spellchecker/plugin.min.js | 1 + .../tinymce/plugins/tabfocus/plugin.min.js | 1 + .../tinymce/plugins/table/plugin.min.js | 1 + .../tinymce/plugins/template/plugin.min.js | 1 + .../tinymce/plugins/textcolor/plugin.min.js | 1 + .../plugins/visualblocks/css/visualblocks.css | 128 + .../plugins/visualblocks/plugin.min.js | 1 + .../tinymce/plugins/visualchars/plugin.min.js | 1 + .../tinymce/plugins/wordcount/plugin.min.js | 1 + .../skins/lightgray/content.inline.min.css | 1 + .../tinymce/skins/lightgray/content.min.css | 1 + .../skins/lightgray/fonts/icomoon-small.eot | Bin 0 -> 8344 bytes .../skins/lightgray/fonts/icomoon-small.svg | 175 + .../skins/lightgray/fonts/icomoon-small.ttf | Bin 0 -> 8160 bytes .../skins/lightgray/fonts/icomoon-small.woff | Bin 0 -> 8336 bytes .../tinymce/skins/lightgray/fonts/icomoon.eot | Bin 0 -> 8268 bytes .../tinymce/skins/lightgray/fonts/icomoon.svg | 153 + .../tinymce/skins/lightgray/fonts/icomoon.ttf | Bin 0 -> 8104 bytes .../skins/lightgray/fonts/icomoon.woff | Bin 0 -> 8400 bytes .../tinymce/skins/lightgray/fonts/readme.md | 1 + .../tinymce/skins/lightgray/img/anchor.gif | Bin 0 -> 53 bytes .../tinymce/skins/lightgray/img/loader.gif | Bin 0 -> 2608 bytes .../tinymce/skins/lightgray/img/object.gif | Bin 0 -> 152 bytes .../tinymce/skins/lightgray/img/trans.gif | Bin 0 -> 43 bytes .../tinymce/skins/lightgray/img/wline.gif | Bin 0 -> 46 bytes .../skins/lightgray/skin.ie7.min.css.noie | 1 + .../tinymce/skins/lightgray/skin.min.css | 1 + .../tinymce/themes/modern/theme.min.js | 1 + .../saimod_sys_locale/tinymce/tinymce.min.js | 9 + .../modules/saimod_sys_locale/tpl/entry.tpl | 4 + .../saimod_sys_locale/tpl/lang_tabs.tpl | 9 + .../saimod_sys_locale/tpl/langtabopt.tpl | 1 + .../saimod_sys_locale/tpl/langtabs.tpl | 7 + .../sai/modules/saimod_sys_locale/tpl/tab.tpl | 8 + .../modules/saimod_sys_locale/tpl/tabopt.tpl | 1 + .../modules/saimod_sys_locale/tpl/tabs.tpl | 49 + .../sai/modules/saimod_sys_log/autoload.inc | 5 + .../saimod_sys_log/img/ajax-loader.gif | Bin 0 -> 723 bytes .../saimod_sys_log/js/saimod_sys_log.js | 96 + .../qq/SYS_SAIMOD_LOG_BASIC_QUERYTIME.php | 30 + .../qq/SYS_SAIMOD_LOG_BASIC_SUCCESS.php | 52 + .../qq/SYS_SAIMOD_LOG_BASIC_VISITOR.php | 26 + .../qq/SYS_SAIMOD_LOG_CLASS_BASIC.php | 32 + .../qq/SYS_SAIMOD_LOG_CLASS_OTHER.php | 28 + .../qq/SYS_SAIMOD_LOG_CLASS_SYSTEM.php | 36 + .../qq/SYS_SAIMOD_LOG_ERROR.php | 20 + .../qq/SYS_SAIMOD_LOG_FILTER.php | 21 + .../qq/SYS_SAIMOD_LOG_FILTERS.php | 18 + .../qq/SYS_SAIMOD_LOG_FILTER_COUNT.php | 17 + .../qq/SYS_SAIMOD_LOG_TRUNCATE.php | 12 + .../qq/SYS_SAIMOD_LOG_UNIQUE_BASIC.php | 28 + .../qq/SYS_SAIMOD_LOG_UNIQUE_EXCEPTION.php | 28 + .../qq/SYS_SAIMOD_LOG_UNIQUE_REFERER.php | 30 + .../qq/SYS_SAIMOD_LOG_UNIQUE_REQUEST.php | 30 + .../modules/saimod_sys_log/saimod_sys_log.php | 355 + .../saimod_sys_log/tpl/saimod_sys_log.tpl | 14 + .../tpl/saimod_sys_log_error.tpl | 23 + .../tpl/saimod_sys_log_filter.tpl | 5 + .../tpl/saimod_sys_log_stats.tpl | 43 + .../tpl/saimod_sys_log_stats_menu.tpl | 1 + .../tpl/saimod_sys_log_table.tpl | 15 + .../tpl/saimod_sys_log_table_row.tpl | 11 + .../sai/modules/saimod_sys_login/autoload.inc | 5 + system/sai/modules/saimod_sys_login/qq/dummy | 0 .../saimod_sys_login/sai_sys_login_submit.js | 92 + .../saimod_sys_login/saimod_sys_login.php | 61 + .../modules/saimod_sys_login/tpl/login.tpl | 33 + .../modules/saimod_sys_login/tpl/logout.tpl | 102 + .../modules/saimod_sys_login/tpl/register.tpl | 87 + .../sai/modules/saimod_sys_mod/autoload.inc | 5 + system/sai/modules/saimod_sys_mod/qq/dummy | 0 .../modules/saimod_sys_mod/saimod_sys_mod.js | 6 + .../modules/saimod_sys_mod/saimod_sys_mod.php | 44 + .../sai/modules/saimod_sys_mod/tpl/mods.tpl | 12 + .../modules/saimod_sys_security/autoload.inc | 5 + .../qq/SYS_SAIMOD_SECURITY_RIGHTS.php | 12 + .../qq/SYS_SAIMOD_SECURITY_RIGHT_CHECK.php | 14 + .../qq/SYS_SAIMOD_SECURITY_RIGHT_DELETE.php | 14 + .../qq/SYS_SAIMOD_SECURITY_RIGHT_INSERT.php | 14 + .../qq/SYS_SAIMOD_SECURITY_USER.php | 12 + .../qq/SYS_SAIMOD_SECURITY_USERS.php | 11 + .../qq/SYS_SAIMOD_SECURITY_USER_COUNT.php | 12 + .../qq/SYS_SAIMOD_SECURITY_USER_LOG.php | 22 + .../qq/SYS_SAIMOD_SECURITY_USER_LOG_COUNT.php | 17 + .../qq/SYS_SAIMOD_SECURITY_USER_RIGHTS.php | 12 + .../SYS_SAIMOD_SECURITY_USER_RIGHT_CHECK.php | 12 + .../SYS_SAIMOD_SECURITY_USER_RIGHT_DELETE.php | 12 + .../SYS_SAIMOD_SECURITY_USER_RIGHT_INSERT.php | 12 + .../saimod_sys_security.css | 3 + .../saimod_sys_security.js | 120 + .../saimod_sys_security.php | 185 + .../tpl/saimod_sys_security.tpl | 17 + .../tpl/saimod_sys_security_deleteright.tpl | 17 + .../tpl/saimod_sys_security_groups.tpl | 1 + .../tpl/saimod_sys_security_newright.tpl | 16 + .../tpl/saimod_sys_security_right.tpl | 8 + .../tpl/saimod_sys_security_rights.tpl | 11 + .../tpl/saimod_sys_security_stats.tpl | 1 + .../tpl/saimod_sys_security_user.tpl | 16 + .../tpl/saimod_sys_security_user_right.tpl | 7 + .../saimod_sys_security_user_right_add.tpl | 1 + .../tpl/saimod_sys_security_user_rights.tpl | 11 + .../saimod_sys_security_user_rights_add.tpl | 4 + .../tpl/saimod_sys_security_user_view.tpl | 40 + .../tpl/saimod_sys_security_users.tpl | 19 + .../sai/modules/saimod_sys_todo/autoload.inc | 8 + .../saimod_sys_todo/js/saimod_sys_todo.js | 150 + .../qq/SYS_SAIMOD_TODO_CLOSE.php | 14 + .../qq/SYS_SAIMOD_TODO_CLOSE_ALL.php | 14 + .../qq/SYS_SAIMOD_TODO_DOTO_COUNT.php | 11 + .../qq/SYS_SAIMOD_TODO_DOTO_LIST.php | 17 + .../qq/SYS_SAIMOD_TODO_EDIT.php | 15 + .../qq/SYS_SAIMOD_TODO_EXCEPTION_INSERT.php | 32 + .../qq/SYS_SAIMOD_TODO_OPEN.php | 14 + .../SYS_SAIMOD_TODO_STATS_COUNT_DOTO_GEN.php | 11 + .../SYS_SAIMOD_TODO_STATS_COUNT_DOTO_USER.php | 11 + .../SYS_SAIMOD_TODO_STATS_COUNT_TODO_GEN.php | 11 + .../SYS_SAIMOD_TODO_STATS_COUNT_TODO_USER.php | 11 + .../qq/SYS_SAIMOD_TODO_TODO.php | 20 + .../qq/SYS_SAIMOD_TODO_TODO_COUNT.php | 11 + .../qq/SYS_SAIMOD_TODO_TODO_LIST.php | 17 + .../SYS_SAIMOD_TODO_USER_EXCEPTION_INSERT.php | 33 + .../saimod_sys_todo/saimod_sys_todo.php | 219 + .../saimod_sys_todo/stats/todo_stats_gen.php | 12 + .../saimod_sys_todo/stats/todo_stats_user.php | 12 + .../modules/saimod_sys_todo/todo_stats.php | 7 + .../saimod_sys_todo/todo_stats_data.php | 14 + .../saimod_sys_todo/tpl/saimod_sys_todo.tpl | 16 + .../tpl/saimod_sys_todo_new.tpl | 5 + .../tpl/saimod_sys_todo_todo.tpl | 26 + .../tpl/saimod_sys_todo_todo_user.tpl | 16 + .../modules/saimod_sys_todo/tpl/todo_list.tpl | 29 + .../saimod_sys_todo/tpl/todo_list_element.tpl | 12 + .../saimod_sys_todo/tpl/todo_stats.tpl | 15 + .../saimod_sys_todo/tpl/todo_stats_entry.tpl | 6 + .../tpl/todo_user_list_element.tpl | 5 + .../sai/modules/saistart_sys_sai/autoload.inc | 3 + .../modules/saistart_sys_sai/img/logo_sai.png | Bin 0 -> 17526 bytes .../saistart_sys_sai/img/saimod_log_stats.png | Bin 0 -> 221202 bytes system/sai/modules/saistart_sys_sai/qq/dummy | 0 .../saistart_sys_sai/saistart_sys_sai.js | 35 + .../saistart_sys_sai/saistart_sys_sai.php | 29 + .../modules/saistart_sys_sai/tpl/carousel.tpl | 61 + .../modules/saistart_sys_sai/tpl/content.tpl | 16 + .../modules/saistart_sys_sai/tpl/login.tpl | 33 + .../modules/saistart_sys_sai/tpl/logout.tpl | 11 + .../modules/saistart_sys_sai/tpl/saistart.tpl | 7 + system/sai/page/css/apireference.css | 15 + .../css/img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes .../sai/page/css/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes system/sai/page/css/index.css | 40 + .../page/css/libs/bootstrap-responsive.css | 1092 +++ .../css/libs/bootstrap-responsive.min.css | 9 + system/sai/page/css/libs/bootstrap-switch.css | 203 + .../css/libs/bootstrap-timepicker.min.css | 10 + system/sai/page/css/libs/bootstrap.css | 6039 +++++++++++++++++ system/sai/page/css/libs/bootstrap.min.css | 9 + system/sai/page/css/libs/datepicker.css | 7 + .../sai/page/css/libs/jquery.miniColors.css | 206 + .../sai/page/css/libs/jquery.minicolors.png | Bin 0 -> 77459 bytes system/sai/page/css/sai_table.css | 9 + system/sai/page/default_page.php | 89 + system/sai/page/img/apns.png | Bin 0 -> 7469 bytes system/sai/page/img/badge.png | Bin 0 -> 4214 bytes system/sai/page/img/cronjob-logo.png | Bin 0 -> 22199 bytes system/sai/page/img/flag_germany.png | Bin 0 -> 545 bytes system/sai/page/img/flag_usa.png | Bin 0 -> 609 bytes system/sai/page/img/flow_upload.png | Bin 0 -> 1482596 bytes system/sai/page/img/gcm-logo.png | Bin 0 -> 44085 bytes system/sai/page/img/geo_point.png | Bin 0 -> 783 bytes system/sai/page/img/geo_resize.png | Bin 0 -> 363 bytes system/sai/page/img/logo.png | Bin 0 -> 25432 bytes system/sai/page/img/nodejs-logo.png | Bin 0 -> 13159 bytes system/sai/page/img/postgresql-logo.png | Bin 0 -> 238344 bytes system/sai/page/img/rabbitmq-logo.jpg | Bin 0 -> 4336 bytes system/sai/page/js/lang_switcher.js | 30 + .../sai/page/js/libs/bootstrap-datepicker.js | 454 ++ .../page/js/libs/bootstrap-timepicker.min.js | 6 + system/sai/page/js/libs/bootstrap.js | 1951 ++++++ system/sai/page/js/libs/bootstrap.min.js | 6 + system/sai/page/js/libs/geoFunctions.js | 70 + system/sai/page/js/libs/jquery-1.9.1.min.js | 5 + system/sai/page/js/libs/jquery.min.js | 2 + system/sai/page/js/libs/jquery.miniColors.js | 729 ++ system/sai/page/js/libs/jquery.switch.js | 209 + .../js/libs/tooltipster-master/.gitignore | 1 + .../page/js/libs/tooltipster-master/README.md | 59 + .../js/libs/tooltipster-master/bower.json | 8 + .../css/themes/tooltipster-light.css | 12 + .../css/themes/tooltipster-noir.css | 12 + .../css/themes/tooltipster-punk.css | 12 + .../css/themes/tooltipster-shadow.css | 12 + .../tooltipster-master/css/tooltipster.css | 274 + .../libs/tooltipster-master/demo/index.html | 35 + .../js/libs/tooltipster-master/demo/map.png | Bin 0 -> 6353 bytes .../js/libs/tooltipster-master/demo/reset.css | 45 + .../js/libs/tooltipster-master/demo/style.css | 28 + .../tooltipster-master/doc/css/prettify.css | 49 + .../libs/tooltipster-master/doc/css/reset.css | 45 + .../libs/tooltipster-master/doc/css/style.css | 678 ++ .../doc/images/browser-chrome.png | Bin 0 -> 8439 bytes .../doc/images/browser-firefox.png | Bin 0 -> 9351 bytes .../doc/images/browser-ie.png | Bin 0 -> 5305 bytes .../doc/images/browser-opera.png | Bin 0 -> 4585 bytes .../doc/images/browser-safari.png | Bin 0 -> 12435 bytes .../tooltipster-master/doc/images/favicon.png | Bin 0 -> 378 bytes .../doc/images/icons/icomoon.eot | Bin 0 -> 1632 bytes .../doc/images/icons/icomoon.svg | 16 + .../doc/images/icons/icomoon.ttf | Bin 0 -> 1468 bytes .../doc/images/icons/icomoon.woff | Bin 0 -> 1096 bytes .../doc/images/icons/icomoond41d.eot | Bin 0 -> 1632 bytes .../doc/images/large-background.jpg | Bin 0 -> 159444 bytes .../doc/images/pattern-navy.png | Bin 0 -> 119069 bytes .../tooltipster-master/doc/images/social.jpg | Bin 0 -> 14777 bytes .../doc/images/spiderman.png | Bin 0 -> 24528 bytes .../doc/images/tooltipster.svg | 212 + .../doc/js/jquery.jgfeed.js | 34 + .../tooltipster-master/doc/js/lang-css.js | 78 + .../tooltipster-master/doc/js/prettify.js | 28 + .../libs/tooltipster-master/doc/js/scripts.js | 119 + .../js/libs/tooltipster-master/index.html | 664 ++ .../js/jquery.tooltipster.js | 1276 ++++ .../js/jquery.tooltipster.min.js | 1 + .../tooltipster.jquery.json | 36 + system/sai/page/js/sai.js | 87 + system/sai/page/sai.tpl | 36 + system/sai/sai/SaiModule.php | 19 + system/sai/sai/sai.php | 38 + system/sai/sai/saigui.php | 29 + system/security/RIGHTS.php | 24 + system/security/Security.php | 128 + system/security/User.php | 30 + system/security/autoload.inc.php | 2 + system/system/HEADER.php | 41 + system/system/autoload.inc.php | 2 + system/system/autoload.php | 92 + system/system/locale.php | 85 + system/system/path.php | 36 + system/system/system.php | 49 + system/system/time.php | 13 + webtorrent/.travis.yml | 7 + webtorrent/.zuul.yml | 6 + webtorrent/CONTRIBUTING.md | 24 + webtorrent/LICENSE | 20 + webtorrent/README.md | 715 ++ webtorrent/bin/ascii-logo.txt | 5 + webtorrent/bin/clone.sh | 29 + webtorrent/bin/cmd.js | 519 ++ webtorrent/bin/test.js | 18 + webtorrent/examples/browser-download.js | 23 + webtorrent/examples/browser-seed.js | 12 + .../examples/browser-stream-to-audio.js | 20 + .../examples/browser-stream-to-video.js | 20 + .../examples/node-save-to-file-system.js | 17 + webtorrent/img/logo.png | Bin 0 -> 21813 bytes webtorrent/img/network.png | Bin 0 -> 154108 bytes webtorrent/img/wordmark.png | Bin 0 -> 17672 bytes webtorrent/index.js | 266 + webtorrent/lib/file-stream.js | 119 + webtorrent/lib/fs-storage.js | 213 + webtorrent/lib/media-stream.js | 74 + webtorrent/lib/rarity-map.js | 86 + webtorrent/lib/server.js | 87 + webtorrent/lib/storage.js | 601 ++ webtorrent/lib/torrent.js | 1027 +++ webtorrent/package.json | 121 + webtorrent/test/basic-node.js | 86 + webtorrent/test/basic.js | 118 + webtorrent/test/blocklist-dht.js | 93 + webtorrent/test/blocklist-tracker.js | 81 + webtorrent/test/blocklist.js | 261 + webtorrent/test/cmd.js | 103 + .../Leaves of Grass by Walt Whitman.epub | Bin 0 -> 362017 bytes webtorrent/test/content/blocklist.txt | 2 + webtorrent/test/content/blocklist.txt.gz | Bin 0 -> 91 bytes webtorrent/test/content/numbers/1.txt | 1 + webtorrent/test/content/numbers/2.txt | 1 + webtorrent/test/content/numbers/3.txt | 1 + webtorrent/test/download-dht-magnet.js | 101 + webtorrent/test/download-dht-torrent.js | 100 + webtorrent/test/download-tracker-magnet.js | 110 + webtorrent/test/download-tracker-torrent.js | 110 + webtorrent/test/metadata.js | 48 + webtorrent/test/multiple.js | 60 + webtorrent/test/package.json | 7 + webtorrent/test/rarity-map.js | 113 + webtorrent/test/server.js | 30 + webtorrent/test/storage.js | 61 + .../test/torrents/bitlove-intro.torrent | Bin 0 -> 597 bytes webtorrent/test/torrents/leaves.torrent | Bin 0 -> 994 bytes webtorrent/test/torrents/pride.torrent | Bin 0 -> 3666 bytes webtorrent/test/torrents/sintel-5gb.torrent | Bin 0 -> 26727 bytes webtorrent/webtorrent.min.js | 5 + 586 files changed, 39801 insertions(+) create mode 100644 system/.gitignore create mode 100644 system/api/api.php create mode 100644 system/api/api_default.php create mode 100644 system/api/api_login.php create mode 100644 system/api/api_system.php create mode 100644 system/api/autoload.inc.php create mode 100644 system/api/verify.php create mode 100644 system/autoload.inc.php create mode 100644 system/cache/autoload.inc.php create mode 100644 system/cache/cache.php create mode 100644 system/config/autoload.inc.php create mode 100644 system/config/config.php create mode 100644 system/config/config_ids.php create mode 100644 system/cron/autoload.inc.php create mode 100644 system/cron/cron.php create mode 100644 system/cron/cron_log2sqlite.php create mode 100644 system/cron/cronjob.php create mode 100644 system/cron/cronstatus.php create mode 100644 system/cron/crontime.php create mode 100644 system/db/autoload.inc.php create mode 100644 system/db/connection/Connection.php create mode 100644 system/db/connection/ConnectionAMQP.php create mode 100644 system/db/connection/ConnectionAbstr.php create mode 100644 system/db/connection/ConnectionMYS.php create mode 100644 system/db/connection/ConnectionPG.php create mode 100644 system/db/connection/ConnectionSQLite.php create mode 100644 system/db/dbinfo/DBInfo.php create mode 100644 system/db/dbinfo/DBInfoAMQP.php create mode 100644 system/db/dbinfo/DBInfoMYS.php create mode 100644 system/db/dbinfo/DBInfoPG.php create mode 100644 system/db/dbinfo/DBInfoSQLite.php create mode 100644 system/db/qq/QP.php create mode 100644 system/db/qq/QQ.php create mode 100644 system/db/qq/QQuery.php create mode 100644 system/db/result/Result.php create mode 100644 system/db/result/ResultAMQP.php create mode 100644 system/db/result/ResultMysqli.php create mode 100644 system/db/result/ResultMysqliPrepare.php create mode 100644 system/db/result/ResultPostgres.php create mode 100644 system/db/result/ResultSQLite.php create mode 100644 system/dbd/autoload.inc.php create mode 100644 system/dbd/qq/SYS_API_TREE.php create mode 100644 system/dbd/qq/SYS_CACHE_CHECK.php create mode 100644 system/dbd/qq/SYS_CACHE_DELETE.php create mode 100644 system/dbd/qq/SYS_CACHE_PUT.php create mode 100644 system/dbd/qq/SYS_CRON_GET.php create mode 100644 system/dbd/qq/SYS_CRON_LAST_VISIT.php create mode 100644 system/dbd/qq/SYS_CRON_LIST.php create mode 100644 system/dbd/qq/SYS_CRON_UPD.php create mode 100644 system/dbd/qq/SYS_LOCALE_SET_LOCALE.php create mode 100644 system/dbd/qq/SYS_LOG_INSERT.php create mode 100644 system/dbd/qq/SYS_LOG_MONTH.php create mode 100644 system/dbd/qq/SYS_LOG_MONTH_DEL.php create mode 100644 system/dbd/qq/SYS_LOG_OLDEST.php create mode 100644 system/dbd/qq/SYS_PAGE_GROUP.php create mode 100644 system/dbd/qq/SYS_SECURITY_AVAILABLE.php create mode 100644 system/dbd/qq/SYS_SECURITY_CHECK.php create mode 100644 system/dbd/qq/SYS_SECURITY_CREATE.php create mode 100644 system/dbd/qq/SYS_SECURITY_LOGIN_MD5.php create mode 100644 system/dbd/qq/SYS_SECURITY_LOGIN_SHA1.php create mode 100644 system/dbd/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php create mode 100644 system/dbd/qq/SYS_SECURITY_UPDATE_PW.php create mode 100644 system/dbd/sql/mysql/data/basic_locale_string.sql create mode 100644 system/dbd/sql/mysql/data/sai_api.sql create mode 100644 system/dbd/sql/mysql/data/sai_error_locale_string.sql create mode 100644 system/dbd/sql/mysql/data/sai_locale_string.sql create mode 100644 system/dbd/sql/mysql/data/system_api.sql create mode 100644 system/dbd/sql/mysql/data/system_api_default.sql create mode 100644 system/dbd/sql/mysql/data/system_cron.sql create mode 100644 system/dbd/sql/mysql/data/system_rights.sql create mode 100644 system/dbd/sql/mysql/schema/system_api.sql create mode 100644 system/dbd/sql/mysql/schema/system_cache.sql create mode 100644 system/dbd/sql/mysql/schema/system_cron.sql create mode 100644 system/dbd/sql/mysql/schema/system_locale_string.sql create mode 100644 system/dbd/sql/mysql/schema/system_log.sql create mode 100644 system/dbd/sql/mysql/schema/system_page.sql create mode 100644 system/dbd/sql/mysql/schema/system_rights.sql create mode 100644 system/dbd/sql/mysql/schema/system_todo.sql create mode 100644 system/dbd/sql/mysql/schema/system_user.sql create mode 100644 system/dbd/sql/mysql/schema/system_user_to_rights.sql create mode 100644 system/dbd/sql/pg/data/basic_locale_string.sql create mode 100644 system/dbd/sql/pg/data/sai_api.sql create mode 100644 system/dbd/sql/pg/data/sai_error_locale_string.sql create mode 100644 system/dbd/sql/pg/data/sai_locale_string.sql create mode 100644 system/dbd/sql/pg/data/system_api.sql create mode 100644 system/dbd/sql/pg/data/system_rights.sql create mode 100644 system/dbd/sql/pg/schema/schema.sql create mode 100644 system/dbd/sql/pg/schema/system_api.sql create mode 100644 system/dbd/sql/pg/schema/system_cache.sql create mode 100644 system/dbd/sql/pg/schema/system_cron.sql create mode 100644 system/dbd/sql/pg/schema/system_locale_string.sql create mode 100644 system/dbd/sql/pg/schema/system_log.sql create mode 100644 system/dbd/sql/pg/schema/system_rights.sql create mode 100644 system/dbd/sql/pg/schema/system_todo.sql create mode 100644 system/dbd/sql/pg/schema/system_user.sql create mode 100644 system/dbd/sql/pg/schema/system_user_to_rights.sql create mode 100644 system/dbd/sql/pg/util_copy_api_table_by_groupa.sql create mode 100644 system/dbd/tbl/UserLoginsTable.php create mode 100644 system/dbd/tbl/UserRightsTable.php create mode 100644 system/dbd/tbl/system_api.php create mode 100644 system/dbd/tbl/system_cron.php create mode 100644 system/dbd/tbl/system_locale_string.php create mode 100644 system/dbd/tbl/system_log.php create mode 100644 system/dbd/tbl/system_page.php create mode 100644 system/dbd/tbl/system_todo.php create mode 100644 system/dbd/tbl/system_user.php create mode 100644 system/docu/apiclass/ApiClass.php create mode 100644 system/docu/apiclass/ApiVerify.php create mode 100644 system/docu/apiclass/PageApi.php create mode 100644 system/docu/autoload.inc.php create mode 100644 system/docu/code_docu.php create mode 100644 system/docu/docu.php create mode 100644 system/docu/docu_categories.php create mode 100644 system/docu/index/api.php create mode 100644 system/docu/index/index.php create mode 100644 system/docu/register_sys_docu.php create mode 100644 system/docu/system/1.system.md create mode 100644 system/docu/system/2.license.md create mode 100644 system/docu/system/3.getting started.md create mode 100644 system/docu/system/system.api.md create mode 100644 system/docu/system/system.cache.md create mode 100644 system/docu/system/system.config.md create mode 100644 system/docu/system/system.db.md create mode 100644 system/docu/system/system.db.qq.md create mode 100644 system/docu/system/system.docu.md create mode 100644 system/docu/system/system.log.md create mode 100644 system/docu/system/system.page.md create mode 100644 system/docu/system/system.sai.md create mode 100644 system/docu/system/system.security.md create mode 100644 system/docu/system/system.system.md create mode 100644 system/files/autoload.inc.php create mode 100644 system/files/files.php create mode 100644 system/files/sys/system.js create mode 100644 system/lib/EpicEditor/js/epiceditor.js create mode 100644 system/lib/EpicEditor/js/epiceditor.min.js create mode 100644 system/lib/EpicEditor/themes/base/epiceditor.css create mode 100644 system/lib/EpicEditor/themes/editor/epic-dark.css create mode 100644 system/lib/EpicEditor/themes/editor/epic-light.css create mode 100644 system/lib/EpicEditor/themes/preview/bartik.css create mode 100644 system/lib/EpicEditor/themes/preview/github.css create mode 100644 system/lib/EpicEditor/themes/preview/preview-dark.css create mode 100644 system/lib/Michelf/Markdown.php create mode 100644 system/lib/Michelf/MarkdownExtra.php create mode 100644 system/lib/Michelf/extra/License.md create mode 100644 system/lib/Michelf/extra/Readme.md create mode 100644 system/lib/Michelf/extra/Readme.php create mode 100644 system/lib/Michelf/extra/composer.json create mode 100644 system/lib/autoload.inc.php create mode 100644 system/log/autoload.inc.php create mode 100644 system/log/error_handler/error_handler.php create mode 100644 system/log/error_handler/error_handler_dbwriter.php create mode 100644 system/log/error_handler/error_handler_jsonoutput.php create mode 100644 system/log/exceptions/COUNTER.php create mode 100644 system/log/exceptions/CRON.php create mode 100644 system/log/exceptions/DEPRECATED.php create mode 100644 system/log/exceptions/ERROR.php create mode 100644 system/log/exceptions/ERROR_EXCEPTION.php create mode 100644 system/log/exceptions/INFO.php create mode 100644 system/log/exceptions/SHUTDOWN_EXCEPTION.php create mode 100644 system/log/exceptions/SYSTEM_ERROR_EXCEPTION.php create mode 100644 system/log/exceptions/SYSTEM_EXCEPTION.php create mode 100644 system/log/exceptions/TODO.php create mode 100644 system/log/exceptions/TranslatableError.php create mode 100644 system/log/exceptions/WARNING.php create mode 100644 system/log/exceptions_shortcut/DEPRECATED.php create mode 100644 system/log/exceptions_shortcut/ERROR.php create mode 100644 system/log/exceptions_shortcut/INFO.php create mode 100644 system/log/exceptions_shortcut/TODO.php create mode 100644 system/log/exceptions_shortcut/WARNING.php create mode 100644 system/log/log.php create mode 100644 system/log/register_exception_shortcut.php create mode 100644 system/log/register_result_shortcut.php create mode 100644 system/log/result/AbstractResult.php create mode 100644 system/log/result/JsonResult.php create mode 100644 system/log/result_shortcut/JsonResult.php create mode 100644 system/page/Page.php create mode 100644 system/page/State.php create mode 100644 system/page/autoload.inc.php create mode 100644 system/page/replace.php create mode 100644 system/readme.md create mode 100644 system/sai/autoload.inc.php create mode 100644 system/sai/js/crypto/jquery.md5.js create mode 100644 system/sai/js/crypto/jquery.sha1.js create mode 100644 system/sai/js/jqBootstrapValidation.js create mode 100644 system/sai/modules/autoload.inc create mode 100644 system/sai/modules/saimod_sys_api/autoload.inc create mode 100644 system/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php create mode 100644 system/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_DEL.php create mode 100644 system/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_SINGLE_SELECT.php create mode 100644 system/sai/modules/saimod_sys_api/saimod_sys_api.css create mode 100644 system/sai/modules/saimod_sys_api/saimod_sys_api.js create mode 100644 system/sai/modules/saimod_sys_api/saimod_sys_api.php create mode 100644 system/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl create mode 100644 system/sai/modules/saimod_sys_api/tpl/list_entry.tpl create mode 100644 system/sai/modules/saimod_sys_api/tpl/tab.tpl create mode 100644 system/sai/modules/saimod_sys_api/tpl/tabopt.tpl create mode 100644 system/sai/modules/saimod_sys_api/tpl/tabs.tpl create mode 100644 system/sai/modules/saimod_sys_cache/autoload.inc create mode 100644 system/sai/modules/saimod_sys_cache/qq/dummy create mode 100644 system/sai/modules/saimod_sys_cache/saimod_sys_cache.php create mode 100644 system/sai/modules/saimod_sys_config/autoload.inc create mode 100644 system/sai/modules/saimod_sys_config/qq/dummy create mode 100644 system/sai/modules/saimod_sys_config/saimod_sys_config.php create mode 100644 system/sai/modules/saimod_sys_cron/autoload.inc create mode 100644 system/sai/modules/saimod_sys_cron/css/saimod_sys_cron.css create mode 100644 system/sai/modules/saimod_sys_cron/js/saimod_sys_cron.js create mode 100644 system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php create mode 100644 system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_ADD.php create mode 100644 system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_CHANGE.php create mode 100644 system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_DEL.php create mode 100644 system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_SINGLE_SELECT.php create mode 100644 system/sai/modules/saimod_sys_cron/saimod_sys_cron.php create mode 100644 system/sai/modules/saimod_sys_cron/tpl/list_entry.tpl create mode 100644 system/sai/modules/saimod_sys_cron/tpl/tabs.tpl create mode 100644 system/sai/modules/saimod_sys_docu/autoload.inc create mode 100644 system/sai/modules/saimod_sys_docu/qq/dummy create mode 100644 system/sai/modules/saimod_sys_docu/saimod_sys_docu.js create mode 100644 system/sai/modules/saimod_sys_docu/saimod_sys_docu.php create mode 100644 system/sai/modules/saimod_sys_docu/tpl/tab.tpl create mode 100644 system/sai/modules/saimod_sys_docu/tpl/tab2.tpl create mode 100644 system/sai/modules/saimod_sys_docu/tpl/tabopt.tpl create mode 100644 system/sai/modules/saimod_sys_docu/tpl/tabs.tpl create mode 100644 system/sai/modules/saimod_sys_files/autoload.inc create mode 100644 system/sai/modules/saimod_sys_files/qq/dummy create mode 100644 system/sai/modules/saimod_sys_files/saimod_sys_files.js create mode 100644 system/sai/modules/saimod_sys_files/saimod_sys_files.php create mode 100644 system/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl create mode 100644 system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tab.tpl create mode 100644 system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabfull.tpl create mode 100644 system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tableentry.tpl create mode 100644 system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl create mode 100644 system/sai/modules/saimod_sys_locale/autoload.inc create mode 100644 system/sai/modules/saimod_sys_locale/qq/SYS_SAIMOD_LOCALE_ADD.php create mode 100644 system/sai/modules/saimod_sys_locale/qq/SYS_SAIMOD_LOCALE_CATEGORY.php create mode 100644 system/sai/modules/saimod_sys_locale/qq/SYS_SAIMOD_LOCALE_DEL.php create mode 100644 system/sai/modules/saimod_sys_locale/qq/SYS_SAIMOD_LOCALE_ID.php create mode 100644 system/sai/modules/saimod_sys_locale/qq/SYS_SAIMOD_LOCALE_SELECT.php create mode 100644 system/sai/modules/saimod_sys_locale/qq/SYS_SAIMOD_LOCALE_SELECT_LANG.php create mode 100644 system/sai/modules/saimod_sys_locale/saimod_sys_locale.js create mode 100644 system/sai/modules/saimod_sys_locale/saimod_sys_locale.php create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/LICENSE.TXT create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/jquery.tinymce.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/langs/readme.md create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/advlist/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/anchor/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/autolink/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/autoresize/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/autosave/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/bbcode/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/charmap/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/code/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/contextmenu/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/directionality/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-cool.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-cry.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-embarassed.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-frown.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-innocent.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-kiss.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-laughing.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-money-mouth.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-sealed.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-smile.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-surprised.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-tongue-out.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-undecided.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-wink.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-yell.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/example/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/example_dependency/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/fullpage/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/fullscreen/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/hr/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/image/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/importcss/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/insertdatetime/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/layer/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/legacyoutput/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/link/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/lists/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/media/moxieplayer.swf create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/media/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/moxiemanager/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/nonbreaking/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/noneditable/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/pagebreak/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/paste/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/preview/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/print/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/save/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/searchreplace/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/spellchecker/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/tabfocus/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/table/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/template/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/textcolor/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/css/visualblocks.css create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/visualchars/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/plugins/wordcount/plugin.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.inline.min.css create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.min.css create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.eot create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.svg create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.ttf create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.woff create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.eot create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.svg create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.ttf create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.woff create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/readme.md create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/anchor.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/loader.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/object.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/trans.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/wline.gif create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/skin.ie7.min.css.noie create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/skin.min.css create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/themes/modern/theme.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tinymce/tinymce.min.js create mode 100644 system/sai/modules/saimod_sys_locale/tpl/entry.tpl create mode 100644 system/sai/modules/saimod_sys_locale/tpl/lang_tabs.tpl create mode 100644 system/sai/modules/saimod_sys_locale/tpl/langtabopt.tpl create mode 100644 system/sai/modules/saimod_sys_locale/tpl/langtabs.tpl create mode 100644 system/sai/modules/saimod_sys_locale/tpl/tab.tpl create mode 100644 system/sai/modules/saimod_sys_locale/tpl/tabopt.tpl create mode 100644 system/sai/modules/saimod_sys_locale/tpl/tabs.tpl create mode 100644 system/sai/modules/saimod_sys_log/autoload.inc create mode 100644 system/sai/modules/saimod_sys_log/img/ajax-loader.gif create mode 100644 system/sai/modules/saimod_sys_log/js/saimod_sys_log.js create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_BASIC_QUERYTIME.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_BASIC_SUCCESS.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_BASIC_VISITOR.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_CLASS_BASIC.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_CLASS_OTHER.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_CLASS_SYSTEM.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ERROR.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTERS.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER_COUNT.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_TRUNCATE.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_UNIQUE_BASIC.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_UNIQUE_EXCEPTION.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_UNIQUE_REFERER.php create mode 100644 system/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_UNIQUE_REQUEST.php create mode 100644 system/sai/modules/saimod_sys_log/saimod_sys_log.php create mode 100644 system/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl create mode 100644 system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl create mode 100644 system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl create mode 100644 system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl create mode 100644 system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats_menu.tpl create mode 100644 system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl create mode 100644 system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl create mode 100644 system/sai/modules/saimod_sys_login/autoload.inc create mode 100644 system/sai/modules/saimod_sys_login/qq/dummy create mode 100644 system/sai/modules/saimod_sys_login/sai_sys_login_submit.js create mode 100644 system/sai/modules/saimod_sys_login/saimod_sys_login.php create mode 100644 system/sai/modules/saimod_sys_login/tpl/login.tpl create mode 100644 system/sai/modules/saimod_sys_login/tpl/logout.tpl create mode 100644 system/sai/modules/saimod_sys_login/tpl/register.tpl create mode 100644 system/sai/modules/saimod_sys_mod/autoload.inc create mode 100644 system/sai/modules/saimod_sys_mod/qq/dummy create mode 100644 system/sai/modules/saimod_sys_mod/saimod_sys_mod.js create mode 100644 system/sai/modules/saimod_sys_mod/saimod_sys_mod.php create mode 100644 system/sai/modules/saimod_sys_mod/tpl/mods.tpl create mode 100644 system/sai/modules/saimod_sys_security/autoload.inc create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_RIGHTS.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_RIGHT_CHECK.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_RIGHT_DELETE.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_RIGHT_INSERT.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USERS.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER_COUNT.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER_LOG.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER_LOG_COUNT.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER_RIGHTS.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER_RIGHT_CHECK.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER_RIGHT_DELETE.php create mode 100644 system/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USER_RIGHT_INSERT.php create mode 100644 system/sai/modules/saimod_sys_security/saimod_sys_security.css create mode 100644 system/sai/modules/saimod_sys_security/saimod_sys_security.js create mode 100644 system/sai/modules/saimod_sys_security/saimod_sys_security.php create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_groups.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_newright.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_stats.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_right.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_right_add.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_rights.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_rights_add.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl create mode 100644 system/sai/modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl create mode 100644 system/sai/modules/saimod_sys_todo/autoload.inc create mode 100644 system/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE_ALL.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_DOTO_COUNT.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_DOTO_LIST.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_EDIT.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_EXCEPTION_INSERT.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_OPEN.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_STATS_COUNT_DOTO_GEN.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_STATS_COUNT_DOTO_USER.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_STATS_COUNT_TODO_GEN.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_STATS_COUNT_TODO_USER.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_TODO.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_TODO_COUNT.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_TODO_LIST.php create mode 100644 system/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_USER_EXCEPTION_INSERT.php create mode 100644 system/sai/modules/saimod_sys_todo/saimod_sys_todo.php create mode 100644 system/sai/modules/saimod_sys_todo/stats/todo_stats_gen.php create mode 100644 system/sai/modules/saimod_sys_todo/stats/todo_stats_user.php create mode 100644 system/sai/modules/saimod_sys_todo/todo_stats.php create mode 100644 system/sai/modules/saimod_sys_todo/todo_stats_data.php create mode 100644 system/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/todo_list.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl create mode 100644 system/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl create mode 100644 system/sai/modules/saistart_sys_sai/autoload.inc create mode 100644 system/sai/modules/saistart_sys_sai/img/logo_sai.png create mode 100644 system/sai/modules/saistart_sys_sai/img/saimod_log_stats.png create mode 100644 system/sai/modules/saistart_sys_sai/qq/dummy create mode 100644 system/sai/modules/saistart_sys_sai/saistart_sys_sai.js create mode 100644 system/sai/modules/saistart_sys_sai/saistart_sys_sai.php create mode 100644 system/sai/modules/saistart_sys_sai/tpl/carousel.tpl create mode 100644 system/sai/modules/saistart_sys_sai/tpl/content.tpl create mode 100644 system/sai/modules/saistart_sys_sai/tpl/login.tpl create mode 100644 system/sai/modules/saistart_sys_sai/tpl/logout.tpl create mode 100644 system/sai/modules/saistart_sys_sai/tpl/saistart.tpl create mode 100644 system/sai/page/css/apireference.css create mode 100644 system/sai/page/css/img/glyphicons-halflings-white.png create mode 100644 system/sai/page/css/img/glyphicons-halflings.png create mode 100644 system/sai/page/css/index.css create mode 100644 system/sai/page/css/libs/bootstrap-responsive.css create mode 100644 system/sai/page/css/libs/bootstrap-responsive.min.css create mode 100644 system/sai/page/css/libs/bootstrap-switch.css create mode 100644 system/sai/page/css/libs/bootstrap-timepicker.min.css create mode 100644 system/sai/page/css/libs/bootstrap.css create mode 100644 system/sai/page/css/libs/bootstrap.min.css create mode 100644 system/sai/page/css/libs/datepicker.css create mode 100644 system/sai/page/css/libs/jquery.miniColors.css create mode 100644 system/sai/page/css/libs/jquery.minicolors.png create mode 100644 system/sai/page/css/sai_table.css create mode 100644 system/sai/page/default_page.php create mode 100644 system/sai/page/img/apns.png create mode 100644 system/sai/page/img/badge.png create mode 100644 system/sai/page/img/cronjob-logo.png create mode 100644 system/sai/page/img/flag_germany.png create mode 100644 system/sai/page/img/flag_usa.png create mode 100644 system/sai/page/img/flow_upload.png create mode 100644 system/sai/page/img/gcm-logo.png create mode 100644 system/sai/page/img/geo_point.png create mode 100644 system/sai/page/img/geo_resize.png create mode 100644 system/sai/page/img/logo.png create mode 100644 system/sai/page/img/nodejs-logo.png create mode 100644 system/sai/page/img/postgresql-logo.png create mode 100644 system/sai/page/img/rabbitmq-logo.jpg create mode 100644 system/sai/page/js/lang_switcher.js create mode 100644 system/sai/page/js/libs/bootstrap-datepicker.js create mode 100644 system/sai/page/js/libs/bootstrap-timepicker.min.js create mode 100644 system/sai/page/js/libs/bootstrap.js create mode 100644 system/sai/page/js/libs/bootstrap.min.js create mode 100644 system/sai/page/js/libs/geoFunctions.js create mode 100644 system/sai/page/js/libs/jquery-1.9.1.min.js create mode 100644 system/sai/page/js/libs/jquery.min.js create mode 100644 system/sai/page/js/libs/jquery.miniColors.js create mode 100644 system/sai/page/js/libs/jquery.switch.js create mode 100644 system/sai/page/js/libs/tooltipster-master/.gitignore create mode 100644 system/sai/page/js/libs/tooltipster-master/README.md create mode 100644 system/sai/page/js/libs/tooltipster-master/bower.json create mode 100644 system/sai/page/js/libs/tooltipster-master/css/themes/tooltipster-light.css create mode 100644 system/sai/page/js/libs/tooltipster-master/css/themes/tooltipster-noir.css create mode 100644 system/sai/page/js/libs/tooltipster-master/css/themes/tooltipster-punk.css create mode 100644 system/sai/page/js/libs/tooltipster-master/css/themes/tooltipster-shadow.css create mode 100644 system/sai/page/js/libs/tooltipster-master/css/tooltipster.css create mode 100644 system/sai/page/js/libs/tooltipster-master/demo/index.html create mode 100644 system/sai/page/js/libs/tooltipster-master/demo/map.png create mode 100644 system/sai/page/js/libs/tooltipster-master/demo/reset.css create mode 100644 system/sai/page/js/libs/tooltipster-master/demo/style.css create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/css/prettify.css create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/css/reset.css create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/css/style.css create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/browser-chrome.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/browser-firefox.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/browser-ie.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/browser-opera.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/browser-safari.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/favicon.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/icons/icomoon.eot create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/icons/icomoon.svg create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/icons/icomoon.ttf create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/icons/icomoon.woff create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/icons/icomoond41d.eot create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/large-background.jpg create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/pattern-navy.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/social.jpg create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/spiderman.png create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/images/tooltipster.svg create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/js/jquery.jgfeed.js create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/js/lang-css.js create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/js/prettify.js create mode 100644 system/sai/page/js/libs/tooltipster-master/doc/js/scripts.js create mode 100644 system/sai/page/js/libs/tooltipster-master/index.html create mode 100644 system/sai/page/js/libs/tooltipster-master/js/jquery.tooltipster.js create mode 100644 system/sai/page/js/libs/tooltipster-master/js/jquery.tooltipster.min.js create mode 100644 system/sai/page/js/libs/tooltipster-master/tooltipster.jquery.json create mode 100644 system/sai/page/js/sai.js create mode 100644 system/sai/page/sai.tpl create mode 100644 system/sai/sai/SaiModule.php create mode 100644 system/sai/sai/sai.php create mode 100644 system/sai/sai/saigui.php create mode 100644 system/security/RIGHTS.php create mode 100644 system/security/Security.php create mode 100644 system/security/User.php create mode 100644 system/security/autoload.inc.php create mode 100644 system/system/HEADER.php create mode 100644 system/system/autoload.inc.php create mode 100644 system/system/autoload.php create mode 100644 system/system/locale.php create mode 100644 system/system/path.php create mode 100644 system/system/system.php create mode 100644 system/system/time.php create mode 100644 webtorrent/.travis.yml create mode 100644 webtorrent/.zuul.yml create mode 100644 webtorrent/CONTRIBUTING.md create mode 100644 webtorrent/LICENSE create mode 100644 webtorrent/README.md create mode 100644 webtorrent/bin/ascii-logo.txt create mode 100644 webtorrent/bin/clone.sh create mode 100644 webtorrent/bin/cmd.js create mode 100644 webtorrent/bin/test.js create mode 100644 webtorrent/examples/browser-download.js create mode 100644 webtorrent/examples/browser-seed.js create mode 100644 webtorrent/examples/browser-stream-to-audio.js create mode 100644 webtorrent/examples/browser-stream-to-video.js create mode 100644 webtorrent/examples/node-save-to-file-system.js create mode 100644 webtorrent/img/logo.png create mode 100644 webtorrent/img/network.png create mode 100644 webtorrent/img/wordmark.png create mode 100644 webtorrent/index.js create mode 100644 webtorrent/lib/file-stream.js create mode 100644 webtorrent/lib/fs-storage.js create mode 100644 webtorrent/lib/media-stream.js create mode 100644 webtorrent/lib/rarity-map.js create mode 100644 webtorrent/lib/server.js create mode 100644 webtorrent/lib/storage.js create mode 100644 webtorrent/lib/torrent.js create mode 100644 webtorrent/package.json create mode 100644 webtorrent/test/basic-node.js create mode 100644 webtorrent/test/basic.js create mode 100644 webtorrent/test/blocklist-dht.js create mode 100644 webtorrent/test/blocklist-tracker.js create mode 100644 webtorrent/test/blocklist.js create mode 100644 webtorrent/test/cmd.js create mode 100644 webtorrent/test/content/Leaves of Grass by Walt Whitman.epub create mode 100644 webtorrent/test/content/blocklist.txt create mode 100644 webtorrent/test/content/blocklist.txt.gz create mode 100644 webtorrent/test/content/numbers/1.txt create mode 100644 webtorrent/test/content/numbers/2.txt create mode 100644 webtorrent/test/content/numbers/3.txt create mode 100644 webtorrent/test/download-dht-magnet.js create mode 100644 webtorrent/test/download-dht-torrent.js create mode 100644 webtorrent/test/download-tracker-magnet.js create mode 100644 webtorrent/test/download-tracker-torrent.js create mode 100644 webtorrent/test/metadata.js create mode 100644 webtorrent/test/multiple.js create mode 100644 webtorrent/test/package.json create mode 100644 webtorrent/test/rarity-map.js create mode 100644 webtorrent/test/server.js create mode 100644 webtorrent/test/storage.js create mode 100644 webtorrent/test/torrents/bitlove-intro.torrent create mode 100644 webtorrent/test/torrents/leaves.torrent create mode 100644 webtorrent/test/torrents/pride.torrent create mode 100644 webtorrent/test/torrents/sintel-5gb.torrent create mode 100644 webtorrent/webtorrent.min.js diff --git a/system/.gitignore b/system/.gitignore new file mode 100644 index 0000000..4b3cc92 --- /dev/null +++ b/system/.gitignore @@ -0,0 +1,3 @@ +/nbproject/private/ +/nbproject/ +/sai/modules/saimod_sys_img/nbproject/private/ \ No newline at end of file diff --git a/system/api/api.php b/system/api/api.php new file mode 100644 index 0000000..612c370 --- /dev/null +++ b/system/api/api.php @@ -0,0 +1,219 @@ +html(); + } + echo $result;//echo (new \default_page())->html(); + die(); + } + + public static function get_class(){ + return self::class;} + + public static function default_page(){ + throw new \RuntimeException("Unimplemented");} +} \ No newline at end of file diff --git a/system/api/api_login.php b/system/api/api_login.php new file mode 100644 index 0000000..91918a3 --- /dev/null +++ b/system/api/api_login.php @@ -0,0 +1,30 @@ + 0 ? true : false) : false;} + public static function UINT0 ($param) {return \is_numeric($param) ? ((int)$param >= 0 ? true : false) : false;} + public static function INT ($param) {return \is_numeric($param);} + public static function TIMEUNIX ($param) {return \is_numeric($param) ? ((int)$param > 0 ? true : false) : false;} + public static function DATE ($param) {return \strtotime($param);} + public static function STRING ($param) {return \is_string($param);} + public static function BOOL ($param) {return \is_bool($param) || $param == '0' || $param == '1';} + public static function FLOAT ($param) {return \is_float(\floatval($param));} + public static function JSON ($param) {return (self::ARY($param) || \json_decode(\stripslashes($param))) ? true : false;} //ary cuz when sent via direct json, all json is alrdy converted to an array. + public static function ARY ($param) {return \is_array($param);} + public static function LANG ($param) {return \SYSTEM\locale::isLang($param);} + public static function RESULT ($param) {return ($param == 'json' || $param == 'msgpack');} + +}; \ No newline at end of file diff --git a/system/autoload.inc.php b/system/autoload.inc.php new file mode 100644 index 0000000..3cf27a1 --- /dev/null +++ b/system/autoload.inc.php @@ -0,0 +1,23 @@ +next()){ + //check module + if(!self::check($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS])){ + self::status($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS], \SYSTEM\CRON\cronstatus::CRON_STATUS_FAIL_CLASS); + continue;} + //time to execute? + if(!\SYSTEM\CRON\crontime::check_now( strtotime($cron[\SYSTEM\DBD\system_cron::FIELD_LAST_RUN]), + $cron[\SYSTEM\DBD\system_cron::FIELD_MIN], + $cron[\SYSTEM\DBD\system_cron::FIELD_HOUR], + $cron[\SYSTEM\DBD\system_cron::FIELD_DAY], + $cron[\SYSTEM\DBD\system_cron::FIELD_DAY_WEEK], + $cron[\SYSTEM\DBD\system_cron::FIELD_MONTH])){ + continue;} + //Status is ok? + if($cron[\SYSTEM\DBD\system_cron::FIELD_STATUS] != \SYSTEM\CRON\cronstatus::CRON_STATUS_SUCCESFULLY){ + new \SYSTEM\LOG\CRON('Cron for Class '.$cron[\SYSTEM\DBD\system_cron::FIELD_CLASS].' could not execute cuz Status aint good: '. \SYSTEM\CRON\cronstatus::text($cron[\SYSTEM\DBD\system_cron::FIELD_STATUS])); + continue;} + //set running + self::status($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS], \SYSTEM\CRON\cronstatus::CRON_STATUS_RUNNING); + self::status($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS], call_user_func(array($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS],'run'))); + } + return \SYSTEM\LOG\JsonResult::ok(); + } + + public static function next($class){ + $cron = \SYSTEM\DBD\SYS_CRON_GET::Q1(array($class)); + //check module + if(!self::check($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS])){ + throw new \SYSTEM\LOG\ERROR("Given class is not a cronjob");} + //time + return \SYSTEM\CRON\crontime::next( strtotime($cron[\SYSTEM\DBD\system_cron::FIELD_LAST_RUN]), + $cron[\SYSTEM\DBD\system_cron::FIELD_MIN], + $cron[\SYSTEM\DBD\system_cron::FIELD_HOUR], + $cron[\SYSTEM\DBD\system_cron::FIELD_DAY], + $cron[\SYSTEM\DBD\system_cron::FIELD_DAY_WEEK], + $cron[\SYSTEM\DBD\system_cron::FIELD_MONTH]); + } + + private static function status($class, $status){ + new \SYSTEM\LOG\CRON('Cron Status for Class '.$class.' updated to: '. \SYSTEM\CRON\cronstatus::text($status)); + return \SYSTEM\DBD\SYS_CRON_UPD::QI(array($status,time(),$class));} + + public static function last_visit(){ + return \SYSTEM\DBD\SYS_CRON_LAST_VISIT::Q1()['time'];} +} \ No newline at end of file diff --git a/system/cron/cron_log2sqlite.php b/system/cron/cron_log2sqlite.php new file mode 100644 index 0000000..76af1c4 --- /dev/null +++ b/system/cron/cron_log2sqlite.php @@ -0,0 +1,70 @@ + abort + if( $oldest['year'] >= $now_year && + $oldest['month'] >= $now_month){ + return cronstatus::CRON_STATUS_SUCCESFULLY;} + + $filename = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$oldest['year'].'.'.$oldest['month'].'.db'; + //extract whole month to file + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename)); + + //create table + $con->query('CREATE TABLE IF NOT EXISTS `system_log` ('. + ' `ID` INT(10) NOT NULL,'. + ' `class` TEXT NOT NULL,'. + ' `message` TEXT NOT NULL,'. + ' `code` INT(11) NOT NULL,'. + ' `file` TEXT NOT NULL,'. + ' `line` INT(11) NOT NULL,'. + ' `trace` TEXT NOT NULL,'. + ' `ip` TEXT NOT NULL,'. + ' `querytime` DOUBLE NOT NULL,'. + ' `time` DATETIME NOT NULL,'. + ' `server_name` CHAR(255) NOT NULL,'. + ' `server_port` INT(10) NOT NULL,'. + ' `request_uri` CHAR(255) NOT NULL,'. + ' `post` TEXT NOT NULL,'. + ' `http_referer` CHAR(255) NULL DEFAULT NULL,'. + ' `http_user_agent` TEXT NOT NULL,'. + ' `user` INT(11) NULL DEFAULT NULL,'. + ' `thrown` BIT(1) NOT NULL,'. + ' PRIMARY KEY (`ID`)'.');'); + + //write data as trasaction + $con->exec('begin transaction'); + $res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year'])); + $i = 0; + while($row = $res->next()){ + set_time_limit(30); + $i++; + if(!$con->exec('INSERT OR IGNORE INTO '.\SYSTEM\DBD\system_log::NAME_MYS. + '(`ID`, `class`, `message`, `code`, `file`, `line`, `trace`, `ip`, `querytime`, `time`,'. + ' `server_name`, `server_port`, `request_uri`, `post`,'. + ' `http_referer`, `http_user_agent`, `user`, `thrown`)'. + 'VALUES ('.$row['ID'].', \''.\SQLite3::escapeString($row['class']).'\', \''.\SQLite3::escapeString($row['message']).'\', '. + $row['code'].', \''.\SQLite3::escapeString($row['file']).'\', '.$row['line'].', \''.\SQLite3::escapeString($row['trace']).'\', \''. + $row['ip'].'\', '.$row['querytime'].', \''.$row['time'].'\', \''. + \SQLite3::escapeString($row['server_name']).'\', '.$row['server_port'].', \''.\SQLite3::escapeString($row['request_uri']).'\', \''.\SQLite3::escapeString($row['post']).'\', \''. + \SQLite3::escapeString($row['http_referer']).'\', \''.\SQLite3::escapeString($row['http_user_agent']).'\', '.$row['user'].','.true.');')){ + new \SYSTEM\LOG\ERROR('failed to insert into log archiev'); + return cronstatus::CRON_STATUS_FAIL; + } + } + if(!$con->exec('end transaction')){ + new \SYSTEM\LOG\ERROR('failed to insert into log archiev'); + return cronstatus::CRON_STATUS_FAIL;}; + + //delete from database + if(!\SYSTEM\DBD\SYS_LOG_MONTH_DEL::QI(array($oldest['month'],$oldest['year']))){ + new \SYSTEM\LOG\ERROR('failed to delete log entries'); + return cronstatus::CRON_STATUS_FAIL;} + + return cronstatus::CRON_STATUS_SUCCESFULLY; + } +} \ No newline at end of file diff --git a/system/cron/cronjob.php b/system/cron/cronjob.php new file mode 100644 index 0000000..da27e93 --- /dev/null +++ b/system/cron/cronjob.php @@ -0,0 +1,6 @@ + 12){ $next_year += 1;} + $next_month = ($now_month+$month)%12;} + if($day){ + if($day + $now_day> 31){ $next_month += 1;} + $next_day = ($now_day+$day)%31;} + if($hour){ + if(($hour + $now_hour)>= 24){ $next_day += 1;} + $next_hour = ($now_hour+$hour)%24;} + if($min){ + if(($min + $now_min)> 60){ $next_hour += 1;} + $next_min = ($now_min+$min)%60;} + if($day_week){ + $day_week = $day_week % 6; // 7 and 0 both mean Sunday + $now_day_week = $now_day_week % 6; // 7 and 0 both mean Sunday + $next_day += abs($day_week - $now_day_week);} + //new \SYSTEM\LOG\INFO(print_r(array($base_time,$min,$hour,$day,$day_week,$month),true)); + //new \SYSTEM\LOG\INFO(print_r(array($now_min, $now_hour, $now_day, $now_month, $now_day_week),true)); + //new \SYSTEM\LOG\INFO(print_r(array($next_hour, $next_min, 0, $next_month, $next_day, $next_year),true)); + return mktime($next_hour, $next_min, 0, $next_month, $next_day, $next_year); + } + public static function last($base_time,$min,$hour,$day,$day_week,$month){ + list( $now_min, $now_hour, $now_day, $now_month, $now_day_week ) = preg_split( "/ /", date("i H d n N", $base_time ) ); + list( $last_min, $last_hour, $last_day, $last_month, $last_year) = preg_split( "/ /", date("i H d n Y", $base_time ) ); + if($month){ + if(($now_month - $month)< 12){ $last_year -= 1;} + $last_month = ($now_month-$month)%12;} + if($day){ + if(($now_day - $day)> 31){ $last_month -= 1;} + $last_day = ($now_day-$day)%31;} + if($hour){ + if(($now_hour - $hour)> 24){ $last_day -= 1;} + $last_hour = ($now_hour-$hour)%24;} + if($min){ + if(($now_min - $min)> 60){ $last_hour -= 1;} + $last_min = ($now_min-$min)%60;} + if($day_week){ + $day_week = $day_week % 6; // 7 and 0 both mean Sunday + $now_day_week = $now_day_week % 6; // 7 and 0 both mean Sunday + $last_day -= abs($day_week - $now_day_week);} + return mktime($last_hour, $last_min, 0, $last_month, $last_day, $last_year); + } + public static function check($base_time,$last_run,$min,$hour,$day,$day_week,$month){ + //new \SYSTEM\LOG\INFO('next:'.self::next($last_run, $min, $hour, $day, $day_week, $month).' bt:'.$base_time.' last:'.$last_run.' dif:'.(self::next($last_run, $min, $hour, $day, $day_week, $month) - time($base_time)).' run:'.(self::next($last_run, $min, $hour, $day, $day_week, $month) <= time($base_time) ? 'run' : 'not run')); + return self::next($last_run, $min, $hour, $day, $day_week, $month) <= $base_time ? true : false;} + public static function next_now($min,$hour,$day,$day_week,$month){ + return self::next(time(),$min,$hour,$day,$day_week,$month);} + public static function last_now($min,$hour,$day,$day_week,$month){ + return self::last(time(),$min,$hour,$day,$day_week,$month);} + public static function check_now($last_run,$min,$hour,$day,$day_week,$month){ + return self::check(time(),$last_run,$min,$hour,$day,$day_week,$month);} +} \ No newline at end of file diff --git a/system/db/autoload.inc.php b/system/db/autoload.inc.php new file mode 100644 index 0000000..2bca5de --- /dev/null +++ b/system/db/autoload.inc.php @@ -0,0 +1,6 @@ +dbinfo = $dbinfo; + if(!$dbinfo){ + $dbinfo = \SYSTEM\system::getSystemDBInfo();} + + if($dbinfo instanceof \SYSTEM\DB\DBInfoPG){ + $this->connection = new \SYSTEM\DB\ConnectionPG($dbinfo); + } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoMYS){ + $this->connection = new \SYSTEM\DB\ConnectionMYS($dbinfo); + } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoAMQP){ + $this->connection = new \SYSTEM\DB\ConnectionAMQP($dbinfo); + } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoSQLite){ + $this->connection = new \SYSTEM\DB\ConnectionSQLite($dbinfo); + } else { + throw new \Exception('Could not understand Database Settings. Check ur Database Settings');} + } + + //Destruct connection object. + public function __destruct(){ + unset($this->connection);} + + //Query connected Database with prepared statements, $stmt = sql string with ?; $values = array of values + public function prepare($stmtName, $stmt, $values){ + return $this->connection->prepare($stmtName, $stmt, $values);} + + //Close Connection + public function close(){ + return $this->connection->close();} + + //Query connected Database + public function query($query){ + return $this->connection->query($query);} + + public function exec($query){ + return $this->connection->exec($query);} +} \ No newline at end of file diff --git a/system/db/connection/ConnectionAMQP.php b/system/db/connection/ConnectionAMQP.php new file mode 100644 index 0000000..99d9784 --- /dev/null +++ b/system/db/connection/ConnectionAMQP.php @@ -0,0 +1,66 @@ +connection = new \AMQPConnection( + array( + 'host' => $dbinfo->m_host, + 'vhost' => $dbinfo->m_database, + 'port' => $dbinfo->m_port, + 'login' => $dbinfo->m_user, + 'password' => $dbinfo->m_password + )); + + $this->connection->connect(); + + if(!$this->connection || !$this->connection->isConnected()){ + throw new \SYSTEM\LOG\ERROR('Cannot connect to the amqp queue!');} + } + + public function send($msg){ + $channel = new \AMQPChannel($this->connection); + $exchange = new \AMQPExchange($channel); + $exchange->setFlags(AMQP_DURABLE); + $exchange->setName('exchange2'); + $exchange->setType('direct'); + //$exchange->declare(); + $exchange->declareExchange(); + + $queue = new \AMQPQueue($channel); + $queue->setName('series'); + $queue->setFlags(AMQP_DURABLE | AMQP_AUTODELETE); + //$queue->declare(); + $queue->declareQueue(); + $queue->bind('exchange2','series'); + + $channel->startTransaction(); + $message = $exchange->publish(json_encode($msg), 'series', AMQP_MANDATORY, + array('content_type' => 'application/json', + 'delivery_mode' => 2)); + $channel->commitTransaction(); + + if(!$message) { + throw new \SYSTEM\LOG\ERROR("Error: Message '".$message."' was not sent to queue.!"); + } + } + + public function __destruct(){ + $this->close(); + } + + public function close(){ + if (!$this->connection->disconnect()) { + throw new Exception("Could not disconnect !"); + } + } + + public function query($query){ } + + public function prepare($stmtName, $stmt, $values){} + +} \ No newline at end of file diff --git a/system/db/connection/ConnectionAbstr.php b/system/db/connection/ConnectionAbstr.php new file mode 100644 index 0000000..258bc8d --- /dev/null +++ b/system/db/connection/ConnectionAbstr.php @@ -0,0 +1,28 @@ +dbinfo = $dbinfo; + + $this->connection = @mysqli_connect($dbinfo->m_host, $dbinfo->m_user, $dbinfo->m_password, $new_link, $client_flag); + if(!$this->connection){ + throw new \Exception('Could not connect to Database. Check ur Database Settings');} + + if(!mysqli_select_db($this->connection, $dbinfo->m_database)){ + mysqli_close($this->connection); + throw new \Exception('Could not select Database. Check ur Database Settings: '.mysqli_error($this->connection));} + } + + public function __destruct(){ + $this->close();} + + public function prepare($stmtName, $stmt, $values){ + $prepStmt = \mysqli_prepare($this->connection, $stmt); + if(!$prepStmt){ + throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. \mysqli_error($this->connection));} + + $types = ''; + $binds = array($prepStmt,null); + for($i =0; $i < \count($values);$i++){ + $types .= self::getPrepareValueType($values[$i]); + $binds[] = &$values[$i];} + $binds[1] = $types; + \call_user_func_array('mysqli_stmt_bind_param', $binds); //you need 2 append the parameters - thats the right way to do that. + + if(!mysqli_stmt_execute($prepStmt)){ + throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". \mysqli_stmt_error($prepStmt));} + + return new ResultMysqliPrepare($prepStmt,$this); + } + + public function close(){ + return mysqli_close($this->connection);} + + public function query($query){ + $result = mysqli_query($this->connection, $query); + if(!$result){ + throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.mysqli_error($this->connection));} + + if($result === TRUE){ + return TRUE;} + + return new ResultMysqli($result); + } +} \ No newline at end of file diff --git a/system/db/connection/ConnectionPG.php b/system/db/connection/ConnectionPG.php new file mode 100644 index 0000000..58190f3 --- /dev/null +++ b/system/db/connection/ConnectionPG.php @@ -0,0 +1,61 @@ +dbinfo = $dbinfo; + + $this->connection = pg_connect("host=".$dbinfo->m_host." port=".$dbinfo->m_port." dbname=".$dbinfo->m_database." + user=".$dbinfo->m_user." password=".$dbinfo->m_password.""); + if(!$this->connection){ + throw new \Exception('Could not connect to Database. Check ur Database Settings');} + } + + public function __destruct(){} + + public function prepare($stmtName, $stmt, $values){ + $result = pg_query_params($this->connection, 'SELECT name FROM pg_prepared_statements WHERE name = $1', array($stmtName)); + //var_dump($stmt); + //var_dump($values); + if (pg_num_rows($result) == 0) { + $result = \pg_prepare($this->connection, $stmtName, $stmt); + if(($info = \pg_last_notice($this->connection)) != ''){ + new \SYSTEM\LOG\INFO($info);} + } + + if(!$result) + throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. \pg_last_error($this->connection)); + + $result = \pg_execute($this->connection, $stmtName, $values); + if(($info = \pg_last_notice($this->connection)) != ''){ + new \SYSTEM\LOG\INFO($info);} + + if(!$result) + throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". \pg_last_error($this->connection)); + + return new ResultPostgres($result,$this); + } + + public function close(){ + return pg_close($this->connection);} + + public function query($query){ + $result = \pg_query($this->connection, $query); + if(($info = \pg_last_notice($this->connection)) != ''){ + new \SYSTEM\LOG\INFO($info);} + + if(!$result){ + throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.pg_last_error($this->connection));} + + if($result === TRUE){ + return TRUE;} + + return new ResultPostgres($result,$this); + } + +} \ No newline at end of file diff --git a/system/db/connection/ConnectionSQLite.php b/system/db/connection/ConnectionSQLite.php new file mode 100644 index 0000000..1cca3a3 --- /dev/null +++ b/system/db/connection/ConnectionSQLite.php @@ -0,0 +1,48 @@ +connection = new \SQLite3($dbinfo->m_database); + if(!$this->connection){ + throw new \Exception('Could not connect to Database. Check ur Database Settings: '.$error);} + } + + public function __destruct(){ + $this->close();} + + public function prepare($stmtName, $stmt, $values){ + $prepStmt = $this->connection->prepare($stmt); + if(!$prepStmt){ + throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. $error);} + + foreach($values as $key=>$val){ + $prepStmt->bindParam($key,$val);} + + if(!($result = $prepStmt->execute())){ + throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". $error);} + + return new ResultSQLite($result,$prepStmt); + } + + public function close(){ + return $this->connection->close();} + + public function query($query){ + $result = $this->connection->query($query); + if(!$result){ + throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.$this->connection->lastErrorMsg());} + if($result === TRUE){ + return TRUE;} + + return new ResultSQLite($result,null); + } + + public function exec($query){ + return $this->connection->exec($query); + } +} \ No newline at end of file diff --git a/system/db/dbinfo/DBInfo.php b/system/db/dbinfo/DBInfo.php new file mode 100644 index 0000000..326ab1e --- /dev/null +++ b/system/db/dbinfo/DBInfo.php @@ -0,0 +1,13 @@ +m_database = $vhost; + $this->m_user = $user; + $this->m_password = $password; + $this->m_host = $host; + $this->m_port = $port; + + if( $this->m_database == null || + $this->m_user == null || + $this->m_password == null || + $this->m_host == null){ + throw new \Exception("AMQP Connection Info not correct, vhost, user, password or host are null");} + } +} \ No newline at end of file diff --git a/system/db/dbinfo/DBInfoMYS.php b/system/db/dbinfo/DBInfoMYS.php new file mode 100644 index 0000000..a7e3580 --- /dev/null +++ b/system/db/dbinfo/DBInfoMYS.php @@ -0,0 +1,19 @@ +m_database = $database; + $this->m_user = $user; + $this->m_password = $password; + $this->m_host = $host; + $this->m_port = $port; + + if( $this->m_database == null || + $this->m_user == null || + $this->m_password == null || + $this->m_host == null){ + throw new \Exception("DBInfo not correct, database, user, password or host are null");} + } +} \ No newline at end of file diff --git a/system/db/dbinfo/DBInfoPG.php b/system/db/dbinfo/DBInfoPG.php new file mode 100644 index 0000000..1201904 --- /dev/null +++ b/system/db/dbinfo/DBInfoPG.php @@ -0,0 +1,19 @@ +m_database = $database; + $this->m_user = $user; + $this->m_password = $password; + $this->m_host = $host; + $this->m_port = $port; + + if( $this->m_database == null || + $this->m_user == null || + $this->m_password == null || + $this->m_host == null){ + throw new \Exception("DBInfo not correct, database, user, password or host are null");} + } +} \ No newline at end of file diff --git a/system/db/dbinfo/DBInfoSQLite.php b/system/db/dbinfo/DBInfoSQLite.php new file mode 100644 index 0000000..c89dd8e --- /dev/null +++ b/system/db/dbinfo/DBInfoSQLite.php @@ -0,0 +1,15 @@ +m_database = $database; + $this->m_user = $user; + $this->m_password = $password; + $this->m_host = $host; + $this->m_port = $port; + + if( $this->m_database == null){ + throw new \Exception("DBInfo not correct, database, permissions are null");} + } +} \ No newline at end of file diff --git a/system/db/qq/QP.php b/system/db/qq/QP.php new file mode 100644 index 0000000..534b5d7 --- /dev/null +++ b/system/db/qq/QP.php @@ -0,0 +1,35 @@ +dbinfo); + $is_pg = \SYSTEM\system::isSystemDbInfoPG(); + if($query->dbinfo){ + $is_pg = $query->dbinfo instanceof \SYSTEM\DB\DBInfoPG;} + if($is_pg){ + return $con->prepare($query->name,$query->sql_pg,$params); + } else { + return $con->prepare($query->name,$query->sql_mys,$params_mys ? $params_mys : $params);} + } + + public static function QA($params,$params_mys = null){ + $res = self::QQ($params,$params_mys); + $result = array(); + while($row = $res->next()){ + $result[] = $row;} + return $result; + } + + public static function Q1($params,$params_mys = null){ + return self::QQ($params,$params_mys)->next();} + + public static function QI($params,$params_mys = null){ + $qq = self::QQ($params,$params_mys); + return $qq->affectedRows() != (0||null);} + //override this + protected static function query(){ + throw new \SYSTEM\LOG\ERROR('query function of your QP Class not overwritten!');} + //return new QQuery();} +} \ No newline at end of file diff --git a/system/db/qq/QQ.php b/system/db/qq/QQ.php new file mode 100644 index 0000000..ab86314 --- /dev/null +++ b/system/db/qq/QQ.php @@ -0,0 +1,34 @@ +dbinfo); + $is_pg = \SYSTEM\system::isSystemDbInfoPG(); + if($query->dbinfo){ + $is_pg = $query->dbinfo instanceof \SYSTEM\DB\DBInfoPG;} + if($is_pg){ + return $con->query($query->sql_pg); + } else { + return $con->query($query->sql_mys);} + } + + public static function QA(){ + $res = self::QQ(); + $result = array(); + while($row = $res->next()){ + $result[] = $row;} + return $result; + } + + public static function Q1(){ + return self::QQ()->next();} + public static function QI(){ + $qq = self::QQ(); + return $qq;} + //override this + protected static function query(){ + throw new \SYSTEM\LOG\ERROR('query function of your QQ Class not overwritten!');} + //return new QQuery();} +} \ No newline at end of file diff --git a/system/db/qq/QQuery.php b/system/db/qq/QQuery.php new file mode 100644 index 0000000..3b7a306 --- /dev/null +++ b/system/db/qq/QQuery.php @@ -0,0 +1,16 @@ +name = $name; + $this->sql_pg = $sql_pg; + $this->sql_mys = $sql_mys; + $this->dbinfo = $dbinfo; + } +} diff --git a/system/db/result/Result.php b/system/db/result/Result.php new file mode 100644 index 0000000..f68e306 --- /dev/null +++ b/system/db/result/Result.php @@ -0,0 +1,16 @@ +res = $res;} + + public function __destruct(){ + $this->close();} + + public function close(){ + pg_free_result($this->res);} + + public function count(){ + return pg_num_rows($this->res);} + + public function affectedRows(){ + throw new \SYSTEM\LOG\ERROR("Not Supported!");} + + public function next($object = false, $result_type = MYSQL_BOTH){ + if($object){ + $this->current = pg_fetch_object($this->res); + } else { + $this->current = pg_fetch_assoc($this->res); + } + return $this->current; + } + + public function seek($row_number){ + return pg_data_seek($this->res,$row_number);} +} \ No newline at end of file diff --git a/system/db/result/ResultMysqli.php b/system/db/result/ResultMysqli.php new file mode 100644 index 0000000..92ccd74 --- /dev/null +++ b/system/db/result/ResultMysqli.php @@ -0,0 +1,37 @@ +res = $res;} + + public function __destruct(){ + $this->close();} + + public function close(){ + mysqli_free_result($this->res);} + + public function count(){ + return mysqli_num_rows($this->res);} + + public function affectedRows(){ + return mysqli_affected_rows($this->res);} + + public function next($object = false, $result_type = MYSQL_BOTH){ + if($object){ + $this->current = mysqli_fetch_object($this->res); + } else { + $this->current = mysqli_fetch_assoc($this->res); + } + return $this->current; + } + + public function seek($row_number){ + return mysqli_data_seek($this->res,$row_number);} +} \ No newline at end of file diff --git a/system/db/result/ResultMysqliPrepare.php b/system/db/result/ResultMysqliPrepare.php new file mode 100644 index 0000000..7d5dcd4 --- /dev/null +++ b/system/db/result/ResultMysqliPrepare.php @@ -0,0 +1,58 @@ +res = $res; + $this->connection = $connection; + + $this->meta = \mysqli_stmt_result_metadata($this->res); + + if(!$this->meta){ + //occurs on insert + //throw new \Exception("Could not retrieve meta for prepare statement");} + return;} + + while ($field = $this->meta->fetch_field() ) { + $this->binds[$field->table.'.'.$field->name] = &$this->binds[$field->table.'.'.$field->name];} //fix for ambiguous fieldnames + + \mysqli_free_result($this->meta); + + call_user_func_array(array($this->res, 'bind_result'), $this->binds); //you need 2 append the parameters - thats the right way to do that. + } + + public function __destruct() { + $this->close();} + + public function close(){ + mysqli_stmt_free_result($this->res); + mysqli_stmt_close($this->res); + } + + public function count(){ + return \mysqli_stmt_num_rows($this->res);} + + public function affectedRows(){ + return \mysqli_stmt_affected_rows($this->res);} + + //$object not used + //$result_type not used! + public function next($object = false, $result_type = MYSQL_BOTH){ + if(\mysqli_stmt_fetch($this->res)){ + foreach( $this->binds as $key=>$value ){ + $row[substr($key, strpos($key, '.')+1)] = $value;} //fix for ambiguous fieldnames + return $row;} + return NULL; + } + + public function seek($row_number){ + return \mysqli_stmt_data_seek($this->res,$row_number);} +} \ No newline at end of file diff --git a/system/db/result/ResultPostgres.php b/system/db/result/ResultPostgres.php new file mode 100644 index 0000000..012f3f1 --- /dev/null +++ b/system/db/result/ResultPostgres.php @@ -0,0 +1,39 @@ +res = $res; + $this->connection = $connection;} + + public function __destruct(){ + $this->close();} + + public function close(){ + pg_free_result($this->res);} + + public function count(){ + return pg_num_rows($this->res);} + + public function affectedRows(){ + return pg_affected_rows($this->res);} + + public function next($object = false, $result_type = MYSQL_BOTH){ + if($object){ + $this->current = pg_fetch_object($this->res); + } else { + $this->current = pg_fetch_assoc($this->res); + } + return $this->current; + } + + public function seek($row_number){ + return pg_data_seek($this->res,$row_number);} +} \ No newline at end of file diff --git a/system/db/result/ResultSQLite.php b/system/db/result/ResultSQLite.php new file mode 100644 index 0000000..7a7996f --- /dev/null +++ b/system/db/result/ResultSQLite.php @@ -0,0 +1,81 @@ +res = $res; + $this->stmt = $stmt;} + + public function __destruct(){ + $this->close();} + + public function close(){ + if($this->stmt){ + $this->stmt->close();} + } + + public function count(){ + throw new Exception("Problem SQLite"); + return mysqli_num_rows($this->res);} + /* + * if ($res->numColumns() && $res->columnType(0) != SQLITE3_NULL) { + // have rows +} else { + // zero rows +} + */ + + public function affectedRows(){ + throw new Exception("Problem SQLite"); + return mysqli_affected_rows($this->res);} + + public function next($object = false, $result_type = SQLITE3_ASSOC){ + if($object){ + throw new Exception("Problem SQLite"); + } else { + $this->current = $this->res->fetchArray($result_type); + } + return $this->current; + } + + /* + * function fetchObject($sqlite3result, $objectType = NULL) { + $array = $sqlite3result->fetchArray(); + + if(is_null($objectType)) { + $object = new stdClass(); + } else { + // does not call this class' constructor + $object = unserialize(sprintf('O:%d:"%s":0:{}', strlen($objectType), $objectType)); + } + + $reflector = new ReflectionObject($object); + for($i = 0; $i < $sqlite3result->numColumns(); $i++) { + $name = $sqlite3result->columnName($i); + $value = $array[$name]; + + try { + $attribute = $reflector->getProperty($name); + + $attribute->setAccessible(TRUE); + $attribute->setValue($object, $value); + } catch (ReflectionException $e) { + $object->$name = $value; + } + } + + return $object; +} + */ + + public function seek($row_number){ + throw new Exception("Problem SQLite"); + return mysqli_data_seek($this->res,$row_number);} +} \ No newline at end of file diff --git a/system/dbd/autoload.inc.php b/system/dbd/autoload.inc.php new file mode 100644 index 0000000..3cfa7e3 --- /dev/null +++ b/system/dbd/autoload.inc.php @@ -0,0 +1,3 @@ +TinyMCE LogoWelcome to the TinyMCE editor demo!\n

Feel free to try out the different features that are provided, please note that the MoxieManager specific functionality is part of our commercial offering. The demo is to show the integration.

\n

Got questions or need help?

\n

If you have questions or need help, feel free to visit our community forum! We also offer Enterprise support solutions. Also do not miss out on the documentation, its a great resource wiki for understanding how TinyMCE works and integrates.

\n

Found a bug?

\n

If you think you have found a bug, you can use the Bug Tracker to report bugs to the developers.

\n

And here is a simple table for you to play with.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ProductCostReally?
TinyMCEFreeYES!
PluploadFreeYES!
\n

Enjoy our software and create great content!

\n

Oh, and by the way, don\'t forget to check out our other product called Plupload, your ultimate upload solution with HTML5 upload support!

', '

TinyMCE LogoWelcome to the TinyMCE editor demo!

\n

Feel free to try out the different features that are provided, please note that the MoxieManager specific functionality is part of our commercial offering. The demo is to show the integration.

\n

Got questions or need help?

\n

If you have questions or need help, feel free to visit our community forum! We also offer Enterprise support solutions. Also do not miss out on the documentation, its a great resource wiki for understanding how TinyMCE works and integrates.

\n

Found a bug?

\n

If you think you have found a bug, you can use the Bug Tracker to report bugs to the developers.

\n

And here is a simple table for you to play with.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ProductCostReally?
TinyMCEFreeYES!
PluploadFreeYES!
\n

Enjoy our software and create great content!

\n

Oh, and by the way, don\'t forget to check out our other product called Plupload, your ultimate upload solution with HTML5 upload support!

'); \ No newline at end of file diff --git a/system/dbd/sql/mysql/data/sai_api.sql b/system/dbd/sql/mysql/data/sai_api.sql new file mode 100644 index 0000000..4745657 --- /dev/null +++ b/system/dbd/sql/mysql/data/sai_api.sql @@ -0,0 +1,151 @@ +DELETE FROM `system_api` WHERE `group` = 42; + +-- basic +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 42, 0, -1, NULL, 'sai_mod', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 42, 1, 0, NULL, 'js', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 42, 1, 0, NULL, 'css', NULL); +-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 42, 0, 0, NULL, 'page', NULL); + +-- system_api +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 42, 0, -1, NULL, 'call', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (11, 42, 0, 10, NULL, 'action', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (20, 42, 2, 11, 'login', 'username', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (21, 42, 2, 11, 'login', 'password_sha', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (22, 42, 2, 11, 'login', 'password_md5', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (23, 42, 2, 11, 'check', 'rightid', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 42, 2, 11, 'create', 'username', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 42, 2, 11, 'create', 'password_sha', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 42, 2, 11, 'create', 'email', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 42, 2, 10, 'text', 'request', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 42, 2, 40, 'text', 'lang', 'LANG'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (50, 42, 2, 10, 'pages', 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 42, 2, 10, 'pages', 'state', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (52, 42, 1, 50, NULL, 'js', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (53, 42, 2, 51, NULL, 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (55, 42, 1, 50, NULL, 'css', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (56, 42, 2, 55, NULL, 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 42, 4, -1, NULL, '_lang', 'LANG'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 42, 4, -1, NULL, '_result', 'RESULT'); + +-- specific stuff for mods +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_login', 'action', NULL); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (101, 42, 2, 100, 'login', 'username', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (102, 42, 2, 100, 'login', 'password_sha', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (103, 42, 2, 100, 'login', 'password_md5', 'ALL'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (110, 42, 2, 100, 'register', 'username', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (111, 42, 2, 100, 'register', 'password', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (112, 42, 2, 100, 'register', 'email', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (113, 42, 3, 100, 'register', 'locale', 'ALL'); + + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_log', 'action', NULL); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (201, 42, 3, 200, 'filter', 'filter', 'STRING'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (210, 42, 3, 200, 'error', 'error', 'INT'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (220, 42, 0, 200, 'stats', 'name', null); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (221, 42, 3, 220, null, 'filter', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (222, 42, 3, 220, null, 'db', 'STRING'); + + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (301, 42, 2, 300, 'user', 'username', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (302, 42, 3, 300, 'users', 'search', 'STRING'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (310, 42, 2, 300, 'addright', 'id', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (311, 42, 2, 300, 'addright', 'name', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (312, 42, 2, 300, 'addright', 'description', 'STRING'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (320, 42, 2, 300, 'deleteright', 'id', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (321, 42, 2, 300, 'deleterightconfirm', 'id', 'UINT'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (330, 42, 2, 300, 'addrightuser', 'rightid', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (331, 42, 2, 300, 'addrightuser', 'userid', 'UINT'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (340, 42, 2, 300, 'deleterightuser', 'rightid', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (341, 42, 2, 300, 'deleterightuser', 'userid', 'UINT'); + + +-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (400, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_sai_mods', 'action', NULL); + + +-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL); + + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (600, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_api', 'action', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (601, 42, 2, 600, 'addcall', 'ID', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (602, 42, 2, 600, 'addcall', 'group', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (603, 42, 2, 600, 'addcall', 'type', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (604, 42, 2, 600, 'addcall', 'parentID', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (605, 42, 2, 600, 'addcall', 'parentValue', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (606, 42, 2, 600, 'addcall', 'name', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (607, 42, 2, 600, 'addcall', 'verify', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (608, 42, 2, 600, 'deletecall', 'ID', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (609, 42, 2, 600, 'deletedialog', 'ID', 'INT'); + + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_locale', 'action', NULL); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (701, 42, 2, 700, 'load', 'id', 'LANG'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (702, 42, 2, 700, 'load', 'group', 'INT'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (710, 42, 2, 700, 'singleload', 'id', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (711, 42, 2, 700, 'singleload', 'lang', 'ALL'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (720, 42, 2, 700, 'delete', 'id', 'ALL'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (730, 42, 2, 700, 'add', 'id', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (731, 42, 2, 700, 'add', 'category', 'INT'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (740, 42, 2, 700, 'edit', 'id', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (741, 42, 2, 700, 'edit', 'lang', 'LANG'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (742, 42, 2, 700, 'edit', 'category', 'ALL'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (743, 42, 2, 700, 'edit', 'newtext', 'ALL'); + + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (800, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_files', 'action', NULL); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (801, 42, 2, 800, 'upload', 'cat', 'STRING'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (810, 42, 2, 800, 'del', 'cat', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (811, 42, 2, 800, 'del', 'id', 'STRING'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (820, 42, 2, 800, 'rn', 'cat', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (821, 42, 2, 800, 'rn', 'id', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (822, 42, 2, 800, 'rn', 'newid', 'STRING'); +-- +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (830, 42, 2, 800, 'tab', 'name', 'STRING'); + + +-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (900, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cache', 'action', NULL); + + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1000, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_todo', 'action', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1001, 42, 2, 1000, 'todo', 'todo', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1010, 42, 2, 1000, 'edit', 'todo', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1011, 42, 2, 1000, 'edit', 'message', 'STRING'); + + +-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cron', 'action', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1201, 42, 2, 1200, 'add', 'cls', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1202, 42, 2, 1200, 'add', 'min', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1203, 42, 2, 1200, 'add', 'hour', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1204, 42, 2, 1200, 'add', 'day', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1205, 42, 2, 1200, 'add', 'day_week', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1206, 42, 2, 1200, 'add', 'month', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1208, 42, 2, 1200, 'del', 'cls', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 2, 1200, 'change', 'cls', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1211, 42, 2, 1200, 'change', 'status', 'INT'); \ No newline at end of file diff --git a/system/dbd/sql/mysql/data/sai_error_locale_string.sql b/system/dbd/sql/mysql/data/sai_error_locale_string.sql new file mode 100644 index 0000000..3517ad2 --- /dev/null +++ b/system/dbd/sql/mysql/data/sai_error_locale_string.sql @@ -0,0 +1,9 @@ +DELETE FROM system_locale_string WHERE category = 43; +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_short', 43, 'Username is too short', 'Nutzername ist zu kurz'); +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_long', 43, 'Username is too long', 'Nutzername ist zu lang'); +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_miss', 43, 'Username required', 'Nutzername erfoderlich'); +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_miss', 43, 'Password required', 'Passwort erforderlich'); +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_long', 43, 'Password too long', 'Passwort zu lang'); +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_short', 43, 'Password too short', 'Passwort zu kurz'); +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_match', 43, 'Passwords do not match!', 'Passwords do not match!'); +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_email_wrong', 43, 'Invalid EMail!', 'Invalid EMail!'); \ No newline at end of file diff --git a/system/dbd/sql/mysql/data/sai_locale_string.sql b/system/dbd/sql/mysql/data/sai_locale_string.sql new file mode 100644 index 0000000..c91637c --- /dev/null +++ b/system/dbd/sql/mysql/data/sai_locale_string.sql @@ -0,0 +1,2 @@ +DELETE FROM system_locale_string WHERE category = 42; +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_mod_login_text', 42, 'Please login for developer access (if you are a developer).', 'Please login for developer access (if you are a developer).'); \ No newline at end of file diff --git a/system/dbd/sql/mysql/data/system_api.sql b/system/dbd/sql/mysql/data/system_api.sql new file mode 100644 index 0000000..8c1bf33 --- /dev/null +++ b/system/dbd/sql/mysql/data/system_api.sql @@ -0,0 +1,25 @@ +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 0, 0, -1, NULL, 'call', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (11, 0, 0, 10, NULL, 'action', NULL); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (20, 0, 2, 11, 'login', 'username', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (21, 0, 2, 11, 'login', 'password_sha', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (22, 0, 2, 11, 'login', 'password_md5', 'STRING'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (23, 0, 2, 11, 'check', 'rightid', 'UINT'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 0, 2, 11, 'create', 'username', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 0, 2, 11, 'create', 'password_sha', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 0, 2, 11, 'create', 'email', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 0, 2, 11, 'create', 'locale', 'LANG'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 0, 2, 10, 'files', 'cat', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 0, 3, 30, 'files', 'id', 'STRING'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 0, 2, 10, 'text', 'request', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 0, 2, 10, 'text', 'lang', 'LANG'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (50, 0, 2, 10, 'pages', 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 0, 2, 10, 'pages', 'state', 'STRING'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 0, 4, -1, NULL, '_lang', 'LANG'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 0, 4, -1, NULL, '_result', 'RESULT'); \ No newline at end of file diff --git a/system/dbd/sql/mysql/data/system_api_default.sql b/system/dbd/sql/mysql/data/system_api_default.sql new file mode 100644 index 0000000..d3989c6 --- /dev/null +++ b/system/dbd/sql/mysql/data/system_api_default.sql @@ -0,0 +1,2 @@ +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 1, 4, -1, NULL, '_escaped_fragment_', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 1, 0, -1, NULL, 'page', NULL); diff --git a/system/dbd/sql/mysql/data/system_cron.sql b/system/dbd/sql/mysql/data/system_cron.sql new file mode 100644 index 0000000..f955752 --- /dev/null +++ b/system/dbd/sql/mysql/data/system_cron.sql @@ -0,0 +1 @@ +INSERT INTO `system_cron` (`class`, `min`, `hour`, `day`, `day_week`, `month`, `last_run`, `status`) VALUES ('\\SYSTEM\\CRON\\cron_log2sqlite', 0, 0, 0, 0, 0, '2015-01-01 01:00:00', 0); diff --git a/system/dbd/sql/mysql/data/system_rights.sql b/system/dbd/sql/mysql/data/system_rights.sql new file mode 100644 index 0000000..f56c8bb --- /dev/null +++ b/system/dbd/sql/mysql/data/system_rights.sql @@ -0,0 +1,13 @@ +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (1, 'SYS_SAI', 'SAI access right'); + +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (5, 'SYS_SAI_SECURITY', 'Allows access to the Security Module in SAI'); +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (6, 'SYS_SAI_SECURITY_RIGHTS_EDIT', 'Allows deleting, editing and adding of Right in the SAI module Security'); + +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (10, 'SYS_SAI_LOCALE', 'Allows access to the Locale Module in SAI to edit or add Multilanguage Text'); + +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (15, 'SYS_SAI_IMG', 'Allows access to the Image Module in SAI to delete or add Pictures'); + +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (20, 'SYS_SAI_API', 'SAI API Access right'); +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (21, 'SYS_SAI_API_EDIT', 'SAI API Edit right'); + +INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (25, 'SYS_SAI_CRON', 'SAI Cron Access right'); \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_api.sql b/system/dbd/sql/mysql/schema/system_api.sql new file mode 100644 index 0000000..24887b5 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_api.sql @@ -0,0 +1,12 @@ +CREATE TABLE `system_api` ( + `ID` INT(10) UNSIGNED NOT NULL, + `group` INT(10) UNSIGNED NOT NULL, + `type` TINYINT(3) UNSIGNED NOT NULL, + `parentID` INT(11) NOT NULL, + `parentValue` CHAR(50) NULL DEFAULT NULL, + `name` CHAR(50) NOT NULL, + `verify` CHAR(50) NULL DEFAULT NULL, + PRIMARY KEY (`ID`, `group`) +) +COLLATE='utf8_general_ci' +ENGINE=MyISAM; \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_cache.sql b/system/dbd/sql/mysql/schema/system_cache.sql new file mode 100644 index 0000000..18737d4 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_cache.sql @@ -0,0 +1,9 @@ +CREATE TABLE `system_cache` ( + `ID` INT(10) NOT NULL AUTO_INCREMENT, + `CacheID` INT(10) NOT NULL, + `Ident` CHAR(255) NOT NULL, + `data` BINARY(255) NOT NULL, + PRIMARY KEY (`ID`) +) +COLLATE='utf8_general_ci' +ENGINE=MyISAM; \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_cron.sql b/system/dbd/sql/mysql/schema/system_cron.sql new file mode 100644 index 0000000..d884858 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_cron.sql @@ -0,0 +1,13 @@ +CREATE TABLE `system_cron` ( + `class` CHAR(255) NOT NULL, + `min` INT(10) NULL DEFAULT NULL, + `hour` INT(10) NULL DEFAULT NULL, + `day` INT(10) NULL DEFAULT NULL, + `day_week` INT(10) NULL DEFAULT NULL, + `month` INT(10) NULL DEFAULT NULL, + `last_run` TIMESTAMP NULL DEFAULT NULL, + `status` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`class`) +) +COLLATE='utf8_general_ci' +ENGINE=InnoDB; diff --git a/system/dbd/sql/mysql/schema/system_locale_string.sql b/system/dbd/sql/mysql/schema/system_locale_string.sql new file mode 100644 index 0000000..8727700 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_locale_string.sql @@ -0,0 +1,10 @@ +CREATE TABLE `system_locale_string` ( + `id` CHAR(35) NOT NULL, + `category` INT(10) UNSIGNED NOT NULL, + `enUS` TEXT NOT NULL, + `deDE` TEXT NOT NULL, + PRIMARY KEY (`id`) +) +COMMENT='Shall hold strings and its translation' +COLLATE='utf8_general_ci' +ENGINE=MyISAM; \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_log.sql b/system/dbd/sql/mysql/schema/system_log.sql new file mode 100644 index 0000000..37f80a8 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_log.sql @@ -0,0 +1,24 @@ +CREATE TABLE `system_log` ( + `ID` INT(10) NOT NULL AUTO_INCREMENT, + `class` TEXT NOT NULL, + `message` TEXT NOT NULL, + `code` INT(11) NOT NULL, + `file` TEXT NOT NULL, + `line` INT(11) NOT NULL, + `trace` TEXT NOT NULL, + `ip` TEXT NOT NULL, + `querytime` DOUBLE NOT NULL, + `time` DATETIME NOT NULL, + `server_name` CHAR(255) NOT NULL, + `server_port` INT(10) UNSIGNED NOT NULL, + `request_uri` CHAR(255) NOT NULL, + `post` TEXT NOT NULL, + `http_referer` CHAR(255) NULL DEFAULT NULL, + `http_user_agent` TEXT NOT NULL, + `user` INT(11) NULL DEFAULT NULL, + `thrown` BIT(1) NOT NULL, + PRIMARY KEY (`ID`) +) +COLLATE='utf8_general_ci' +ENGINE=MyISAM +AUTO_INCREMENT=1; \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_page.sql b/system/dbd/sql/mysql/schema/system_page.sql new file mode 100644 index 0000000..871cd6b --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_page.sql @@ -0,0 +1,11 @@ +CREATE TABLE `system_page` ( + `group` INT(10) UNSIGNED NOT NULL, + `id` CHAR(50) NOT NULL, + `div` CHAR(50) NOT NULL, + `url` TEXT NOT NULL, + `func` CHAR(50) NOT NULL, + `php_class` CHAR(50) NOT NULL, + PRIMARY KEY (`id`, `div`, `group`) +) +COLLATE='utf8_unicode_ci' +ENGINE=InnoDB; diff --git a/system/dbd/sql/mysql/schema/system_rights.sql b/system/dbd/sql/mysql/schema/system_rights.sql new file mode 100644 index 0000000..2a9fe88 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_rights.sql @@ -0,0 +1,9 @@ +CREATE TABLE `system_rights` ( + `ID` INT(10) NOT NULL AUTO_INCREMENT, + `name` CHAR(50) NOT NULL, + `description` CHAR(255) NOT NULL, + PRIMARY KEY (`ID`) +) +COLLATE='utf8_general_ci' +ENGINE=MyISAM +AUTO_INCREMENT=16; \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_todo.sql b/system/dbd/sql/mysql/schema/system_todo.sql new file mode 100644 index 0000000..a833791 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_todo.sql @@ -0,0 +1,29 @@ +CREATE TABLE `system_todo` ( + `ID` INT(10) NOT NULL AUTO_INCREMENT, + `class` TEXT NOT NULL, + `message` TEXT NOT NULL, + `message_hash` CHAR(40) NOT NULL, + `code` INT(10) UNSIGNED NOT NULL, + `file` CHAR(255) NOT NULL, + `line` INT(11) NOT NULL, + `trace` TEXT NOT NULL, + `ip` TEXT NOT NULL, + `querytime` DOUBLE NOT NULL, + `time` DATETIME NOT NULL, + `server_name` CHAR(255) NOT NULL, + `server_port` INT(10) UNSIGNED NOT NULL, + `request_uri` CHAR(255) NOT NULL, + `post` TEXT NOT NULL, + `http_referer` CHAR(255) NOT NULL, + `http_user_agent` TEXT NOT NULL, + `user` INT(10) UNSIGNED NOT NULL, + `thrown` BIT(1) NOT NULL, + `type` INT(11) NOT NULL DEFAULT '0', + `count` INT(11) NOT NULL DEFAULT '1', + `state` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`), + UNIQUE INDEX `file_line_message` (`file`, `line`, `message_hash`) +) +COLLATE='utf8_general_ci' +ENGINE=MyISAM +AUTO_INCREMENT=92; \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_user.sql b/system/dbd/sql/mysql/schema/system_user.sql new file mode 100644 index 0000000..65e1f64 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_user.sql @@ -0,0 +1,15 @@ +CREATE TABLE `system_user` ( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `username` CHAR(32) NOT NULL, + `password_sha` CHAR(255) NULL DEFAULT NULL, + `password_md5` CHAR(255) NULL DEFAULT NULL, + `email` CHAR(255) NOT NULL, + `joindate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `locale` CHAR(6) NOT NULL DEFAULT 'enUS', + `last_active` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', + `account_flag` INT(10) NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) +COLLATE='utf8_general_ci' +ENGINE=InnoDB +AUTO_INCREMENT=1; \ No newline at end of file diff --git a/system/dbd/sql/mysql/schema/system_user_to_rights.sql b/system/dbd/sql/mysql/schema/system_user_to_rights.sql new file mode 100644 index 0000000..ecb3958 --- /dev/null +++ b/system/dbd/sql/mysql/schema/system_user_to_rights.sql @@ -0,0 +1,7 @@ +CREATE TABLE `system_user_to_rights` ( + `rightID` INT(10) NOT NULL DEFAULT '0', + `userID` INT(10) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`rightID`, `userID`) +) +COLLATE='utf8_general_ci' +ENGINE=InnoDB; \ No newline at end of file diff --git a/system/dbd/sql/pg/data/basic_locale_string.sql b/system/dbd/sql/pg/data/basic_locale_string.sql new file mode 100644 index 0000000..12bce7b --- /dev/null +++ b/system/dbd/sql/pg/data/basic_locale_string.sql @@ -0,0 +1,23 @@ +DELETE FROM system.locale_string WHERE category = 1; +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_logout', 1, 'Logout', 'Ausloggen'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_login', 1, 'Login', 'Einloggen'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_register', 1, 'Register', 'Registrieren'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_username', 1, 'Username', 'Username'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_password', 1, 'Password', 'Passwort'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_email', 1, 'EMail', 'E-Mail2'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_last_active', 1, 'Last active', 'Zuletzt aktiv'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_join_date', 1, 'Joindate', 'Beitrittsdatum'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_locale', 1, 'Locale', 'Sprache'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_admin_rights', 1, 'Admin Rights', 'Admin Rechte'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_cancel', 1, 'Cancel', 'Abbrechen'); + +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_logout', 1, 'Logout before you leave!', 'Loggen Sie sie sich aus bevor Sie gehen!'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_login', 1, 'Login to your Website.', 'Loggen Sie sich in ihre Website ein.'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_register', 1, 'Register an Account', 'Register an Account'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_password_miss', 1, 'Cannot really remember your Password?', 'Cannot really remember your Password?'); + +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_placeholder_username', 1, 'peter / peter@world.org', 'peter / peter@world.org'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_placeholder_password', 1, 'my secret123', 'geheim567'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_placeholder_email', 1, 'peter@world.org', 'peter@world.org'); + +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_state_login', 1, 'You are logged in.', 'You are logged in.'); \ No newline at end of file diff --git a/system/dbd/sql/pg/data/sai_api.sql b/system/dbd/sql/pg/data/sai_api.sql new file mode 100644 index 0000000..30f0cc0 --- /dev/null +++ b/system/dbd/sql/pg/data/sai_api.sql @@ -0,0 +1,129 @@ +DELETE FROM system.api WHERE "group" = 42; + +-- basic +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (0, 42, 0, -1, NULL, 'sai_mod', NULL); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1, 42, 1, 0, NULL, 'js', NULL); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (2, 42, 1, 0, NULL, 'css', NULL); +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (3, 42, 0, 0, NULL, 'page', NULL); + +-- system_api +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (10, 42, 0, -1, NULL, 'call', NULL); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (11, 42, 0, 10, NULL, 'action', NULL); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (20, 42, 2, 11, 'login', 'username', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (21, 42, 2, 11, 'login', 'password_sha', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (22, 42, 2, 11, 'login', 'password_md5', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (23, 42, 2, 11, 'check', 'rightid', 'UINT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (24, 42, 2, 11, 'create', 'username', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (25, 42, 2, 11, 'create', 'password_sha', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (26, 42, 2, 11, 'create', 'email', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (40, 42, 4, -1, NULL, '_lang', 'LANG'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (41, 42, 4, -1, NULL, '_result', 'RESULT'); + +-- specific stuff for mods +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_login', 'action', NULL); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (101, 42, 2, 100, 'login', 'username', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (102, 42, 2, 100, 'login', 'password_sha', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (103, 42, 2, 100, 'login', 'password_md5', 'ALL'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (110, 42, 2, 100, 'register', 'username', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (111, 42, 2, 100, 'register', 'password', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (112, 42, 2, 100, 'register', 'email', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (113, 42, 3, 100, 'register', 'locale', 'ALL'); + + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_log', 'action', NULL); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (201, 42, 3, 200, 'filter', 'filter', 'STRING'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (210, 42, 3, 200, 'error', 'error', 'INT'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (220, 42, 0, 200, 'stats', 'name', null); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (221, 42, 3, 220, null, 'filter', 'UINT'); + + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (301, 42, 2, 300, 'user', 'username', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (302, 42, 3, 300, 'users', 'search', 'STRING'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (310, 42, 2, 300, 'addright', 'id', 'UINT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (311, 42, 2, 300, 'addright', 'name', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (312, 42, 2, 300, 'addright', 'description', 'STRING'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (320, 42, 2, 300, 'deleteright', 'id', 'UINT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (321, 42, 2, 300, 'deleterightconfirm', 'id', 'UINT'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (330, 42, 2, 300, 'addrightuser', 'rightid', 'UINT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (331, 42, 2, 300, 'addrightuser', 'userid', 'UINT'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (340, 42, 2, 300, 'deleterightuser', 'rightid', 'UINT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (341, 42, 2, 300, 'deleterightuser', 'userid', 'UINT'); + + +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (400, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_sai_mods', 'action', NULL); + + +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL); + + +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (600, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_api', 'action', NULL); + + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_locale', 'action', NULL); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (701, 42, 2, 700, 'load', 'id', 'LANG'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (702, 42, 2, 700, 'load', 'group', 'INT'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (710, 42, 2, 700, 'singleload', 'id', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (711, 42, 2, 700, 'singleload', 'lang', 'ALL'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (720, 42, 2, 700, 'delete', 'id', 'ALL'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (730, 42, 2, 700, 'add', 'id', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (731, 42, 2, 700, 'add', 'category', 'INT'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (740, 42, 2, 700, 'edit', 'id', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (741, 42, 2, 700, 'edit', 'lang', 'LANG'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (742, 42, 2, 700, 'edit', 'category', 'ALL'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (743, 42, 2, 700, 'edit', 'newtext', 'ALL'); + + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (800, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_files', 'action', NULL); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (801, 42, 2, 800, 'upload', 'cat', 'STRING'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (810, 42, 2, 800, 'del', 'cat', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (811, 42, 2, 800, 'del', 'id', 'STRING'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (820, 42, 2, 800, 'rn', 'cat', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (821, 42, 2, 800, 'rn', 'id', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (822, 42, 2, 800, 'rn', 'newid', 'STRING'); +-- +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (830, 42, 2, 800, 'tab', 'name', 'STRING'); + + +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (900, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cache', 'action', NULL); + + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1000, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_todo', 'action', NULL); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1001, 42, 2, 1000, 'todo', 'todo', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING'); + + +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL); + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cron', 'action', NULL); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1201, 42, 2, 1200, 'add', 'cls', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1202, 42, 2, 1200, 'add', 'min', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1203, 42, 2, 1200, 'add', 'hour', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1204, 42, 2, 1200, 'add', 'day', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1205, 42, 2, 1200, 'add', 'day_week', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1206, 42, 2, 1200, 'add', 'month', 'INT'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1208, 42, 2, 1200, 'del', 'cls', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING'); \ No newline at end of file diff --git a/system/dbd/sql/pg/data/sai_error_locale_string.sql b/system/dbd/sql/pg/data/sai_error_locale_string.sql new file mode 100644 index 0000000..98e4c3c --- /dev/null +++ b/system/dbd/sql/pg/data/sai_error_locale_string.sql @@ -0,0 +1,9 @@ +DELETE FROM system.locale_string WHERE category = 43; +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_username_short', 43, 'Username is too short', 'Nutzername ist zu kurz'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_username_long', 43, 'Username is too long', 'Nutzername ist zu lang'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_username_miss', 43, 'Username required', 'Nutzername erfoderlich'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_miss', 43, 'Password required', 'Passwort erforderlich'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_long', 43, 'Password too long', 'Passwort zu lang'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_short', 43, 'Password too short', 'Passwort zu kurz'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_match', 43, 'Passwords do not match!', 'Passwords do not match!'); +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_email_wrong', 43, 'Invalid EMail!', 'Invalid EMail!'); \ No newline at end of file diff --git a/system/dbd/sql/pg/data/sai_locale_string.sql b/system/dbd/sql/pg/data/sai_locale_string.sql new file mode 100644 index 0000000..7ed052c --- /dev/null +++ b/system/dbd/sql/pg/data/sai_locale_string.sql @@ -0,0 +1,2 @@ +DELETE FROM system.locale_string WHERE category = 42; +INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_mod_login_text', 42, 'Please login for developer access (if you are a developer).', 'Please login for developer access (if you are a developer).'); \ No newline at end of file diff --git a/system/dbd/sql/pg/data/system_api.sql b/system/dbd/sql/pg/data/system_api.sql new file mode 100644 index 0000000..e555ee5 --- /dev/null +++ b/system/dbd/sql/pg/data/system_api.sql @@ -0,0 +1,19 @@ +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (10, 42, 0, -1, NULL, 'call', NULL); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (11, 42, 0, 10, NULL, 'action', NULL); + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (20, 42, 2, 11, 'login', 'username', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (21, 42, 2, 11, 'login', 'password_sha', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (22, 42, 2, 11, 'login', 'password_md5', 'STRING'); + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (23, 42, 2, 11, 'check', 'rightid', 'UINT'); + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (24, 42, 2, 11, 'create', 'username', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (25, 42, 2, 11, 'create', 'password_sha', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (26, 42, 2, 11, 'create', 'email', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG'); + +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING'); +INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING'); + +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (100, 0, 2, 0, 'files', 'cat', 'STRING'); +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (101, 0, 3, 0, 'files', 'id', 'STRING'); \ No newline at end of file diff --git a/system/dbd/sql/pg/data/system_rights.sql b/system/dbd/sql/pg/data/system_rights.sql new file mode 100644 index 0000000..5fb019b --- /dev/null +++ b/system/dbd/sql/pg/data/system_rights.sql @@ -0,0 +1,13 @@ +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (1, 'SYS_SAI', 'SAI access right'); + +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (5, 'SYS_SAI_SECURITY', 'Allows access to the Security Module in SAI'); +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (6, 'SYS_SAI_SECURITY_RIGHTS_EDIT', 'Allows deleting, editing and adding of Right in the SAI module Security'); + +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (10, 'SYS_SAI_LOCALE', 'Allows access to the Locale Module in SAI to edit or add Multilanguage Text'); + +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (15, 'SYS_SAI_IMG', 'Allows access to the Image Module in SAI to delete or add Pictures'); + +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (20, 'SYS_SAI_API', 'SAI API Access right'); +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (21, 'SYS_SAI_API_EDIT', 'SAI API Edit right'); + +INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (25, 'SYS_SAI_CRON', 'SAI Cron Access right'); \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/schema.sql b/system/dbd/sql/pg/schema/schema.sql new file mode 100644 index 0000000..349ddc7 --- /dev/null +++ b/system/dbd/sql/pg/schema/schema.sql @@ -0,0 +1,2 @@ +CREATE SCHEMA system + AUTHORIZATION username; \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/system_api.sql b/system/dbd/sql/pg/schema/system_api.sql new file mode 100644 index 0000000..0bb4366 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_api.sql @@ -0,0 +1,16 @@ +CREATE TABLE system.api +( + "ID" integer NOT NULL, + "group" integer NOT NULL, + type integer NOT NULL, + "parentID" integer NOT NULL, + "parentValue" character varying(50), + name character varying(50) NOT NULL, + verify character varying(50), + CONSTRAINT system_api_pk PRIMARY KEY ("ID", "group") +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.api + OWNER TO username; diff --git a/system/dbd/sql/pg/schema/system_cache.sql b/system/dbd/sql/pg/schema/system_cache.sql new file mode 100644 index 0000000..b2e6fd7 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_cache.sql @@ -0,0 +1,32 @@ +CREATE TABLE system.cache +( + "ID" integer NOT NULL DEFAULT nextval('system."cache_ID_seq"'::regclass), + "CacheID" integer NOT NULL, + "Ident" character varying NOT NULL, + data bytea, + CONSTRAINT pk_system_cache_id PRIMARY KEY ("ID"), + CONSTRAINT unique_system_cache_cid_ident UNIQUE ("CacheID", "Ident") +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.cache + OWNER TO username; + +-- Index: system."cache_CacheID_Ident_idx" + +-- DROP INDEX system."cache_CacheID_Ident_idx"; + +CREATE INDEX "cache_CacheID_Ident_idx" + ON system.cache + USING btree + ("CacheID", "Ident" COLLATE pg_catalog."default"); + +-- Index: system."cache_Ident_idx" + +-- DROP INDEX system."cache_Ident_idx"; + +CREATE INDEX "cache_Ident_idx" + ON system.cache + USING btree + ("Ident" COLLATE pg_catalog."default"); \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/system_cron.sql b/system/dbd/sql/pg/schema/system_cron.sql new file mode 100644 index 0000000..650af2a --- /dev/null +++ b/system/dbd/sql/pg/schema/system_cron.sql @@ -0,0 +1,17 @@ +CREATE TABLE system.cron +( + "class" character varying(255) NOT NULL, + "min" integer DEFAULT NULL, + "hour" integer DEFAULT NULL, + "day" integer DEFAULT NULL, + "day_week" integer DEFAULT NULL, + "month" integer DEFAULT NULL, + "last_run" timestamp with time zone DEFAULT NULL, + "status" integer NOT NULL DEFAULT 0, + PRIMARY KEY ("class") +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.log + OWNER TO dasense; \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/system_locale_string.sql b/system/dbd/sql/pg/schema/system_locale_string.sql new file mode 100644 index 0000000..9a4c462 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_locale_string.sql @@ -0,0 +1,13 @@ +CREATE TABLE system.locale_string +( + id character varying(50) NOT NULL, + category integer NOT NULL DEFAULT 0, + "enUS" text, + "deDE" text, + CONSTRAINT system_locale_string_pk_id PRIMARY KEY (id) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.locale_string + OWNER TO username; \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/system_log.sql b/system/dbd/sql/pg/schema/system_log.sql new file mode 100644 index 0000000..3693664 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_log.sql @@ -0,0 +1,30 @@ +CREATE TABLE system.log +( + "ID" integer NOT NULL DEFAULT nextval('system."sys_log_ID_seq"'::regclass), + class text NOT NULL, + message text NOT NULL, + code integer NOT NULL, + file text NOT NULL, + line integer NOT NULL, + trace text NOT NULL, + ip text NOT NULL, + querytime double precision NOT NULL, + "time" timestamp with time zone NOT NULL DEFAULT now(), + server_name character varying(255), + server_port integer, + request_uri character varying(512), + post text, + http_referer character varying(255), + http_user_agent text, + "user" integer, + thrown integer, + CONSTRAINT system_log_pk_id PRIMARY KEY ("ID"), + CONSTRAINT system_log_fk_user FOREIGN KEY ("user") + REFERENCES system."user" (id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.log + OWNER TO dasense; \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/system_rights.sql b/system/dbd/sql/pg/schema/system_rights.sql new file mode 100644 index 0000000..02fe0a6 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_rights.sql @@ -0,0 +1,12 @@ +CREATE TABLE system.rights +( + "ID" integer NOT NULL DEFAULT nextval('system."user_rights_ID_seq"'::regclass), + name character varying(55) NOT NULL, + description character varying(255) NOT NULL, + CONSTRAINT system_rights_pk PRIMARY KEY ("ID") +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.rights + OWNER TO username; \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/system_todo.sql b/system/dbd/sql/pg/schema/system_todo.sql new file mode 100644 index 0000000..41c5972 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_todo.sql @@ -0,0 +1,34 @@ +CREATE TABLE system.todo +( + "ID" integer NOT NULL, + "class" text NOT NULL, + "message" text NOT NULL, + "message_hash" character varying(40) NOT NULL, + "code" integer NOT NULL, + "file" text NOT NULL, + "line" integer NOT NULL, + "trace" text NOT NULL, + "ip" text NOT NULL, + "querytime" double precision NOT NULL, + "time" timestamp with time zone NOT NULL DEFAULT now(), + server_name character varying(255), + server_port integer, + request_uri character varying(512), + post text, + http_referer character varying(255), + http_user_agent text, + "user" integer, + thrown integer, + "type" integer NOT NULL DEFAULT 0, + "count" integer NOT NULL DEFAULT 1, + "state" integer NOT NULL DEFAULT 0, + CONSTRAINT system_todo_pk_id PRIMARY KEY ("ID"), + CONSTRAINT system_todo_fk_user FOREIGN KEY ("user") + REFERENCES system."user" (id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.todo + OWNER TO dasense; \ No newline at end of file diff --git a/system/dbd/sql/pg/schema/system_user.sql b/system/dbd/sql/pg/schema/system_user.sql new file mode 100644 index 0000000..1b11fa2 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_user.sql @@ -0,0 +1,18 @@ +CREATE TABLE system."user" +( + id serial NOT NULL, + username character varying(32) NOT NULL, + password_sha character varying(255), + password_md5 character varying(255), + email character varying(255) NOT NULL, + joindate timestamp with time zone NOT NULL DEFAULT now(), + locale character varying(6) NOT NULL DEFAULT 'enUS'::character varying, + last_active timestamp with time zone NOT NULL DEFAULT now(), + account_flag integer, + CONSTRAINT system_user_pk_id PRIMARY KEY (id) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system."user" + OWNER TO username; diff --git a/system/dbd/sql/pg/schema/system_user_to_rights.sql b/system/dbd/sql/pg/schema/system_user_to_rights.sql new file mode 100644 index 0000000..1fde6e6 --- /dev/null +++ b/system/dbd/sql/pg/schema/system_user_to_rights.sql @@ -0,0 +1,16 @@ +CREATE TABLE system.user_to_rights +( + "rightID" integer NOT NULL, + "userID" integer NOT NULL, + CONSTRAINT "system_user_to_rights_fk_userID" FOREIGN KEY ("userID") + REFERENCES system."user" (id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "system_user_to_rights_rightID" FOREIGN KEY ("rightID") + REFERENCES system.rights ("ID") MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITH ( + OIDS=FALSE +); +ALTER TABLE system.user_to_rights + OWNER TO username; \ No newline at end of file diff --git a/system/dbd/sql/pg/util_copy_api_table_by_groupa.sql b/system/dbd/sql/pg/util_copy_api_table_by_groupa.sql new file mode 100644 index 0000000..3f6ba41 --- /dev/null +++ b/system/dbd/sql/pg/util_copy_api_table_by_groupa.sql @@ -0,0 +1,13 @@ +-- delete old entries of group +DELETE FROM system.api where "group" = 101; +-- get data from group 0 and write it in your group +INSERT INTO system.api ( "ID", "group","type","parentID","parentValue","name","verify" ) + SELECT "ID", + '101' as "group", -- target group + "type", + "parentID", + "parentValue", + "name", + "verify" + FROM system.api + WHERE "group" = 0; -- pattern group \ No newline at end of file diff --git a/system/dbd/tbl/UserLoginsTable.php b/system/dbd/tbl/UserLoginsTable.php new file mode 100644 index 0000000..690a1e3 --- /dev/null +++ b/system/dbd/tbl/UserLoginsTable.php @@ -0,0 +1,14 @@ +input_deviceinfo();} + public static function call_input_type_data($source,$json){ + $pars = new JSONParser($json, $source); + return $pars->input_data();} + + //#Imageoverlays + public static function call_map_algo_heatmapStd($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new heatmapStd_algo(); + return $imggen->generateTile($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_heatmapStd_flag_key($type){ + $imggen = new heatmapStd_algo(); + return $imggen->generateMapKey($type);} + public static function call_map_algo_heatmapStd_flag_markers($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new heatmapStd_algo(); + return $imggen->getMarkers($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + + public static function call_map_algo_heatmapRect($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new heatmapRect_algo(); + return $imggen->generateTile($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_heatmapRect_flag_key($type){ + $imggen = new heatmapRect_algo(); + return $imggen->generateMapKey($type);} + public static function call_map_algo_heatmapRect_flag_markers($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new heatmapRect_algo(); + return $imggen->getMarkers($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + + public static function call_map_algo_speedmap($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new speedmap_algo(); + return $imggen->generateTile($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_speedmap_flag_key($type){ + $imggen = new speedmap_algo(); + return $imggen->generateMapKey($type);} + public static function call_map_algo_speedmap_flag_markers($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new speedmap_algo(); + return $imggen->getMarkers($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + + public static function call_map_algo_differencemap($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new differencemap_algo(); + return $imggen->generateTile($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_differencemap_flag_key($type){ + $imggen = new differencemap_algo(); + return $imggen->generateMapKey($type);} + public static function call_map_algo_differencemap_flag_markers($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new differencemap_algo(); + return $imggen->getMarkers($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + + public static function call_map_algo_tramlines($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new tramlines_algo(); + return $imggen->generateTile($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_tramlines_flag_key($type){ + $imggen = new tramlines_algo(); + return $imggen->generateMapKey($type);} + public static function call_map_algo_tramlines_flag_markers($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new tramlines_algo(); + return $imggen->getMarkers($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + + public static function call_map_algo_tram($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new tram_algo(); + return $imggen->generateTile($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_tram_flag_key($type){ + $imggen = new tram_algo(); + return $imggen->generateMapKey($type);} + public static function call_map_algo_tram_flag_markers($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new tram_algo(); + return $imggen->getMarkers($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + + public static function call_map_algo_animationTest($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new animationTest_algo(); + return $imggen->generateTile($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_animationTest_flag_key($type){ + $imggen = new animationTest_algo(); + return $imggen->generateMapKey($type);} + public static function call_map_algo_animationTest_flag_markers($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new animationTest_algo(); + return $imggen->getMarkers($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + public static function call_map_algo_animationTest_flag_animation($x,$y,$zoom,$time_start,$time_end,$type,$provider){ + $imggen = new animationTest_algo(); + return $imggen->getAnimation($x,$y,$zoom,$time_start,$time_end,$type,$provider);} + + //#Analysis API + // insert new bonus area + public static function call_analysis_action_barea_mthd_insert($pswd,$json){ + return BonusAreaController::insert($pswd, $json);} + // get all bonus areas + public static function call_analysis_action_barea_mthd_getall(){ + return BonusAreaController::getall();} + // get all active bonus areas + public static function call_analysis_action_barea_mthd_getallactive(){ + return BonusAreaController::getallactive();} + // within a bonus area? + public static function call_analysis_action_barea_mthd_within($lat,$lng,$when){ + return BonusAreaController::within($lat, $lng, $when);} + + // get total statistics + public static function call_analysis_action_statistic_mthd_gettotal($useruid,$intval){ + return StatisticsController::getTotalUserStatistics($useruid,$intval);} + // get series statistics + public static function call_analysis_action_statistic_mthd_getseries($useruid){ + return StatisticsController::getTotalSeriesStatistics($useruid);} + // get 24 map projection + public static function call_analysis_action_statistic_mthd_projection24($useruid,$intval){ + return StatisticsController::getProjection24($intval, $useruid);} + + // get own rank + public static function call_analysis_action_rank_mthd_get($useruid,$acronym){ + return RankController::getRank($useruid, $acronym);} + // get own history ranks + public static function call_analysis_action_rank_mthd_gethist($useruid,$sort){ + return RankController::getRankHistoryByUser($useruid, $sort);} + // questions calls + public static function call_analysis_action_rank_mthd_is($useruid,$acronym){ + return RankController::isRank($useruid, $acronym);} + + // get all achievements by userUID + public static function call_analysis_action_achievement_mthd_getbyuser($useruid){ + return AchievementController::getReachedAchievements($useruid);} + // get all defined achievements conditions + public static function call_analysis_action_achievement_mthd_getallcond($useruid, $acronym){ + return AchievementController::getAllAchievementDefinitionCondition($acronym, $useruid);} + // get all defined achievements + public static function call_analysis_action_achievement_mthd_getalldefs($useruid, $acronym){ + return AchievementController::getAllAchievementDefinitionCondition($acronym, $useruid);} + + // get current ranking all + public static function call_analysis_action_ranking_mthd_all($useruid,$last){ + return RankingController::getRankingAll($useruid,$last);} + // get current ranking own + public static function call_analysis_action_ranking_mthd_own($useruid,$last){ + return RankingController::getRankingOwn($useruid,$last);} + + // get explore factor + public static function call_analysis_action_data_mthd_explore($lat,$lng,$radius,$endtime){ + return DataController::getExplore($lat, $lng, $radius, $endtime);} + // get cities by postal code + public static function call_analysis_action_data_mthd_citybyzip($zip){ + return DataController::queryByZip($zip);} + + // store registration id + public static function call_analysis_action_ctwodm_mthd_register($useruid, $regid, $deviceid){ + return MessageController::handleRegistrationId($regid, $useruid, $deviceid);} + // fetch new messages + public static function call_analysis_action_ctwodm_mthd_fetch($useruid, $last){ + return MessageController::fetchAllData($useruid,$last);} + + // call=locale + public static function call_locale($request,$lang){ + $starttime = microtime(true); + return JsonResult::toString($starttime, \SYSTEM\locale::getStrings($request, $lang));} + + //TODO remove -> backend + public function call_preprocessing1233423DONOTCALL(){ + PreprocessAll::process(); + } +}; \ No newline at end of file diff --git a/system/docu/apiclass/ApiVerify.php b/system/docu/apiclass/ApiVerify.php new file mode 100644 index 0000000..eacf875 --- /dev/null +++ b/system/docu/apiclass/ApiVerify.php @@ -0,0 +1,17 @@ + 0 & $param < 10;} + public static function GOOGLEMAPCOORD ($param){ return self::UINT($param);} + public static function GOOGLEMAPZOOM ($param){ return self::UINT($param) && $param < 20;} + public static function WIERDTIMESTAMP ($param){ return (strtotime($param)==false) ? false : true;} + public static function SENSORPROVIDER ($param){ return true;} //TODO remove this param + public static function LATLONCOORD ($param){ return self::FLOAT($param) && floatval($param) >= 0 && floatval($param) <= 180;} + public static function USERNAME ($param){ return self::STRING($param) && strlen($param) >=3 && strlen($param) <= 30;} + public static function PASSWORD ($param){ return self::STRING($param) && strlen($param) >=5 && strlen($param) <= 16;} + public static function HASH ($param){ return preg_match("^[0-9A-Fa-f]+$^", $param) != 0 && strlen($param) >=5;} + public static function PASSHASH ($param){ return self::PASSWORD($param) || self::HASH($param);} + public static function EMAIL ($param){ return filter_var($param, FILTER_VALIDATE_EMAIL);} + public static function ARRAYINT ($param){ return self::ARY($param) || self::INT($param);} +} \ No newline at end of file diff --git a/system/docu/apiclass/PageApi.php b/system/docu/apiclass/PageApi.php new file mode 100644 index 0000000..c23ab93 --- /dev/null +++ b/system/docu/apiclass/PageApi.php @@ -0,0 +1,110 @@ +getConstants(); + $line_end = $class->getEndLine(); + $extension_name = $class->getExtensionName(); + $filename = $class->getFileName(); + $interfaces = $class->getInterfaceNames(); + $methods = $class->getMethods(); + $modifiers = $class->getModifiers(); + $name_long = $class->getName(); + $namespace = $class->getNamespaceName(); + $properties = $class->getProperties(); + $name_short = $class->getShortName(); + $line_start = $class->getStartLine(); + $properties_static = $class->getStaticProperties(); + $in_namespace = $class->inNamespace(); + $is_abstract = $class->isAbstract(); + $is_final = $class->isFinal(); + $is_instantiable = $class->isInstantiable(); + $is_interace = $class->isInterface(); + $is_internal = $class->isInternal(); + $is_iterateable = $class->isIterateable(); + $is_user_defined = $class->isUserDefined(); + + $con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo()); + //$con->query('SELECT count(*) FROM `system_code_docu_class` WHERE ') + $con->prepare( 'insert_class', + "INSERT INTO `system_code_docu_class` (`class`, `name`, `namespace`, `dead`, `line_start`, `line_end`, `file`, `abstract`, `final`, `instantiable`, `interface`, `internal`, `iterateable`, `userdefined`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", + array($name_long,$name_short,$namespace,(int)false,$line_start,$line_end,$filename,(int)$is_abstract,(int)$is_final,(int)$is_instantiable,(int)$is_interace,(int)$is_internal,(int)$is_iterateable,(int)$is_user_defined)); + + + } +} \ No newline at end of file diff --git a/system/docu/docu.php b/system/docu/docu.php new file mode 100644 index 0000000..e073f91 --- /dev/null +++ b/system/docu/docu.php @@ -0,0 +1,25 @@ + 0, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>-1, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'call', \DBD\APITable::FIELD_ALLOWEDVALUES =>NULL), + array(\DBD\APITable::FIELD_ID => 45, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>1, \DBD\APITable::FIELD_PARENTVALUE =>'geopoint', \DBD\APITable::FIELD_NAME =>'datatype', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 120, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'login', \DBD\APITable::FIELD_NAME =>'compatibility', \DBD\APITable::FIELD_ALLOWEDVALUES =>'FLAG'), + array(\DBD\APITable::FIELD_ID => 5, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>0, \DBD\APITable::FIELD_PARENTVALUE =>'map', \DBD\APITable::FIELD_NAME =>'algo', \DBD\APITable::FIELD_ALLOWEDVALUES =>NULL), + array(\DBD\APITable::FIELD_ID => 6, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'key', \DBD\APITable::FIELD_ALLOWEDVALUES =>'FLAG'), + array(\DBD\APITable::FIELD_ID => 16, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>6, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'type', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORTYPE'), + array(\DBD\APITable::FIELD_ID => 7, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'markers', \DBD\APITable::FIELD_ALLOWEDVALUES =>'FLAG'), + array(\DBD\APITable::FIELD_ID => 8, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'animation', \DBD\APITable::FIELD_ALLOWEDVALUES =>'FLAG'), + array(\DBD\APITable::FIELD_ID => 17, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>7, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'x', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPCOORD'), + array(\DBD\APITable::FIELD_ID => 18, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>7, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'y', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPCOORD'), + array(\DBD\APITable::FIELD_ID => 19, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>7, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'zoom', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPZOOM'), + array(\DBD\APITable::FIELD_ID => 20, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>7, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'from', \DBD\APITable::FIELD_ALLOWEDVALUES =>'WIERDTIMESTAMP'), + array(\DBD\APITable::FIELD_ID => 21, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>7, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'to', \DBD\APITable::FIELD_ALLOWEDVALUES =>'WIERDTIMESTAMP'), + array(\DBD\APITable::FIELD_ID => 22, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>7, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'type', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORTYPE'), + array(\DBD\APITable::FIELD_ID => 23, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>7, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'provider', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORPROVIDER'), + array(\DBD\APITable::FIELD_ID => 9, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'x', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPCOORD'), + array(\DBD\APITable::FIELD_ID => 10, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'y', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPCOORD'), + array(\DBD\APITable::FIELD_ID => 11, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'zoom', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPZOOM'), + array(\DBD\APITable::FIELD_ID => 12, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'from', \DBD\APITable::FIELD_ALLOWEDVALUES =>'WIERDTIMESTAMP'), + array(\DBD\APITable::FIELD_ID => 13, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'to', \DBD\APITable::FIELD_ALLOWEDVALUES =>'WIERDTIMESTAMP'), + array(\DBD\APITable::FIELD_ID => 14, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'type', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORTYPE'), + array(\DBD\APITable::FIELD_ID => 15, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>5, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'provider', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORPROVIDER'), + array(\DBD\APITable::FIELD_ID => 132, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>130, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'password', \DBD\APITable::FIELD_ALLOWEDVALUES =>'PASSWORD'), + array(\DBD\APITable::FIELD_ID => 111, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>110, \DBD\APITable::FIELD_PARENTVALUE =>'data', \DBD\APITable::FIELD_NAME =>'source', \DBD\APITable::FIELD_ALLOWEDVALUES =>'INPUTSOURCE'), + array(\DBD\APITable::FIELD_ID => 110, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>0, \DBD\APITable::FIELD_PARENTVALUE =>'input', \DBD\APITable::FIELD_NAME =>'type', \DBD\APITable::FIELD_ALLOWEDVALUES =>NULL), + array(\DBD\APITable::FIELD_ID => 131, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>130, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'username', \DBD\APITable::FIELD_ALLOWEDVALUES =>'USERNAME'), + array(\DBD\APITable::FIELD_ID => 130, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'create', \DBD\APITable::FIELD_NAME =>'compatibility', \DBD\APITable::FIELD_ALLOWEDVALUES =>'FLAG'), + array(\DBD\APITable::FIELD_ID => 126, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>125, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'username', \DBD\APITable::FIELD_ALLOWEDVALUES =>'USERNAME'), + array(\DBD\APITable::FIELD_ID => 125, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'available', \DBD\APITable::FIELD_NAME =>'compatibility', \DBD\APITable::FIELD_ALLOWEDVALUES =>'FLAG'), + array(\DBD\APITable::FIELD_ID => 123, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>120, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'hashed', \DBD\APITable::FIELD_ALLOWEDVALUES =>'BOOL'), + array(\DBD\APITable::FIELD_ID => 122, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>120, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'password', \DBD\APITable::FIELD_ALLOWEDVALUES =>'PASSWORD'), + array(\DBD\APITable::FIELD_ID => 121, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>120, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'username', \DBD\APITable::FIELD_ALLOWEDVALUES =>'USERNAME'), + array(\DBD\APITable::FIELD_ID => 34, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>8, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'x', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPCOORD'), + array(\DBD\APITable::FIELD_ID => 35, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>8, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'y', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPCOORD'), + array(\DBD\APITable::FIELD_ID => 36, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>8, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'zoom', \DBD\APITable::FIELD_ALLOWEDVALUES =>'GOOGLEMAPZOOM'), + array(\DBD\APITable::FIELD_ID => 37, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>8, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'from', \DBD\APITable::FIELD_ALLOWEDVALUES =>'WIERDTIMESTAMP'), + array(\DBD\APITable::FIELD_ID => 38, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>8, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'to', \DBD\APITable::FIELD_ALLOWEDVALUES =>'WIERDTIMESTAMP'), + array(\DBD\APITable::FIELD_ID => 39, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>8, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'type', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORTYPE'), + array(\DBD\APITable::FIELD_ID => 40, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>8, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'provider', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORPROVIDER'), + array(\DBD\APITable::FIELD_ID => 43, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>1, \DBD\APITable::FIELD_PARENTVALUE =>'geopoint', \DBD\APITable::FIELD_NAME =>'radius', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 42, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>1, \DBD\APITable::FIELD_PARENTVALUE =>'geopoint', \DBD\APITable::FIELD_NAME =>'long', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 41, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>1, \DBD\APITable::FIELD_PARENTVALUE =>'geopoint', \DBD\APITable::FIELD_NAME =>'lat', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 60, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>0, \DBD\APITable::FIELD_PARENTVALUE =>'account', \DBD\APITable::FIELD_NAME =>'action', \DBD\APITable::FIELD_ALLOWEDVALUES =>NULL), + array(\DBD\APITable::FIELD_ID => 140, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>1, \DBD\APITable::FIELD_PARENTVALUE =>'sensor', \DBD\APITable::FIELD_NAME =>'sensorid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'INT'), + array(\DBD\APITable::FIELD_ID => 1, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>0, \DBD\APITable::FIELD_PARENTVALUE =>'page', \DBD\APITable::FIELD_NAME =>'page', \DBD\APITable::FIELD_ALLOWEDVALUES =>NULL), + array(\DBD\APITable::FIELD_ID => 47, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>46, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'lat', \DBD\APITable::FIELD_ALLOWEDVALUES =>'LATLONCOORD'), + array(\DBD\APITable::FIELD_ID => 48, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>46, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'long', \DBD\APITable::FIELD_ALLOWEDVALUES =>'LATLONCOORD'), + array(\DBD\APITable::FIELD_ID => 49, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>46, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'radius', \DBD\APITable::FIELD_ALLOWEDVALUES =>'UINT'), + array(\DBD\APITable::FIELD_ID => 61, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'login', \DBD\APITable::FIELD_NAME =>'username', \DBD\APITable::FIELD_ALLOWEDVALUES =>'USERNAME'), + array(\DBD\APITable::FIELD_ID => 51, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>46, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'datatype', \DBD\APITable::FIELD_ALLOWEDVALUES =>'SENSORTYPE'), + array(\DBD\APITable::FIELD_ID => 62, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'login', \DBD\APITable::FIELD_NAME =>'password', \DBD\APITable::FIELD_ALLOWEDVALUES =>'PASSWORD'), + array(\DBD\APITable::FIELD_ID => 63, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'login', \DBD\APITable::FIELD_NAME =>'hashed', \DBD\APITable::FIELD_ALLOWEDVALUES =>'BOOL'), + array(\DBD\APITable::FIELD_ID => 64, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'check', \DBD\APITable::FIELD_NAME =>'rightid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'UINT'), + array(\DBD\APITable::FIELD_ID => 65, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'create', \DBD\APITable::FIELD_NAME =>'username', \DBD\APITable::FIELD_ALLOWEDVALUES =>'USERNAME'), + array(\DBD\APITable::FIELD_ID => 66, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'create', \DBD\APITable::FIELD_NAME =>'password', \DBD\APITable::FIELD_ALLOWEDVALUES =>'PASSWORD'), + array(\DBD\APITable::FIELD_ID => 67, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'create', \DBD\APITable::FIELD_NAME =>'email', \DBD\APITable::FIELD_ALLOWEDVALUES =>'EMAIL'), + array(\DBD\APITable::FIELD_ID => 68, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>60, \DBD\APITable::FIELD_PARENTVALUE =>'create', \DBD\APITable::FIELD_NAME =>'hashed', \DBD\APITable::FIELD_ALLOWEDVALUES =>'BOOL'), + array(\DBD\APITable::FIELD_ID => 70, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>0, \DBD\APITable::FIELD_PARENTVALUE =>'analysis', \DBD\APITable::FIELD_NAME =>'action', \DBD\APITable::FIELD_ALLOWEDVALUES =>NULL), + array(\DBD\APITable::FIELD_ID => 71, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>70, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'mthd', \DBD\APITable::FIELD_ALLOWEDVALUES =>NULL), + array(\DBD\APITable::FIELD_ID => 72, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'within', \DBD\APITable::FIELD_NAME =>'lat', \DBD\APITable::FIELD_ALLOWEDVALUES =>'LATLONCOORD'), + array(\DBD\APITable::FIELD_ID => 73, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'within', \DBD\APITable::FIELD_NAME =>'lng', \DBD\APITable::FIELD_ALLOWEDVALUES =>'LATLONCOORD'), + array(\DBD\APITable::FIELD_ID => 74, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'within', \DBD\APITable::FIELD_NAME =>'when', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 75, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'gettotal', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 76, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'gettotal', \DBD\APITable::FIELD_NAME =>'intval', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 77, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'getseries', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 78, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'projection24', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 79, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'projection24', \DBD\APITable::FIELD_NAME =>'intval', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 80, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'get', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 81, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'get', \DBD\APITable::FIELD_NAME =>'acronym', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 82, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'gethist', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 83, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'gethist', \DBD\APITable::FIELD_NAME =>'sort', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 84, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'is', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 85, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'is', \DBD\APITable::FIELD_NAME =>'acronym', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 86, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'getbyuser', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 87, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'getallcond', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 88, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'getallcond', \DBD\APITable::FIELD_NAME =>'acronym', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 89, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'getalldefs', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 90, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'getalldefs', \DBD\APITable::FIELD_NAME =>'acronym', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 91, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'all', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 92, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'all', \DBD\APITable::FIELD_NAME =>'last', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 93, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'own', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 94, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'own', \DBD\APITable::FIELD_NAME =>'last', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 95, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'register', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 96, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'register', \DBD\APITable::FIELD_NAME =>'regid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 97, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'register', \DBD\APITable::FIELD_NAME =>'deviceid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 98, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'fetch', \DBD\APITable::FIELD_NAME =>'useruid', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 99, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'fetch', \DBD\APITable::FIELD_NAME =>'last', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 100, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'explore', \DBD\APITable::FIELD_NAME =>'lat', \DBD\APITable::FIELD_ALLOWEDVALUES =>'LATLONCOORD'), + array(\DBD\APITable::FIELD_ID => 101, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'explore', \DBD\APITable::FIELD_NAME =>'lng', \DBD\APITable::FIELD_ALLOWEDVALUES =>'LATLONCOORD'), + array(\DBD\APITable::FIELD_ID => 102, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'explore', \DBD\APITable::FIELD_NAME =>'radius', \DBD\APITable::FIELD_ALLOWEDVALUES =>'UINT'), + array(\DBD\APITable::FIELD_ID => 103, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'explore', \DBD\APITable::FIELD_NAME =>'endtime', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 104, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>71, \DBD\APITable::FIELD_PARENTVALUE =>'citybyzip', \DBD\APITable::FIELD_NAME =>'zip', \DBD\APITable::FIELD_ALLOWEDVALUES =>'ALL'), + array(\DBD\APITable::FIELD_ID => 112, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>110, \DBD\APITable::FIELD_PARENTVALUE =>'data', \DBD\APITable::FIELD_NAME =>'json', \DBD\APITable::FIELD_ALLOWEDVALUES =>'JSON'), + array(\DBD\APITable::FIELD_ID => 113, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>110, \DBD\APITable::FIELD_PARENTVALUE =>'deviceinfo', \DBD\APITable::FIELD_NAME =>'json', \DBD\APITable::FIELD_ALLOWEDVALUES =>'JSON'), + array(\DBD\APITable::FIELD_ID => 133, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>130, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'email', \DBD\APITable::FIELD_ALLOWEDVALUES =>'EMAIL'), + array(\DBD\APITable::FIELD_ID => 134, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>130, \DBD\APITable::FIELD_PARENTVALUE =>NULL, \DBD\APITable::FIELD_NAME =>'hashed', \DBD\APITable::FIELD_ALLOWEDVALUES =>'BOOL'), + array(\DBD\APITable::FIELD_ID => 135, \DBD\APITable::FIELD_FLAG =>1, \DBD\APITable::FIELD_PARENTID =>0, \DBD\APITable::FIELD_PARENTVALUE =>'log', \DBD\APITable::FIELD_NAME =>'json', \DBD\APITable::FIELD_ALLOWEDVALUES =>'JSON'), + array(\DBD\APITable::FIELD_ID => 46, \DBD\APITable::FIELD_FLAG =>0, \DBD\APITable::FIELD_PARENTID =>1, \DBD\APITable::FIELD_PARENTVALUE =>'geopoint', \DBD\APITable::FIELD_NAME =>'explore', \DBD\APITable::FIELD_ALLOWEDVALUES =>'FLAG'));*/ + +$api = new SYSTEM\API\Api($call, new ApiVerify(), new ApiClass()); + +$json = json_decode(file_get_contents("php://input"), true); + +$starttime = microtime(true); +try { + if($json){ + echo $api->CALL($json); + } else { + echo $api->CALL(array_merge($_POST,$_GET));} +} catch(Exception $e){ + echo JsonResult::error($starttime, $e); +} \ No newline at end of file diff --git a/system/docu/index/index.php b/system/docu/index/index.php new file mode 100644 index 0000000..1589646 --- /dev/null +++ b/system/docu/index/index.php @@ -0,0 +1,36 @@ +6, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>5, \DBD\PAGETable::FIELD_PARENTVALUE=>'sensor', \DBD\PAGETable::FIELD_NAME=>'sensorIDs', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>5, \DBD\PAGETable::FIELD_FLAG=>0, \DBD\PAGETable::FIELD_PARENTID=>-1, \DBD\PAGETable::FIELD_PARENTVALUE=>NULL, \DBD\PAGETable::FIELD_NAME=>'action', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>0, \DBD\PAGETable::FIELD_FLAG=>0, \DBD\PAGETable::FIELD_PARENTID=>-1, \DBD\PAGETable::FIELD_PARENTVALUE=>NULL, \DBD\PAGETable::FIELD_NAME=>'module', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>1, \DBD\PAGETable::FIELD_FLAG=>0, \DBD\PAGETable::FIELD_PARENTID=>0, \DBD\PAGETable::FIELD_PARENTVALUE=>NULL, \DBD\PAGETable::FIELD_NAME=>'action', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>2, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>1, \DBD\PAGETable::FIELD_PARENTVALUE=>'sensor', \DBD\PAGETable::FIELD_NAME=>'sensorIDs', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>3, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>1, \DBD\PAGETable::FIELD_PARENTVALUE=>'login', \DBD\PAGETable::FIELD_NAME=>'old_module', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>4, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>1, \DBD\PAGETable::FIELD_PARENTVALUE=>'login', \DBD\PAGETable::FIELD_NAME=>'old_action', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>7, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>1, \DBD\PAGETable::FIELD_PARENTVALUE=>'geopoint', \DBD\PAGETable::FIELD_NAME=>'coord', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>8, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>1, \DBD\PAGETable::FIELD_PARENTVALUE=>'geopoint', \DBD\PAGETable::FIELD_NAME=>'datatype', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>9, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>1, \DBD\PAGETable::FIELD_PARENTVALUE=>'geopoint', \DBD\PAGETable::FIELD_NAME=>'radius', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>10, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>5, \DBD\PAGETable::FIELD_PARENTVALUE=>'geopoint', \DBD\PAGETable::FIELD_NAME=>'coord', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>11, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>5, \DBD\PAGETable::FIELD_PARENTVALUE=>'geopoint', \DBD\PAGETable::FIELD_NAME=>'datatype', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'), + array(\DBD\PAGETable::FIELD_ID=>12, \DBD\PAGETable::FIELD_FLAG=>1, \DBD\PAGETable::FIELD_PARENTID=>5, \DBD\PAGETable::FIELD_PARENTVALUE=>'geopoint', \DBD\PAGETable::FIELD_NAME=>'radius', \DBD\PAGETable::FIELD_ALLOWEDVALUES=>'ALL'));*/ + +$page = new \SYSTEM\PAGE\PageApi( $call, new SYSTEM\verifyclass(), new PageApi()); + +try{ + echo $page->CALL(array_merge($_POST,$_GET))->html(); +} catch(Exception $e) { + echo $e; + $page = new default_page(); + echo $page->html(); +} + +?> \ No newline at end of file diff --git a/system/docu/register_sys_docu.php b/system/docu/register_sys_docu.php new file mode 100644 index 0000000..500cb8d --- /dev/null +++ b/system/docu/register_sys_docu.php @@ -0,0 +1,2 @@ + + +SYSTEM provides several management techiques and general purpose funcionality +for a PHP Environment. All features of system are optional for using, altho +might be dependent on other features or standarts SYSTEM provides. + +Following funcionality is provided by SYSTEM: + + * api - php post/get input validation and handling + * cache - cache using the database as storage for images/other data + * config - configuration of a SYSTEM environment, can be extended for project purposes + * db - database connection, query and prepare functionality, supporting MYSQL and POSTGRESQL, QQ + * docu - register documentation right were it is - show it in the backend + * files - file management & external access api + * log - exceptionhandling - including dbwrite options + * page - html page generation scheme + * sai - Admininterface + * security - Userlogin, register, rights, (email), session management + * system - autoload, database texts, path generation, systemconfig, time \ No newline at end of file diff --git a/system/docu/system/2.license.md b/system/docu/system/2.license.md new file mode 100644 index 0000000..a67cf9a --- /dev/null +++ b/system/docu/system/2.license.md @@ -0,0 +1,21 @@ +License +======= +Copyright (c) 2014 Ulf Gebhardt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/system/docu/system/3.getting started.md b/system/docu/system/3.getting started.md new file mode 100644 index 0000000..15f31f9 --- /dev/null +++ b/system/docu/system/3.getting started.md @@ -0,0 +1,88 @@ +##Getting started + +This is an introduction how to setup a webpage with system + +##Setup + +Create a new git repository, initialize a submodule for system, check it out, +create a folder named like your project, it will contain all project files, +create a api.php, index.php, sai.php and config.php file. +Dependent on what part of SYSTEM you want to use leave out api or index. + +* D: system +* D: project +* F: api.php +* F: index.php +* F: sai.php +* F: config.php + +File api.php - console of your webpage (jquery...): + + html(); + +File sai.php - Admin Interface: + + html(); + +File config.php - Your Server and Project config + + mojotrollz, © WebCraft Media 2013'), + array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS, array('deDE', 'enUS')), + array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG, 'enUS')); + diff --git a/system/docu/system/system.api.md b/system/docu/system/system.api.md new file mode 100644 index 0000000..b1a46aa --- /dev/null +++ b/system/docu/system/system.api.md @@ -0,0 +1,69 @@ +SYSTEM API +---------- + +The SYSTEM-Api allows you to validate post/get/jsonpost parameters to function-calls. +This allows you to direct calls to your website to a class which can process those +calls in a typesave maner. + +WARNING: This Method breaks inheritance in some use-cases! + +How it Works +------------ + +Mapping of URLs to Functions -> thats it basicly + +The URL + + http://mypage.net/api.php?call=test&action=bla¶m1=1¶m2=abc + +maps to + + public static function call_test_action_bla($param1,$param2){} + +if you set your database properly: + + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 0, 0, -1, NULL, 'call', NULL); + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 0, 0, 1, 'test', 'action', NULL); + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 0, 2, 2, 'bla', 'param1', 'UINT'); + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (4, 0, 2, 2, 'bla', 'param2', 'STRING'); + +(note that the params are on the same level of the tree) +now you just need a php class with your function + + look there + echo \SYSTEM\API\api::run('my_verify', 'api_dasense',$json, 25); + +note the use of api group 25 - this allows you to construct several apis. \ No newline at end of file diff --git a/system/docu/system/system.cache.md b/system/docu/system/system.cache.md new file mode 100644 index 0000000..463d5d1 --- /dev/null +++ b/system/docu/system/system.cache.md @@ -0,0 +1,2 @@ +cache +----- \ No newline at end of file diff --git a/system/docu/system/system.config.md b/system/docu/system/system.config.md new file mode 100644 index 0000000..7fd5b2d --- /dev/null +++ b/system/docu/system/system.config.md @@ -0,0 +1,2 @@ +config +------ \ No newline at end of file diff --git a/system/docu/system/system.db.md b/system/docu/system/system.db.md new file mode 100644 index 0000000..3f9a814 --- /dev/null +++ b/system/docu/system/system.db.md @@ -0,0 +1,2 @@ +db +-- \ No newline at end of file diff --git a/system/docu/system/system.db.qq.md b/system/docu/system/system.db.qq.md new file mode 100644 index 0000000..d98b5a4 --- /dev/null +++ b/system/docu/system/system.db.qq.md @@ -0,0 +1,76 @@ +QQ Objects +---------- + +Referenz: + +QQ-Objekte können von zwei verschiedenen Klassen erben: + + - QQ (quick query) + - QP (quick prepare) + +Class Definitions: + + class MY_QUERY_QQ extends \SYSTEM\DB\QQ {} + class MY_QUERY_QP extends \SYSTEM\DB\QP {} + + +Je nachdem was du benutzt kannst du in deinem SQL String $1,$2,$3... +benutzen oder nicht (prepare hat $1..., query hat das nicht). +Folglich mache alle Querys ohne Paramter als QQ, alle mit als QP Klasse! + +Der Unterschied der Klassen ist einfach, dass bei allen Funktionen von QP +ein array mit den Parametern übergeben werden muss. + +Es gibt 4 Funktionen + + - QQ (selber über die daten loopen) + - Q1 (geb mir genau eine zeile) + - QA (geb mir alle Zeilen) + - QI (Insert/Delete... -> returns true) + +Q1 +-- + + MY_QUERY_QQ::Q1() + -> array(feld1 => value, feld2 => value...) + + MY_QUERY_QP::Q1(array(param1,param2,...)) + -> array(feld1 => value, feld2 => value...) + +QA +-- + + MY_QUERY_QQ::QA() + -> array(array(feld1 => value, feld2 => value...), array(feld1 => ...)) + MY_QUERY_QP::QA(array(param1,param2,...)) + -> array(array(feld1 => value, feld2 => value...), array(feld1 => ...)) + +QI +-- + + MY_QUERY_QQ::QI() + -> true/false + MY_QUERY_QP::QI(array(param1,param2,...)) + -> true/false + +QQ +-- + + $result = array(); + $rows = MY_QUERY_QQ::QQ(); + while($row = $rows->next()){ //1. über alle loopen + $row[field1] = 5; + $result[] = $row; + } + + -> QQ Benutzen, um das Datenbank Ergebnis auszuschmücken ohne zweimal über + das ergebniss zu loopen: + +Wrong +----- + $result = array(); + $rows = MY_QUERY_QQ::QA(); // 1. über alle loppen + foreach($rows as $row){ // 2. über alle loopen + $row[field1] = 5; + $result[] = $row; + } \ No newline at end of file diff --git a/system/docu/system/system.docu.md b/system/docu/system/system.docu.md new file mode 100644 index 0000000..e69de29 diff --git a/system/docu/system/system.log.md b/system/docu/system/system.log.md new file mode 100644 index 0000000..e69de29 diff --git a/system/docu/system/system.page.md b/system/docu/system/system.page.md new file mode 100644 index 0000000..e69de29 diff --git a/system/docu/system/system.sai.md b/system/docu/system/system.sai.md new file mode 100644 index 0000000..e69de29 diff --git a/system/docu/system/system.security.md b/system/docu/system/system.security.md new file mode 100644 index 0000000..e69de29 diff --git a/system/docu/system/system.system.md b/system/docu/system/system.system.md new file mode 100644 index 0000000..8210b3a --- /dev/null +++ b/system/docu/system/system.system.md @@ -0,0 +1,188 @@ +####autoload + + Komuniktationsprobleme der Neuzeit ;-) + + * E: Entwickler + * A: Admin + + * ##### Lösung + + * ##### * Lösung Ignorieren + +----- + + * E: 23:36:01: Hi A + * E: 23:36:13: ich habe noch mal eine Frage an dich wegen Project21 + * E: 23:36:32: ich habe es ja soweit hinbekommen die Visualisierung auf unser Handy zu bekommen + * E: 23:36:58: ich dachte mir nun, das ich jetzt am Besten einen bestehenden Algorithmus kopiere - in umbenenne und dann daran unsere Modifikationen vornehme + * E: 23:37:20: aber leider scheint das mit dem kopieren und hinzufügen in der api.php nicht getan zu sein + * E: 23:37:33: muss ich dabei sonst noch etwas beachten ? + * E: 23:37:52: weil derzeit bekomme ich in der autoload.php unter system/system + + - A: 23:37:54: in der tabelle system.api müssen zeilen hinzugefügt werden + + * E: 23:38:01: den fehler class not found + + - A: 23:38:09: dann fehlt wohl ne klasse^^ + + * E: 23:38:48: mmh ich will keine neuen parameter einfügen wenn du das meinst + * E: 23:38:54: leidiglich z.b. statt heatmapRect + * E: 23:39:02: heatMapRectCoverage callen z.B. + + - ##### A: 23:39:17: die klasse muss so heißen wie die datei + - A: 23:39:23: und geautoloaded werden + + * E: 23:40:22: mmh ich habe jetzt im ordner preprocessing in die autload.inc.php eine zeile hinzugefügt gehabt + * E: 23:40:28: das scheint dann aber wohl nicht die richtige zu sein + * E: 23:40:35: für die visualisierungs algorithmen + * ##### * E: 23:40:42: weil Datei und Ordner heißen schon gleich + + * ##### * E: 23:40:45: das habe ich berücksichtigt + + - A: 23:41:01: dann ist der ordner in der die klasse liegt wohl nicht registriert + + * E: 23:42:28: mmh das stimmt + * E: 23:42:39: aber in welcher autload.inc.php mache ich das bekannt ? + + - A: 23:42:48: in der nächsten^^ + - A: 23:42:55: die die am nächsten dran liegt + - A: 23:42:59: aber prinzipiell egal + + * ##### * E: 23:43:20: mmh dann hätte ich das aber richtig gemacht + + - A: 23:43:39: kp er sagt dir ja class not found + - A: 23:43:47: sprich er kann die klasse nicht laden + + * E: 23:43:52: korrekt + * E: 23:43:59: den ordner scheint er aber zu finden + + - A: 23:44:26: sonst schmiert der autoload mit nem fehler ab, ja + - A: 23:44:47: kp -> vll ist es einfach nicht hochgeladen, großkleinschreibeung... + + * E: 23:45:05: mmh + * E: 23:45:07: ich schau mal + * E: 23:45:10: vielleicht mal alles klein schreiben + * E: 23:47:02: mmh nein + * E: 23:47:06: auch das hat nichts gebracht + + - A: 23:52:23: kp + - A: 23:52:29: sonst fällt mir nix ein + + * E: 23:52:50: aber in der Datenbank muss dafür nichts geändert werden oder ? + + - A: 23:52:58: nö + + * E: 23:52:58: die Parameter die ich übergebe sollen ja die selben bleiben + * E: 23:53:01: kk + + - A: 23:53:06: hats n namespace? + + * E: 23:53:09: das ist schon mal gut zu wissen + + - A: 23:53:13: den musst du beim autloaden angeben + + * E: 23:53:20: mmh wie meinst du das ? + + - A: 23:53:27: namespace SYSTEM/LOG + - A: 23:53:41: dann musste beim autoload SYSTEM/LOG mit angeben + + * E: 23:54:20: in der algorithmen klasse selbst nicht nein + + - A: 23:54:31: dann müsste es passen + + * E: 23:54:59: mmh seltsam seltsam + * E: 23:55:06: ich stelle ich wahrscheinlich nur zu blöd an ^^ + + - A: 23:55:16: xD ich hab keinen plan was du da schaffst + - ##### A: 23:55:27: aber prüfe nochmal genau groß und kleinschreibung + + * E: 23:55:30: eigentlich sollte es doch nicht so kompliziert sein + + - ##### A: 23:55:31: KlassenName.php + + * E: 23:55:40: den ordner kopiern umbenennen + * E: 23:55:41: ne is eientlich ziemlich simpel + + - A: 23:56:00: der pfad im autoload haste angepasst?!^^ + + * E: 23:56:23: ja da hab ich noch einen hinzugefügt + + - A: 23:56:36: ajo + - A: 23:56:46: wenn er den ordner net findet schreit er auch + + * E: 23:56:54: genau + * E: 23:56:59: das hab ich ja auch ausprobiert + * E: 23:57:02: durch umbennenn vom ordner + * E: 23:57:07: den findet er also scheints + + - A: 23:57:12: vll ist es beim aufruf falsch geschrieben? + + * E: 23:59:06: /home/mona-srv/da-sense/test2/system/system/autoload.php + * E: 23:59:11: in der datei schmiert das system dann ab + * E: 23:59:30: aber das hilft mir auch nicht so richtig weiter + + - A: 23:59:32: joa mit der message class not found? + + * E: 23:59:37: exakt + + - A: 23:59:41: geb dir mal den klassennamen aus + - A: 23:59:50: und schau obs der gleiche ist + + * E: 00:00:41: public static function autoload($class){ + $classns = self::getClassNamespaceFromClass($class); + + if(!self::autoload_($classns[0],$classns[1]) || (!class_exists($class) && !interface_exists($class))){ + throw new \SYSTEM\LOG\ERROR("Class not found: ".$class);} + + return true; + } + * E: 00:00:48: mmh was davon ist der klassenname ? :D + * E: 00:00:55: classns[0] ? + + - A: 00:00:57: throw new \SYSTEM\LOG\ERROR("Class not found: ".$class);} + - A: 00:01:05: sollte dir den klassennamen schon sagen + + * E: 00:01:17: Class not found: s_algo + + - A: 00:01:22: ajo + + * E: 00:01:23: habs mal auf 1 buchstaben reduziert + + - ##### A: 00:01:26: da haste dein problem + + * E: 00:01:31: um schreibfehler auszuschließen + * E: 00:01:33: mmh ? + + - ##### A: 00:01:38: s_algo + + - ##### A: 00:01:45: so soll die klasse heißen + + - ##### A: 00:01:56: s_algo.php + + * ##### * E: 00:01:58: ja so heißt sie + * E: 00:02:03: und der ornder heißt auch s_algo + + - ##### A: 00:02:11: und die klasse heißt auch s_algo? + + * E: 00:02:41: oh man - ja ich bin echt zu blöd :( + + - A: 00:03:00: das war das erste, zweite und dritte was ich dich gefragt hab + + * E: 00:03:05: zu viele namen :/ + + - ##### A: 00:03:07: ob die klasse wie die datei heißt + + * E: 00:03:12: tut mir leid + + - A: 00:03:15: np + + * E: 00:03:30: ich habe dateinamen als ordnernamen fehl interpretiert + + - A: 00:03:46: kk^^ + + * E: 00:03:50: jetzt gehts - besten Dank. + * E: 00:04:04: bin mit blödheit geschlagen echt + * E: 00:04:53: danke - dann kann ich nämlich jetzt so nach herzenslust modifizieren + * E: 00:04:57: ohne das es was macht + + - A: 00:06:47: super, wenns läuft ;-) \ No newline at end of file diff --git a/system/files/autoload.inc.php b/system/files/autoload.inc.php new file mode 100644 index 0000000..038ae6d --- /dev/null +++ b/system/files/autoload.inc.php @@ -0,0 +1,3 @@ + path) + + public static function registerFolder($path, $cat) { + self::$folders[$cat] = $path;} + + public static function get($cat = null, $id = null, $returnasjson = false) { + if (!$cat) { + return $returnasjson ? \SYSTEM\LOG\JsonResult::toString(self::$folders) : self::$folders;} + + if (!array_key_exists($cat, self::$folders)) { + throw new \SYSTEM\LOG\ERROR("No matching Cat '" . $cat . "' found.");} + + $folder = self::getFolder(self::$folders[$cat]); + if ($id == null) { + return $returnasjson ? \SYSTEM\LOG\JsonResult::toString($folder) : $folder;} + + if (!in_array($id, $folder)) { + throw new \SYSTEM\LOG\ERROR("No matching ID '" . $id . "' found.");} + + $ext = pathinfo(self::$folders[$cat].$id); + $ext = strtoupper(array_key_exists('extension', $ext) ? $ext['extension'] : ''); + if(\SYSTEM\HEADER::available($ext)){ + call_user_func('\SYSTEM\HEADER::'.$ext); + }else{ + \SYSTEM\HEADER::FILE($id);} + + if(!self::file_get_contents_chunked(self::$folders[$cat].$id,4096,function($chunk,&$handle,$iteration){echo $chunk;})){ + throw new \SYSTEM\LOG\ERROR("Could not transfere File.");} + return; + } + + public static function put($cat, $id, $contents) { + if (!array_key_exists($cat, self::$folders)) { + throw new \SYSTEM\LOG\ERROR("No matching Cat '" . $cat . "' found.");} + return move_uploaded_file($contents, self::$folders[$cat].$id); + } + + public static function delete($cat, $id) { + if (!array_key_exists($cat, self::$folders)) { + throw new \SYSTEM\LOG\ERROR("No matching Cat '" . $cat . "' found.");} + if(!file_exists(self::$folders[$cat].$id)){ + return false;} + return unlink(self::$folders[$cat].$id); + } + + public static function rename($cat, $id, $newid) { + if (!array_key_exists($cat, self::$folders)) { + throw new \SYSTEM\LOG\ERROR("No matching Cat '" . $cat . "' found.");} + if(!file_exists(self::$folders[$cat].$id)){ + return false;} + $ext = pathinfo(self::$folders[$cat].$id); + return rename(self::$folders[$cat].$id, self::$folders[$cat].$newid.'.'.$ext['extension']); + } + + private static function getFolder($folder) { + $files = array(); + foreach (glob($folder.'*') as $file) { + $files[] = basename($file);} + return $files; + } + + public static function getURL($cat, $id = null) { + return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL) . 'api.php?call=files&cat=' . $cat . '&id=' . $id;} + + private static function file_get_contents_chunked($file,$chunk_size,$callback) + { + $handle = fopen($file, "r"); + $i = 0; + while (!feof($handle)) + { + call_user_func_array($callback,array(fread($handle,$chunk_size),&$handle,$i)); + $i++; + } + fclose($handle); + return true; + } +} \ No newline at end of file diff --git a/system/files/sys/system.js b/system/files/sys/system.js new file mode 100644 index 0000000..ee22a69 --- /dev/null +++ b/system/files/sys/system.js @@ -0,0 +1,134 @@ +var system = null; + +//mother object +function SYSTEM(endpoint, group,start_state){ + system = this; + + this.LOG_START = 0; + this.LOG_INFO = 1; + this.LOG_ERROR = 2; + + this.endpoint = endpoint; + this.group = group; + this.pages = null; + this.start_state = start_state; + this.go_state(start_state); + + $(window).bind( 'hashchange', function( event ) { + system.go_state();}); +} +//internal function to handle pagestate results +SYSTEM.prototype.handle_call_pages = function (data,id) { + if(data['status']){ + system.log(system.LOG_INFO,'load pages: endpoint '+system.endpoint+':group '+system.group+':state '+id+' - success'); + if(id !== system.cur_state()){ + window.history.pushState(null, "", '#!'+id);} + data['result'].forEach(function(entry) { + //load pages + $.ajax({ + async: false, + data: {}, + dataType: 'html', + url: entry['url']+'&'+window.location.search.substr(1), + success: function(data){ + $(entry['div']).html(data); + system.log(system.LOG_INFO,'load page: '+id+entry['div']+' '+entry['url']+'&'+window.location.search.substr(1)+' - success');}, + error: function(XMLHttpRequest, textStatus, errorThrown){system.log(system.LOG_ERROR,errorThrown);} + }); + //load css + for(var i=0; i < entry['css'].length; i++){ + system.load_css(entry['css'][i]);} + //load js + var call_func = true; + var loaded = 0; + for(var i=0; i < entry['js'].length; i++){ + system.log(system.LOG_INFO,'load js: '+entry['js'][i]); + $.getScript(entry['js'][i]).done(function(response, status) { + system.log(system.LOG_INFO,'load js: '+status); + if(loaded++ == entry['js'].length-1){ + var fn = window[entry['func']]; + if(call_func && typeof fn === 'function'){ + call_func = false; + fn(); + system.log(system.LOG_INFO,'call func: '+entry['func']); + } else { + system.log(system.LOG_ERROR,'call func: '+entry['func']+' - fail'); + }} + }); + } + }); + } else { + console.log(data); + system.log(system.LOG_INFO,'Problem with your Pages: '+data['result']['message']); + } +}; +//send a call to the endpoint +SYSTEM.prototype.call = function(call,success,data,data_type,async){ + $.ajax({ + async: async, + data: data, + dataType: data_type, + url: this.endpoint+'?'+call, + success: success, + error: function(XMLHttpRequest, textStatus, errorThrown){system.log(system.LOG_ERROR,call+' '+XMLHttpRequest+' '+textStatus+' '+errorThrown);} + }); +}; +SYSTEM.prototype.log = function(type,msg){ + var res = ''; + switch(type){ + case system.LOG_START: + res = '#SYSTEM: '; + break; + case system.LOG_INFO: + res = '-SYSTEM: '; + break; + case system.LOG_ERROR: + res = '!SYSTEM-ERROR: '; + break; + } + console.log(res+msg); +}; +//get the pages and save em +SYSTEM.prototype.load_page = function(){ + result = false; + newps = this.pages; + if(!this.pages){ + this.call('call=pages&group='+this.group,this.handle_call_pages,{},"json",false); + } else { result = true;} + this.pages = newps; + return result; +}; +//load a pagestatewith given id +SYSTEM.prototype.load = function(id){ + system.log(system.LOG_START,'load page '+id); + this.call('call=pages&group='+this.group+'&state='+id,function(data){system.handle_call_pages(data,id);},{},"json",false);}; + +SYSTEM.prototype.load_css = function loadCSS(csssrc) { + var snode = document.createElement('link'); + snode.setAttribute('type','text/css'); + snode.setAttribute('rel', 'stylesheet'); + snode.setAttribute('href',csssrc); + document.getElementsByTagName('head')[0].appendChild(snode); + system.log(system.LOG_INFO,'load css '+csssrc); +}; + +//what? +SYSTEM.prototype.cur_state = function() { + var pathName = window.location.href; + if (pathName.indexOf('#!') != -1) { + return pathName.split('#!').pop();} + return ''; +}; + +SYSTEM.prototype.go_state = function(default_state){ + var pageName = this.cur_state(); + this.load(pageName ? pageName : default_state); +}; + +SYSTEM.prototype.back = function(){ + window.history.back(); +}; + +SYSTEM.prototype.forwad = function(){ + window.history.forward(); +}; \ No newline at end of file diff --git a/system/lib/EpicEditor/js/epiceditor.js b/system/lib/EpicEditor/js/epiceditor.js new file mode 100644 index 0000000..befaf54 --- /dev/null +++ b/system/lib/EpicEditor/js/epiceditor.js @@ -0,0 +1,2899 @@ +/** + * EpicEditor - An Embeddable JavaScript Markdown Editor (https://github.com/OscarGodson/EpicEditor) + * Copyright (c) 2011-2012, Oscar Godson. (MIT Licensed) + */ + +(function (window, undefined) { + /** + * Applies attributes to a DOM object + * @param {object} context The DOM obj you want to apply the attributes to + * @param {object} attrs A key/value pair of attributes you want to apply + * @returns {undefined} + */ + function _applyAttrs(context, attrs) { + for (var attr in attrs) { + if (attrs.hasOwnProperty(attr)) { + context[attr] = attrs[attr]; + } + } + } + + /** + * Applies styles to a DOM object + * @param {object} context The DOM obj you want to apply the attributes to + * @param {object} attrs A key/value pair of attributes you want to apply + * @returns {undefined} + */ + function _applyStyles(context, attrs) { + for (var attr in attrs) { + if (attrs.hasOwnProperty(attr)) { + context.style[attr] = attrs[attr]; + } + } + } + + /** + * Returns a DOM objects computed style + * @param {object} el The element you want to get the style from + * @param {string} styleProp The property you want to get from the element + * @returns {string} Returns a string of the value. If property is not set it will return a blank string + */ + function _getStyle(el, styleProp) { + var x = el + , y = null; + if (window.getComputedStyle) { + y = document.defaultView.getComputedStyle(x, null).getPropertyValue(styleProp); + } + else if (x.currentStyle) { + y = x.currentStyle[styleProp]; + } + return y; + } + + /** + * Saves the current style state for the styles requested, then applies styles + * to overwrite the existing one. The old styles are returned as an object so + * you can pass it back in when you want to revert back to the old style + * @param {object} el The element to get the styles of + * @param {string} type Can be "save" or "apply". apply will just apply styles you give it. Save will write styles + * @param {object} styles Key/value style/property pairs + * @returns {object} + */ + function _saveStyleState(el, type, styles) { + var returnState = {} + , style; + if (type === 'save') { + for (style in styles) { + if (styles.hasOwnProperty(style)) { + returnState[style] = _getStyle(el, style); + } + } + // After it's all done saving all the previous states, change the styles + _applyStyles(el, styles); + } + else if (type === 'apply') { + _applyStyles(el, styles); + } + return returnState; + } + + /** + * Gets an elements total width including it's borders and padding + * @param {object} el The element to get the total width of + * @returns {int} + */ + function _outerWidth(el) { + var b = parseInt(_getStyle(el, 'border-left-width'), 10) + parseInt(_getStyle(el, 'border-right-width'), 10) + , p = parseInt(_getStyle(el, 'padding-left'), 10) + parseInt(_getStyle(el, 'padding-right'), 10) + , w = el.offsetWidth + , t; + // For IE in case no border is set and it defaults to "medium" + if (isNaN(b)) { b = 0; } + t = b + p + w; + return t; + } + + /** + * Gets an elements total height including it's borders and padding + * @param {object} el The element to get the total width of + * @returns {int} + */ + function _outerHeight(el) { + var b = parseInt(_getStyle(el, 'border-top-width'), 10) + parseInt(_getStyle(el, 'border-bottom-width'), 10) + , p = parseInt(_getStyle(el, 'padding-top'), 10) + parseInt(_getStyle(el, 'padding-bottom'), 10) + , w = parseInt(_getStyle(el, 'height'), 10) + , t; + // For IE in case no border is set and it defaults to "medium" + if (isNaN(b)) { b = 0; } + t = b + p + w; + return t; + } + + /** + * Inserts a tag specifically for CSS + * @param {string} path The path to the CSS file + * @param {object} context In what context you want to apply this to (document, iframe, etc) + * @param {string} id An id for you to reference later for changing properties of the + * @returns {undefined} + */ + function _insertCSSLink(path, context, id) { + id = id || ''; + var headID = context.getElementsByTagName("head")[0] + , cssNode = context.createElement('link'); + + _applyAttrs(cssNode, { + type: 'text/css' + , id: id + , rel: 'stylesheet' + , href: path + , name: path + , media: 'screen' + }); + + headID.appendChild(cssNode); + } + + // Simply replaces a class (o), to a new class (n) on an element provided (e) + function _replaceClass(e, o, n) { + e.className = e.className.replace(o, n); + } + + // Feature detects an iframe to get the inner document for writing to + function _getIframeInnards(el) { + return el.contentDocument || el.contentWindow.document; + } + + // Grabs the text from an element and preserves whitespace + function _getText(el) { + var theText; + // Make sure to check for type of string because if the body of the page + // doesn't have any text it'll be "" which is falsey and will go into + // the else which is meant for Firefox and shit will break + if (typeof document.body.innerText == 'string') { + theText = el.innerText; + } + else { + // First replace
s before replacing the rest of the HTML + theText = el.innerHTML.replace(/
/gi, "\n"); + // Now we can clean the HTML + theText = theText.replace(/<(?:.|\n)*?>/gm, ''); + // Now fix HTML entities + theText = theText.replace(/</gi, '<'); + theText = theText.replace(/>/gi, '>'); + } + return theText; + } + + function _setText(el, content) { + // Don't convert lt/gt characters as HTML when viewing the editor window + // TODO: Write a test to catch regressions for this + content = content.replace(//g, '>'); + content = content.replace(/\n/g, '
'); + + // Make sure to there aren't two spaces in a row (replace one with  ) + // If you find and replace every space with a   text will not wrap. + // Hence the name (Non-Breaking-SPace). + // TODO: Probably need to test this somehow... + content = content.replace(/
\s/g, '
 ') + content = content.replace(/\s\s\s/g, '   ') + content = content.replace(/\s\s/g, '  ') + content = content.replace(/^ /, ' ') + + el.innerHTML = content; + return true; + } + + /** + * Converts the 'raw' format of a file's contents into plaintext + * @param {string} content Contents of the file + * @returns {string} the sanitized content + */ + function _sanitizeRawContent(content) { + // Get this, 2 spaces in a content editable actually converts to: + // 0020 00a0, meaning, "space no-break space". So, manually convert + // no-break spaces to spaces again before handing to marked. + // Also, WebKit converts no-break to unicode equivalent and FF HTML. + return content.replace(/\u00a0/g, ' ').replace(/ /g, ' '); + } + + /** + * Will return the version number if the browser is IE. If not will return -1 + * TRY NEVER TO USE THIS AND USE FEATURE DETECTION IF POSSIBLE + * @returns {Number} -1 if false or the version number if true + */ + function _isIE() { + var rv = -1 // Return value assumes failure. + , ua = navigator.userAgent + , re; + if (navigator.appName == 'Microsoft Internet Explorer') { + re = /MSIE ([0-9]{1,}[\.0-9]{0,})/; + if (re.exec(ua) != null) { + rv = parseFloat(RegExp.$1, 10); + } + } + return rv; + } + + /** + * Same as the isIE(), but simply returns a boolean + * THIS IS TERRIBLE AND IS ONLY USED BECAUSE FULLSCREEN IN SAFARI IS BORKED + * If some other engine uses WebKit and has support for fullscreen they + * probably wont get native fullscreen until Safari's fullscreen is fixed + * @returns {Boolean} true if Safari + */ + function _isSafari() { + var n = window.navigator; + return n.userAgent.indexOf('Safari') > -1 && n.userAgent.indexOf('Chrome') == -1; + } + + /** + * Same as the isIE(), but simply returns a boolean + * THIS IS TERRIBLE ONLY USE IF ABSOLUTELY NEEDED + * @returns {Boolean} true if Safari + */ + function _isFirefox() { + var n = window.navigator; + return n.userAgent.indexOf('Firefox') > -1 && n.userAgent.indexOf('Seamonkey') == -1; + } + + /** + * Determines if supplied value is a function + * @param {object} object to determine type + */ + function _isFunction(functionToCheck) { + var getType = {}; + return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; + } + + /** + * Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1 + * @param {boolean} [deepMerge=false] If true, will deep merge meaning it will merge sub-objects like {obj:obj2{foo:'bar'}} + * @param {object} first object + * @param {object} second object + * @returnss {object} a new object based on obj1 and obj2 + */ + function _mergeObjs() { + // copy reference to target object + var target = arguments[0] || {} + , i = 1 + , length = arguments.length + , deep = false + , options + , name + , src + , copy + + // Handle a deep copy situation + if (typeof target === "boolean") { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if (typeof target !== "object" && !_isFunction(target)) { + target = {}; + } + // extend jQuery itself if only one argument is passed + if (length === i) { + target = this; + --i; + } + + for (; i < length; i++) { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) { + // Extend the base object + for (name in options) { + // @NOTE: added hasOwnProperty check + if (options.hasOwnProperty(name)) { + src = target[name]; + copy = options[name]; + // Prevent never-ending loop + if (target === copy) { + continue; + } + // Recurse if we're merging object values + if (deep && copy && typeof copy === "object" && !copy.nodeType) { + target[name] = _mergeObjs(deep, + // Never move original objects, clone them + src || (copy.length != null ? [] : {}) + , copy); + } else if (copy !== undefined) { // Don't bring in undefined values + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; + } + + /** + * Initiates the EpicEditor object and sets up offline storage as well + * @class Represents an EpicEditor instance + * @param {object} options An optional customization object + * @returns {object} EpicEditor will be returned + */ + function EpicEditor(options) { + // Default settings will be overwritten/extended by options arg + var self = this + , opts = options || {} + , _defaultFileSchema + , _defaultFile + , defaults = { container: 'epiceditor' + , basePath: 'epiceditor' + , textarea: undefined + , clientSideStorage: true + , localStorageName: 'epiceditor' + , useNativeFullscreen: true + , file: { name: null + , defaultContent: '' + , autoSave: 100 // Set to false for no auto saving + } + , theme: { base: '/themes/base/epiceditor.css' + , preview: '/themes/preview/github.css' + , editor: '/themes/editor/epic-dark.css' + } + , focusOnLoad: false + , shortcut: { modifier: 18 // alt keycode + , fullscreen: 70 // f keycode + , preview: 80 // p keycode + } + , string: { togglePreview: 'Toggle Preview Mode' + , toggleEdit: 'Toggle Edit Mode' + , toggleFullscreen: 'Enter Fullscreen' + } + , parser: typeof marked == 'function' ? marked : null + , autogrow: false + , button: { fullscreen: true + , preview: true + , bar: "auto" + } + } + , defaultStorage + , autogrowDefaults = { minHeight: 80 + , maxHeight: false + , scroll: true + }; + + self.settings = _mergeObjs(true, defaults, opts); + + var buttons = self.settings.button; + self._fullscreenEnabled = typeof(buttons) === 'object' ? typeof buttons.fullscreen === 'undefined' || buttons.fullscreen : buttons === true; + self._editEnabled = typeof(buttons) === 'object' ? typeof buttons.edit === 'undefined' || buttons.edit : buttons === true; + self._previewEnabled = typeof(buttons) === 'object' ? typeof buttons.preview === 'undefined' || buttons.preview : buttons === true; + + if (!(typeof self.settings.parser == 'function' && typeof self.settings.parser('TEST') == 'string')) { + self.settings.parser = function (str) { + return str; + } + } + + if (self.settings.autogrow) { + if (self.settings.autogrow === true) { + self.settings.autogrow = autogrowDefaults; + } + else { + self.settings.autogrow = _mergeObjs(true, autogrowDefaults, self.settings.autogrow); + } + self._oldHeight = -1; + } + + // If you put an absolute link as the path of any of the themes ignore the basePath + // preview theme + if (!self.settings.theme.preview.match(/^https?:\/\//)) { + self.settings.theme.preview = self.settings.basePath + self.settings.theme.preview; + } + // editor theme + if (!self.settings.theme.editor.match(/^https?:\/\//)) { + self.settings.theme.editor = self.settings.basePath + self.settings.theme.editor; + } + // base theme + if (!self.settings.theme.base.match(/^https?:\/\//)) { + self.settings.theme.base = self.settings.basePath + self.settings.theme.base; + } + + // Grab the container element and save it to self.element + // if it's a string assume it's an ID and if it's an object + // assume it's a DOM element + if (typeof self.settings.container == 'string') { + self.element = document.getElementById(self.settings.container); + } + else if (typeof self.settings.container == 'object') { + self.element = self.settings.container; + } + + // Figure out the file name. If no file name is given we'll use the ID. + // If there's no ID either we'll use a namespaced file name that's incremented + // based on the calling order. As long as it doesn't change, drafts will be saved. + if (!self.settings.file.name) { + if (typeof self.settings.container == 'string') { + self.settings.file.name = self.settings.container; + } + else if (typeof self.settings.container == 'object') { + if (self.element.id) { + self.settings.file.name = self.element.id; + } + else { + if (!EpicEditor._data.unnamedEditors) { + EpicEditor._data.unnamedEditors = []; + } + EpicEditor._data.unnamedEditors.push(self); + self.settings.file.name = '__epiceditor-untitled-' + EpicEditor._data.unnamedEditors.length; + } + } + } + + if (self.settings.button.bar === "show") { + self.settings.button.bar = true; + } + + if (self.settings.button.bar === "hide") { + self.settings.button.bar = false; + } + + // Protect the id and overwrite if passed in as an option + // TODO: Put underscrore to denote that this is private + self._instanceId = 'epiceditor-' + Math.round(Math.random() * 100000); + self._storage = {}; + self._canSave = true; + + // Setup local storage of files + self._defaultFileSchema = function () { + return { + content: self.settings.file.defaultContent + , created: new Date() + , modified: new Date() + } + } + + if (localStorage && self.settings.clientSideStorage) { + this._storage = localStorage; + if (this._storage[self.settings.localStorageName] && self.getFiles(self.settings.file.name) === undefined) { + _defaultFile = self._defaultFileSchema(); + _defaultFile.content = self.settings.file.defaultContent; + } + } + + if (!this._storage[self.settings.localStorageName]) { + defaultStorage = {}; + defaultStorage[self.settings.file.name] = self._defaultFileSchema(); + defaultStorage = JSON.stringify(defaultStorage); + this._storage[self.settings.localStorageName] = defaultStorage; + } + + // A string to prepend files with to save draft versions of files + // and reset all preview drafts on each load! + self._previewDraftLocation = '__draft-'; + self._storage[self._previewDraftLocation + self.settings.localStorageName] = self._storage[self.settings.localStorageName]; + + // This needs to replace the use of classes to check the state of EE + self._eeState = { + fullscreen: false + , preview: false + , edit: false + , loaded: false + , unloaded: false + } + + // Now that it exists, allow binding of events if it doesn't exist yet + if (!self.events) { + self.events = {}; + } + + return this; + } + + /** + * Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.load = function (callback) { + + // Get out early if it's already loaded + if (this.is('loaded')) { return this; } + + // TODO: Gotta get the privates with underscores! + // TODO: Gotta document what these are for... + var self = this + , _HtmlTemplates + , iframeElement + , baseTag + , utilBtns + , utilBar + , utilBarTimer + , keypressTimer + , mousePos = { y: -1, x: -1 } + , _elementStates + , _isInEdit + , nativeFs = false + , nativeFsWebkit = false + , nativeFsMoz = false + , nativeFsW3C = false + , fsElement + , isMod = false + , isCtrl = false + , eventableIframes + , i // i is reused for loops + , boundAutogrow; + + // Startup is a way to check if this EpicEditor is starting up. Useful for + // checking and doing certain things before EpicEditor emits a load event. + self._eeState.startup = true; + + if (self.settings.useNativeFullscreen) { + nativeFsWebkit = document.body.webkitRequestFullScreen ? true : false; + nativeFsMoz = document.body.mozRequestFullScreen ? true : false; + nativeFsW3C = document.body.requestFullscreen ? true : false; + nativeFs = nativeFsWebkit || nativeFsMoz || nativeFsW3C; + } + + // Fucking Safari's native fullscreen works terribly + // REMOVE THIS IF SAFARI 7 WORKS BETTER + if (_isSafari()) { + nativeFs = false; + nativeFsWebkit = false; + } + + // It opens edit mode by default (for now); + if (!self.is('edit') && !self.is('preview')) { + self._eeState.edit = true; + } + + callback = callback || function () {}; + + // The editor HTML + // TODO: edit-mode class should be dynamically added + _HtmlTemplates = { + // This is wrapping iframe element. It contains the other two iframes and the utilbar + chrome: '
' + + '' + + '' + + '
' + + (self._previewEnabled ? ' ' : '') + + (self._editEnabled ? ' ' : '') + + (self._fullscreenEnabled ? '' : '') + + '
' + + '
' + + // The previewer is just an empty box for the generated HTML to go into + , previewer: '
' + , editor: '' + }; + + // Write an iframe and then select it for the editor + self.element.innerHTML = ''; + + // Because browsers add things like invisible padding and margins and stuff + // to iframes, we need to set manually set the height so that the height + // doesn't keep increasing (by 2px?) every time reflow() is called. + // FIXME: Figure out how to fix this without setting this + self.element.style.height = self.element.offsetHeight + 'px'; + + iframeElement = document.getElementById(self._instanceId); + + // Store a reference to the iframeElement itself + self.iframeElement = iframeElement; + + // Grab the innards of the iframe (returns the document.body) + // TODO: Change self.iframe to self.iframeDocument + self.iframe = _getIframeInnards(iframeElement); + self.iframe.open(); + self.iframe.write(_HtmlTemplates.chrome); + + // Now that we got the innards of the iframe, we can grab the other iframes + self.editorIframe = self.iframe.getElementById('epiceditor-editor-frame') + self.previewerIframe = self.iframe.getElementById('epiceditor-previewer-frame'); + + // Setup the editor iframe + self.editorIframeDocument = _getIframeInnards(self.editorIframe); + self.editorIframeDocument.open(); + // Need something for... you guessed it, Firefox + self.editorIframeDocument.write(_HtmlTemplates.editor); + self.editorIframeDocument.close(); + + // Setup the previewer iframe + self.previewerIframeDocument = _getIframeInnards(self.previewerIframe); + self.previewerIframeDocument.open(); + self.previewerIframeDocument.write(_HtmlTemplates.previewer); + + // Base tag is added so that links will open a new tab and not inside of the iframes + baseTag = self.previewerIframeDocument.createElement('base'); + baseTag.target = '_blank'; + self.previewerIframeDocument.getElementsByTagName('head')[0].appendChild(baseTag); + + self.previewerIframeDocument.close(); + + self.reflow(); + + // Insert Base Stylesheet + _insertCSSLink(self.settings.theme.base, self.iframe, 'theme'); + + // Insert Editor Stylesheet + _insertCSSLink(self.settings.theme.editor, self.editorIframeDocument, 'theme'); + + // Insert Previewer Stylesheet + _insertCSSLink(self.settings.theme.preview, self.previewerIframeDocument, 'theme'); + + // Add a relative style to the overall wrapper to keep CSS relative to the editor + self.iframe.getElementById('epiceditor-wrapper').style.position = 'relative'; + + // Set the position to relative so we hide them with left: -999999px + self.editorIframe.style.position = 'absolute'; + self.previewerIframe.style.position = 'absolute'; + + // Now grab the editor and previewer for later use + self.editor = self.editorIframeDocument.body; + self.previewer = self.previewerIframeDocument.getElementById('epiceditor-preview'); + + self.editor.contentEditable = true; + + // Firefox's gets all fucked up so, to be sure, we need to hardcode it + self.iframe.body.style.height = this.element.offsetHeight + 'px'; + + // Should actually check what mode it's in! + self.previewerIframe.style.left = '-999999px'; + + // Keep long lines from being longer than the editor + this.editorIframeDocument.body.style.wordWrap = 'break-word'; + + // FIXME figure out why it needs +2 px + if (_isIE() > -1) { + this.previewer.style.height = parseInt(_getStyle(this.previewer, 'height'), 10) + 2; + } + + // If there is a file to be opened with that filename and it has content... + this.open(self.settings.file.name); + + if (self.settings.focusOnLoad) { + // We need to wait until all three iframes are done loading by waiting until the parent + // iframe's ready state == complete, then we can focus on the contenteditable + self.iframe.addEventListener('readystatechange', function () { + if (self.iframe.readyState == 'complete') { + self.focus(); + } + }); + } + + // Because IE scrolls the whole window to hash links, we need our own + // method of scrolling the iframe to an ID from clicking a hash + self.previewerIframeDocument.addEventListener('click', function (e) { + var el = e.target + , body = self.previewerIframeDocument.body; + if (el.nodeName == 'A') { + // Make sure the link is a hash and the link is local to the iframe + if (el.hash && el.hostname == window.location.hostname) { + // Prevent the whole window from scrolling + e.preventDefault(); + // Prevent opening a new window + el.target = '_self'; + // Scroll to the matching element, if an element exists + if (body.querySelector(el.hash)) { + body.scrollTop = body.querySelector(el.hash).offsetTop; + } + } + } + }); + + utilBtns = self.iframe.getElementById('epiceditor-utilbar'); + + // TODO: Move into fullscreen setup function (_setupFullscreen) + _elementStates = {} + self._goFullscreen = function (el) { + this._fixScrollbars('auto'); + + if (self.is('fullscreen')) { + self._exitFullscreen(el); + return; + } + + if (nativeFs) { + if (nativeFsWebkit) { + el.webkitRequestFullScreen(); + } + else if (nativeFsMoz) { + el.mozRequestFullScreen(); + } + else if (nativeFsW3C) { + el.requestFullscreen(); + } + } + + _isInEdit = self.is('edit'); + + // Set the state of EE in fullscreen + // We set edit and preview to true also because they're visible + // we might want to allow fullscreen edit mode without preview (like a "zen" mode) + self._eeState.fullscreen = true; + self._eeState.edit = true; + self._eeState.preview = true; + + // Cache calculations + var windowInnerWidth = window.innerWidth + , windowInnerHeight = window.innerHeight + , windowOuterWidth = window.outerWidth + , windowOuterHeight = window.outerHeight; + + // Without this the scrollbars will get hidden when scrolled to the bottom in faux fullscreen (see #66) + if (!nativeFs) { + windowOuterHeight = window.innerHeight; + } + + // This MUST come first because the editor is 100% width so if we change the width of the iframe or wrapper + // the editor's width wont be the same as before + _elementStates.editorIframe = _saveStyleState(self.editorIframe, 'save', { + 'width': windowOuterWidth / 2 + 'px' + , 'height': windowOuterHeight + 'px' + , 'float': 'left' // Most browsers + , 'cssFloat': 'left' // FF + , 'styleFloat': 'left' // Older IEs + , 'display': 'block' + , 'position': 'static' + , 'left': '' + }); + + // the previewer + _elementStates.previewerIframe = _saveStyleState(self.previewerIframe, 'save', { + 'width': windowOuterWidth / 2 + 'px' + , 'height': windowOuterHeight + 'px' + , 'float': 'right' // Most browsers + , 'cssFloat': 'right' // FF + , 'styleFloat': 'right' // Older IEs + , 'display': 'block' + , 'position': 'static' + , 'left': '' + }); + + // Setup the containing element CSS for fullscreen + _elementStates.element = _saveStyleState(self.element, 'save', { + 'position': 'fixed' + , 'top': '0' + , 'left': '0' + , 'width': '100%' + , 'z-index': '9999' // Most browsers + , 'zIndex': '9999' // Firefox + , 'border': 'none' + , 'margin': '0' + // Should use the base styles background! + , 'background': _getStyle(self.editor, 'background-color') // Try to hide the site below + , 'height': windowInnerHeight + 'px' + }); + + // The iframe element + _elementStates.iframeElement = _saveStyleState(self.iframeElement, 'save', { + 'width': windowOuterWidth + 'px' + , 'height': windowInnerHeight + 'px' + }); + + // ...Oh, and hide the buttons and prevent scrolling + utilBtns.style.visibility = 'hidden'; + + if (!nativeFs) { + document.body.style.overflow = 'hidden'; + } + + self.preview(); + + self.focus(); + + self.emit('fullscreenenter'); + }; + + self._exitFullscreen = function (el) { + this._fixScrollbars(); + + _saveStyleState(self.element, 'apply', _elementStates.element); + _saveStyleState(self.iframeElement, 'apply', _elementStates.iframeElement); + _saveStyleState(self.editorIframe, 'apply', _elementStates.editorIframe); + _saveStyleState(self.previewerIframe, 'apply', _elementStates.previewerIframe); + + // We want to always revert back to the original styles in the CSS so, + // if it's a fluid width container it will expand on resize and not get + // stuck at a specific width after closing fullscreen. + self.element.style.width = self._eeState.reflowWidth ? self._eeState.reflowWidth : ''; + self.element.style.height = self._eeState.reflowHeight ? self._eeState.reflowHeight : ''; + + utilBtns.style.visibility = 'visible'; + + // Put the editor back in the right state + // TODO: This is ugly... how do we make this nicer? + // setting fullscreen to false here prevents the + // native fs callback from calling this function again + self._eeState.fullscreen = false; + + if (!nativeFs) { + document.body.style.overflow = 'auto'; + } + else { + if (nativeFsWebkit) { + document.webkitCancelFullScreen(); + } + else if (nativeFsMoz) { + document.mozCancelFullScreen(); + } + else if (nativeFsW3C) { + document.exitFullscreen(); + } + } + + if (_isInEdit) { + self.edit(); + } + else { + self.preview(); + } + + self.reflow(); + + self.emit('fullscreenexit'); + }; + + // This setups up live previews by triggering preview() IF in fullscreen on keyup + self.editor.addEventListener('keyup', function () { + if (keypressTimer) { + window.clearTimeout(keypressTimer); + } + keypressTimer = window.setTimeout(function () { + if (self.is('fullscreen')) { + self.preview(); + } + }, 250); + }); + + fsElement = self.iframeElement; + + // Sets up the onclick event on utility buttons + utilBtns.addEventListener('click', function (e) { + var targetClass = e.target.className; + if (targetClass.indexOf('epiceditor-toggle-preview-btn') > -1) { + self.preview(); + } + else if (targetClass.indexOf('epiceditor-toggle-edit-btn') > -1) { + self.edit(); + } + else if (targetClass.indexOf('epiceditor-fullscreen-btn') > -1) { + self._goFullscreen(fsElement); + } + }); + + // Sets up the NATIVE fullscreen editor/previewer for WebKit + if (nativeFsWebkit) { + document.addEventListener('webkitfullscreenchange', function () { + if (!document.webkitIsFullScreen && self._eeState.fullscreen) { + self._exitFullscreen(fsElement); + } + }, false); + } + else if (nativeFsMoz) { + document.addEventListener('mozfullscreenchange', function () { + if (!document.mozFullScreen && self._eeState.fullscreen) { + self._exitFullscreen(fsElement); + } + }, false); + } + else if (nativeFsW3C) { + document.addEventListener('fullscreenchange', function () { + if (document.fullscreenElement == null && self._eeState.fullscreen) { + self._exitFullscreen(fsElement); + } + }, false); + } + + // TODO: Move utilBar stuff into a utilBar setup function (_setupUtilBar) + utilBar = self.iframe.getElementById('epiceditor-utilbar'); + + // Hide it at first until they move their mouse + if (self.settings.button.bar !== true) { + utilBar.style.display = 'none'; + } + + utilBar.addEventListener('mouseover', function () { + if (utilBarTimer) { + clearTimeout(utilBarTimer); + } + }); + + function utilBarHandler(e) { + if (self.settings.button.bar !== "auto") { + return; + } + // Here we check if the mouse has moves more than 5px in any direction before triggering the mousemove code + // we do this for 2 reasons: + // 1. On Mac OS X lion when you scroll and it does the iOS like "jump" when it hits the top/bottom of the page itll fire off + // a mousemove of a few pixels depending on how hard you scroll + // 2. We give a slight buffer to the user in case he barely touches his touchpad or mouse and not trigger the UI + if (Math.abs(mousePos.y - e.pageY) >= 5 || Math.abs(mousePos.x - e.pageX) >= 5) { + utilBar.style.display = 'block'; + // if we have a timer already running, kill it out + if (utilBarTimer) { + clearTimeout(utilBarTimer); + } + + // begin a new timer that hides our object after 1000 ms + utilBarTimer = window.setTimeout(function () { + utilBar.style.display = 'none'; + }, 1000); + } + mousePos = { y: e.pageY, x: e.pageX }; + } + + // Add keyboard shortcuts for convenience. + function shortcutHandler(e) { + if (e.keyCode == self.settings.shortcut.modifier) { isMod = true } // check for modifier press(default is alt key), save to var + if (e.keyCode == 17) { isCtrl = true } // check for ctrl/cmnd press, in order to catch ctrl/cmnd + s + + // Check for alt+p and make sure were not in fullscreen - default shortcut to switch to preview + if (isMod === true && e.keyCode == self.settings.shortcut.preview && !self.is('fullscreen')) { + e.preventDefault(); + if (self.is('edit') && self._previewEnabled) { + self.preview(); + } + else if (self._editEnabled) { + self.edit(); + } + } + // Check for alt+f - default shortcut to make editor fullscreen + if (isMod === true && e.keyCode == self.settings.shortcut.fullscreen && self._fullscreenEnabled) { + e.preventDefault(); + self._goFullscreen(fsElement); + } + + // Set the modifier key to false once *any* key combo is completed + // or else, on Windows, hitting the alt key will lock the isMod state to true (ticket #133) + if (isMod === true && e.keyCode !== self.settings.shortcut.modifier) { + isMod = false; + } + + // When a user presses "esc", revert everything! + if (e.keyCode == 27 && self.is('fullscreen')) { + self._exitFullscreen(fsElement); + } + + // Check for ctrl + s (since a lot of people do it out of habit) and make it do nothing + if (isCtrl === true && e.keyCode == 83) { + self.save(); + e.preventDefault(); + isCtrl = false; + } + + // Do the same for Mac now (metaKey == cmd). + if (e.metaKey && e.keyCode == 83) { + self.save(); + e.preventDefault(); + } + + } + + function shortcutUpHandler(e) { + if (e.keyCode == self.settings.shortcut.modifier) { isMod = false } + if (e.keyCode == 17) { isCtrl = false } + } + + function pasteHandler(e) { + var content; + if (e.clipboardData) { + //FF 22, Webkit, "standards" + e.preventDefault(); + content = e.clipboardData.getData("text/plain"); + self.editorIframeDocument.execCommand("insertText", false, content); + } + else if (window.clipboardData) { + //IE, "nasty" + e.preventDefault(); + content = window.clipboardData.getData("Text"); + content = content.replace(//g, '>'); + content = content.replace(/\n/g, '
'); + content = content.replace(/\r/g, ''); //fuck you, ie! + content = content.replace(/
\s/g, '
 ') + content = content.replace(/\s\s\s/g, '   ') + content = content.replace(/\s\s/g, '  ') + self.editorIframeDocument.selection.createRange().pasteHTML(content); + } + } + + // Hide and show the util bar based on mouse movements + eventableIframes = [self.previewerIframeDocument, self.editorIframeDocument]; + + for (i = 0; i < eventableIframes.length; i++) { + eventableIframes[i].addEventListener('mousemove', function (e) { + utilBarHandler(e); + }); + eventableIframes[i].addEventListener('scroll', function (e) { + utilBarHandler(e); + }); + eventableIframes[i].addEventListener('keyup', function (e) { + shortcutUpHandler(e); + }); + eventableIframes[i].addEventListener('keydown', function (e) { + shortcutHandler(e); + }); + eventableIframes[i].addEventListener('paste', function (e) { + pasteHandler(e); + }); + } + + // Save the document every 100ms by default + // TODO: Move into autosave setup function (_setupAutoSave) + if (self.settings.file.autoSave) { + self._saveIntervalTimer = window.setInterval(function () { + if (!self._canSave) { + return; + } + self.save(false, true); + }, self.settings.file.autoSave); + } + + // Update a textarea automatically if a textarea is given so you don't need + // AJAX to submit a form and instead fall back to normal form behavior + if (self.settings.textarea) { + self._setupTextareaSync(); + } + + window.addEventListener('resize', function () { + // If NOT webkit, and in fullscreen, we need to account for browser resizing + // we don't care about webkit because you can't resize in webkit's fullscreen + if (self.is('fullscreen')) { + _applyStyles(self.iframeElement, { + 'width': window.outerWidth + 'px' + , 'height': window.innerHeight + 'px' + }); + + _applyStyles(self.element, { + 'height': window.innerHeight + 'px' + }); + + _applyStyles(self.previewerIframe, { + 'width': window.outerWidth / 2 + 'px' + , 'height': window.innerHeight + 'px' + }); + + _applyStyles(self.editorIframe, { + 'width': window.outerWidth / 2 + 'px' + , 'height': window.innerHeight + 'px' + }); + } + // Makes the editor support fluid width when not in fullscreen mode + else if (!self.is('fullscreen')) { + self.reflow(); + } + }); + + // Set states before flipping edit and preview modes + self._eeState.loaded = true; + self._eeState.unloaded = false; + + if (self.is('preview')) { + self.preview(); + } + else { + self.edit(); + } + + self.iframe.close(); + self._eeState.startup = false; + + if (self.settings.autogrow) { + self._fixScrollbars(); + + boundAutogrow = function () { + setTimeout(function () { + self._autogrow(); + }, 1); + }; + + //for if autosave is disabled or very slow + ['keydown', 'keyup', 'paste', 'cut'].forEach(function (ev) { + self.getElement('editor').addEventListener(ev, boundAutogrow); + }); + + self.on('__update', boundAutogrow); + self.on('edit', function () { + setTimeout(boundAutogrow, 50) + }); + self.on('preview', function () { + setTimeout(boundAutogrow, 50) + }); + + //for browsers that have rendering delays + setTimeout(boundAutogrow, 50); + boundAutogrow(); + } + + // The callback and call are the same thing, but different ways to access them + callback.call(this); + this.emit('load'); + return this; + } + + EpicEditor.prototype._setupTextareaSync = function () { + var self = this + , textareaFileName = self.settings.file.name + , _syncTextarea; + + // Even if autoSave is false, we want to make sure to keep the textarea synced + // with the editor's content. One bad thing about this tho is that we're + // creating two timers now in some configurations. We keep the textarea synced + // by saving and opening the textarea content from the draft file storage. + self._textareaSaveTimer = window.setInterval(function () { + if (!self._canSave) { + return; + } + self.save(true); + }, 100); + + _syncTextarea = function () { + // TODO: Figure out root cause for having to do this ||. + // This only happens for draft files. Probably has something to do with + // the fact draft files haven't been saved by the time this is called. + // TODO: Add test for this case. + self._textareaElement.value = self.exportFile(textareaFileName, 'text', true) || self.settings.file.defaultContent; + } + + if (typeof self.settings.textarea == 'string') { + self._textareaElement = document.getElementById(self.settings.textarea); + } + else if (typeof self.settings.textarea == 'object') { + self._textareaElement = self.settings.textarea; + } + + // On page load, if there's content in the textarea that means one of two + // different things: + // + // 1. The editor didn't load and the user was writing in the textarea and + // now he refreshed the page or the JS loaded and the textarea now has + // content. If this is the case the user probably expects his content is + // moved into the editor and not lose what he typed. + // + // 2. The developer put content in the textarea from some server side + // code. In this case, the textarea will take precedence. + // + // If the developer wants drafts to be recoverable they should check if + // the local file in localStorage's modified date is newer than the server. + if (self._textareaElement.value !== '') { + self.importFile(textareaFileName, self._textareaElement.value); + + // manually save draft after import so there is no delay between the + // import and exporting in _syncTextarea. Without this, _syncTextarea + // will pull the saved data from localStorage which will be <=100ms old. + self.save(true); + } + + // Update the textarea on load and pull from drafts + _syncTextarea(); + + // Make sure to keep it updated + self.on('__update', _syncTextarea); + } + + /** + * Will NOT focus the editor if the editor is still starting up AND + * focusOnLoad is set to false. This allows you to place this in code that + * gets fired during .load() without worrying about it overriding the user's + * option. For example use cases see preview() and edit(). + * @returns {undefined} + */ + + // Prevent focus when the user sets focusOnLoad to false by checking if the + // editor is starting up AND if focusOnLoad is true + EpicEditor.prototype._focusExceptOnLoad = function () { + var self = this; + if ((self._eeState.startup && self.settings.focusOnLoad) || !self._eeState.startup) { + self.focus(); + } + } + + /** + * Will remove the editor, but not offline files + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.unload = function (callback) { + + // Make sure the editor isn't already unloaded. + if (this.is('unloaded')) { + throw new Error('Editor isn\'t loaded'); + } + + var self = this + , editor = window.parent.document.getElementById(self._instanceId); + + editor.parentNode.removeChild(editor); + self._eeState.loaded = false; + self._eeState.unloaded = true; + callback = callback || function () {}; + + if (self.settings.textarea) { + self._textareaElement.value = ""; + self.removeListener('__update'); + } + + if (self._saveIntervalTimer) { + window.clearInterval(self._saveIntervalTimer); + } + if (self._textareaSaveTimer) { + window.clearInterval(self._textareaSaveTimer); + } + + callback.call(this); + self.emit('unload'); + return self; + } + + /** + * reflow allows you to dynamically re-fit the editor in the parent without + * having to unload and then reload the editor again. + * + * reflow will also emit a `reflow` event and will return the new dimensions. + * If it's called without params it'll return the new width and height and if + * it's called with just width or just height it'll just return the width or + * height. It's returned as an object like: { width: '100px', height: '1px' } + * + * @param {string|null} kind Can either be 'width' or 'height' or null + * if null, both the height and width will be resized + * @param {function} callback A function to fire after the reflow is finished. + * Will return the width / height in an obj as the first param of the callback. + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.reflow = function (kind, callback) { + var self = this + , widthDiff = _outerWidth(self.element) - self.element.offsetWidth + , heightDiff = _outerHeight(self.element) - self.element.offsetHeight + , elements = [self.iframeElement, self.editorIframe, self.previewerIframe] + , eventData = {} + , newWidth + , newHeight; + + if (typeof kind == 'function') { + callback = kind; + kind = null; + } + + if (!callback) { + callback = function () {}; + } + + for (var x = 0; x < elements.length; x++) { + if (!kind || kind == 'width') { + newWidth = self.element.offsetWidth - widthDiff + 'px'; + elements[x].style.width = newWidth; + self._eeState.reflowWidth = newWidth; + eventData.width = newWidth; + } + if (!kind || kind == 'height') { + newHeight = self.element.offsetHeight - heightDiff + 'px'; + elements[x].style.height = newHeight; + self._eeState.reflowHeight = newHeight + eventData.height = newHeight; + } + } + + self.emit('reflow', eventData); + callback.call(this, eventData); + return self; + } + + /** + * Will take the markdown and generate a preview view based on the theme + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.preview = function () { + var self = this + , x + , theme = self.settings.theme.preview + , anchors; + + _replaceClass(self.getElement('wrapper'), 'epiceditor-edit-mode', 'epiceditor-preview-mode'); + + // Check if no CSS theme link exists + if (!self.previewerIframeDocument.getElementById('theme')) { + _insertCSSLink(theme, self.previewerIframeDocument, 'theme'); + } + else if (self.previewerIframeDocument.getElementById('theme').name !== theme) { + self.previewerIframeDocument.getElementById('theme').href = theme; + } + + // Save a preview draft since it might not be saved to the real file yet + self.save(true); + + // Add the generated draft HTML into the previewer + self.previewer.innerHTML = self.exportFile(null, 'html', true); + + // Hide the editor and display the previewer + if (!self.is('fullscreen')) { + self.editorIframe.style.left = '-999999px'; + self.previewerIframe.style.left = ''; + self._eeState.preview = true; + self._eeState.edit = false; + self._focusExceptOnLoad(); + } + + self.emit('preview'); + return self; + } + + /** + * Helper to focus on the editor iframe. Will figure out which iframe to + * focus on based on which one is active and will handle the cross browser + * issues with focusing on the iframe vs the document body. + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.focus = function (pageload) { + var self = this + , isPreview = self.is('preview') + , focusElement = isPreview ? self.previewerIframeDocument.body + : self.editorIframeDocument.body; + + if (_isFirefox() && isPreview) { + focusElement = self.previewerIframe; + } + + focusElement.focus(); + return this; + } + + /** + * Puts the editor into fullscreen mode + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.enterFullscreen = function () { + if (this.is('fullscreen')) { return this; } + this._goFullscreen(this.iframeElement); + return this; + } + + /** + * Closes fullscreen mode if opened + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.exitFullscreen = function () { + if (!this.is('fullscreen')) { return this; } + this._exitFullscreen(this.iframeElement); + return this; + } + + /** + * Hides the preview and shows the editor again + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.edit = function () { + var self = this; + _replaceClass(self.getElement('wrapper'), 'epiceditor-preview-mode', 'epiceditor-edit-mode'); + self._eeState.preview = false; + self._eeState.edit = true; + self.editorIframe.style.left = ''; + self.previewerIframe.style.left = '-999999px'; + self._focusExceptOnLoad(); + self.emit('edit'); + return this; + } + + /** + * Grabs a specificed HTML node. Use it as a shortcut to getting the iframe contents + * @param {String} name The name of the node (can be document, body, editor, previewer, or wrapper) + * @returns {Object|Null} + */ + EpicEditor.prototype.getElement = function (name) { + var available = { + "container": this.element + , "wrapper": this.iframe.getElementById('epiceditor-wrapper') + , "wrapperIframe": this.iframeElement + , "editor": this.editorIframeDocument + , "editorIframe": this.editorIframe + , "previewer": this.previewerIframeDocument + , "previewerIframe": this.previewerIframe + } + + // Check that the given string is a possible option and verify the editor isn't unloaded + // without this, you'd be given a reference to an object that no longer exists in the DOM + if (!available[name] || this.is('unloaded')) { + return null; + } + else { + return available[name]; + } + } + + /** + * Returns a boolean of each "state" of the editor. For example "editor.is('loaded')" // returns true/false + * @param {String} what the state you want to check for + * @returns {Boolean} + */ + EpicEditor.prototype.is = function (what) { + var self = this; + switch (what) { + case 'loaded': + return self._eeState.loaded; + case 'unloaded': + return self._eeState.unloaded + case 'preview': + return self._eeState.preview + case 'edit': + return self._eeState.edit; + case 'fullscreen': + return self._eeState.fullscreen; + // TODO: This "works", but the tests are saying otherwise. Come back to this + // and figure out how to fix it. + // case 'focused': + // return document.activeElement == self.iframeElement; + default: + return false; + } + } + + /** + * Opens a file + * @param {string} name The name of the file you want to open + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.open = function (name) { + var self = this + , defaultContent = self.settings.file.defaultContent + , fileObj; + name = name || self.settings.file.name; + self.settings.file.name = name; + if (this._storage[self.settings.localStorageName]) { + fileObj = self.exportFile(name); + if (fileObj !== undefined) { + _setText(self.editor, fileObj); + self.emit('read'); + } + else { + _setText(self.editor, defaultContent); + self.save(); // ensure a save + self.emit('create'); + } + self.previewer.innerHTML = self.exportFile(null, 'html'); + self.emit('open'); + } + return this; + } + + /** + * Saves content for offline use + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.save = function (_isPreviewDraft, _isAuto) { + var self = this + , storage + , isUpdate = false + , file = self.settings.file.name + , previewDraftName = '' + , data = this._storage[previewDraftName + self.settings.localStorageName] + , content = _getText(this.editor); + + if (_isPreviewDraft) { + previewDraftName = self._previewDraftLocation; + } + + // This could have been false but since we're manually saving + // we know it's save to start autoSaving again + this._canSave = true; + + // Guard against storage being wiped out without EpicEditor knowing + // TODO: Emit saving error - storage seems to have been wiped + if (data) { + storage = JSON.parse(this._storage[previewDraftName + self.settings.localStorageName]); + + // If the file doesn't exist we need to create it + if (storage[file] === undefined) { + storage[file] = self._defaultFileSchema(); + } + + // If it does, we need to check if the content is different and + // if it is, send the update event and update the timestamp + else if (content !== storage[file].content) { + storage[file].modified = new Date(); + isUpdate = true; + } + //don't bother autosaving if the content hasn't actually changed + else if (_isAuto) { + return; + } + + storage[file].content = content; + this._storage[previewDraftName + self.settings.localStorageName] = JSON.stringify(storage); + + // After the content is actually changed, emit update so it emits the updated content + if (isUpdate) { + self.emit('update'); + // Emit a private update event so it can't get accidentally removed + self.emit('__update'); + } + + if (_isAuto) { + this.emit('autosave'); + } + else if (!_isPreviewDraft) { + this.emit('save'); + } + } + + return this; + } + + /** + * Removes a page + * @param {string} name The name of the file you want to remove from localStorage + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.remove = function (name) { + var self = this + , s; + name = name || self.settings.file.name; + + // If you're trying to delete a page you have open, block saving + if (name == self.settings.file.name) { + self._canSave = false; + } + + s = JSON.parse(this._storage[self.settings.localStorageName]); + delete s[name]; + this._storage[self.settings.localStorageName] = JSON.stringify(s); + this.emit('remove'); + return this; + }; + + /** + * Renames a file + * @param {string} oldName The old file name + * @param {string} newName The new file name + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.rename = function (oldName, newName) { + var self = this + , s = JSON.parse(this._storage[self.settings.localStorageName]); + s[newName] = s[oldName]; + delete s[oldName]; + this._storage[self.settings.localStorageName] = JSON.stringify(s); + self.open(newName); + return this; + }; + + /** + * Imports a file and it's contents and opens it + * @param {string} name The name of the file you want to import (will overwrite existing files!) + * @param {string} content Content of the file you want to import + * @param {string} kind The kind of file you want to import (TBI) + * @param {object} meta Meta data you want to save with your file. + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.importFile = function (name, content, kind, meta) { + var self = this + , isNew = false; + + name = name || self.settings.file.name; + content = content || ''; + kind = kind || 'md'; + meta = meta || {}; + + if (JSON.parse(this._storage[self.settings.localStorageName])[name] === undefined) { + isNew = true; + } + + // Set our current file to the new file and update the content + self.settings.file.name = name; + _setText(self.editor, content); + + if (isNew) { + self.emit('create'); + } + + self.save(); + + if (self.is('fullscreen')) { + self.preview(); + } + + //firefox has trouble with importing and working out the size right away + if (self.settings.autogrow) { + setTimeout(function () { + self._autogrow(); + }, 50); + } + + return this; + }; + + /** + * Gets the local filestore + * @param {string} name Name of the file in the store + * @returns {object|undefined} the local filestore, or a specific file in the store, if a name is given + */ + EpicEditor.prototype._getFileStore = function (name, _isPreviewDraft) { + var previewDraftName = '' + , store; + if (_isPreviewDraft) { + previewDraftName = this._previewDraftLocation; + } + store = JSON.parse(this._storage[previewDraftName + this.settings.localStorageName]); + if (name) { + return store[name]; + } + else { + return store; + } + } + + /** + * Exports a file as a string in a supported format + * @param {string} name Name of the file you want to export (case sensitive) + * @param {string} kind Kind of file you want the content in (currently supports html and text, default is the format the browser "wants") + * @returns {string|undefined} The content of the file in the content given or undefined if it doesn't exist + */ + EpicEditor.prototype.exportFile = function (name, kind, _isPreviewDraft) { + var self = this + , file + , content; + + name = name || self.settings.file.name; + kind = kind || 'text'; + + file = self._getFileStore(name, _isPreviewDraft); + + // If the file doesn't exist just return early with undefined + if (file === undefined) { + return; + } + + content = file.content; + + switch (kind) { + case 'html': + content = _sanitizeRawContent(content); + return self.settings.parser(content); + case 'text': + return _sanitizeRawContent(content); + case 'json': + file.content = _sanitizeRawContent(file.content); + return JSON.stringify(file); + case 'raw': + return content; + default: + return content; + } + } + + /** + * Gets the contents and metadata for files + * @param {string} name Name of the file whose data you want (case sensitive) + * @param {boolean} excludeContent whether the contents of files should be excluded + * @returns {object} An object with the names and data of every file, or just the data of one file if a name was given + */ + EpicEditor.prototype.getFiles = function (name, excludeContent) { + var file + , data = this._getFileStore(name); + + if (name) { + if (data !== undefined) { + if (excludeContent) { + delete data.content; + } + else { + data.content = _sanitizeRawContent(data.content); + } + } + return data; + } + else { + for (file in data) { + if (data.hasOwnProperty(file)) { + if (excludeContent) { + delete data[file].content; + } + else { + data[file].content = _sanitizeRawContent(data[file].content); + } + } + } + return data; + } + } + + // EVENTS + // TODO: Support for namespacing events like "preview.foo" + /** + * Sets up an event handler for a specified event + * @param {string} ev The event name + * @param {function} handler The callback to run when the event fires + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.on = function (ev, handler) { + var self = this; + if (!this.events[ev]) { + this.events[ev] = []; + } + this.events[ev].push(handler); + return self; + }; + + /** + * This will emit or "trigger" an event specified + * @param {string} ev The event name + * @param {any} data Any data you want to pass into the callback + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.emit = function (ev, data) { + var self = this + , x; + + data = data || self.getFiles(self.settings.file.name); + + if (!this.events[ev]) { + return; + } + + function invokeHandler(handler) { + handler.call(self, data); + } + + for (x = 0; x < self.events[ev].length; x++) { + invokeHandler(self.events[ev][x]); + } + + return self; + }; + + /** + * Will remove any listeners added from EpicEditor.on() + * @param {string} ev The event name + * @param {function} handler Handler to remove + * @returns {object} EpicEditor will be returned + */ + EpicEditor.prototype.removeListener = function (ev, handler) { + var self = this; + if (!handler) { + this.events[ev] = []; + return self; + } + if (!this.events[ev]) { + return self; + } + // Otherwise a handler and event exist, so take care of it + this.events[ev].splice(this.events[ev].indexOf(handler), 1); + return self; + } + + /** + * Handles autogrowing the editor + */ + EpicEditor.prototype._autogrow = function () { + var editorHeight + , newHeight + , minHeight + , maxHeight + , el + , style + , maxedOut = false; + + //autogrow in fullscreen is nonsensical + if (!this.is('fullscreen')) { + if (this.is('edit')) { + el = this.getElement('editor').documentElement; + } + else { + el = this.getElement('previewer').documentElement; + } + + editorHeight = _outerHeight(el); + newHeight = editorHeight; + + //handle minimum + minHeight = this.settings.autogrow.minHeight; + if (typeof minHeight === 'function') { + minHeight = minHeight(this); + } + + if (minHeight && newHeight < minHeight) { + newHeight = minHeight; + } + + //handle maximum + maxHeight = this.settings.autogrow.maxHeight; + if (typeof maxHeight === 'function') { + maxHeight = maxHeight(this); + } + + if (maxHeight && newHeight > maxHeight) { + newHeight = maxHeight; + maxedOut = true; + } + + if (maxedOut) { + this._fixScrollbars('auto'); + } else { + this._fixScrollbars('hidden'); + } + + //actual resize + if (newHeight != this.oldHeight) { + this.getElement('container').style.height = newHeight + 'px'; + this.reflow(); + if (this.settings.autogrow.scroll) { + window.scrollBy(0, newHeight - this.oldHeight); + } + this.oldHeight = newHeight; + } + } + } + + /** + * Shows or hides scrollbars based on the autogrow setting + * @param {string} forceSetting a value to force the overflow to + */ + EpicEditor.prototype._fixScrollbars = function (forceSetting) { + var setting; + if (this.settings.autogrow) { + setting = 'hidden'; + } + else { + setting = 'auto'; + } + setting = forceSetting || setting; + this.getElement('editor').documentElement.style.overflow = setting; + this.getElement('previewer').documentElement.style.overflow = setting; + } + + EpicEditor.version = '0.2.2'; + + // Used to store information to be shared across editors + EpicEditor._data = {}; + + window.EpicEditor = EpicEditor; +})(window); + +/** + * marked - a markdown parser + * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ + +;(function() { + +/** + * Block-Level Grammar + */ + +var block = { + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, + fences: noop, + hr: /^( *[-*_]){3,} *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + nptable: noop, + lheading: /^([^\n]+)\n *(=|-){3,} *\n*/, + blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/, + list: /^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, + def: /^ *\[([^\]]+)\]: *([^\s]+)(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + table: noop, + paragraph: /^([^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+\n*/, + text: /^[^\n]+/ +}; + +block.bullet = /(?:[*+-]|\d+\.)/; +block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = replace(block.item, 'gm') + (/bull/g, block.bullet) + (); + +block.list = replace(block.list) + (/bull/g, block.bullet) + ('hr', /\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/) + (); + +block._tag = '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b'; + +block.html = replace(block.html) + ('comment', //) + ('closed', /<(tag)[\s\S]+?<\/\1>/) + ('closing', /])*?>/) + (/tag/g, block._tag) + (); + +block.paragraph = replace(block.paragraph) + ('hr', block.hr) + ('heading', block.heading) + ('lheading', block.lheading) + ('blockquote', block.blockquote) + ('tag', '<' + block._tag) + ('def', block.def) + (); + +/** + * Normal Block Grammar + */ + +block.normal = merge({}, block); + +/** + * GFM Block Grammar + */ + +block.gfm = merge({}, block.normal, { + fences: /^ *(`{3,}|~{3,}) *(\w+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, + paragraph: /^/ +}); + +block.gfm.paragraph = replace(block.paragraph) + ('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|') + (); + +/** + * GFM + Tables Block Grammar + */ + +block.tables = merge({}, block.gfm, { + nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, + table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ +}); + +/** + * Block Lexer + */ + +function Lexer(options) { + this.tokens = []; + this.tokens.links = {}; + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } + } +} + +/** + * Expose Block Rules + */ + +Lexer.rules = block; + +/** + * Static Lex Method + */ + +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; + +/** + * Preprocessing + */ + +Lexer.prototype.lex = function(src) { + src = src + .replace(/\r\n|\r/g, '\n') + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); + + return this.token(src, true); +}; + +/** + * Lexing + */ + +Lexer.prototype.token = function(src, top) { + var src = src.replace(/^ +$/gm, '') + , next + , loose + , cap + , item + , space + , i + , l; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + cap = cap[0].replace(/^ {4}/gm, ''); + this.tokens.push({ + type: 'code', + text: !this.options.pedantic + ? cap.replace(/\n+$/, '') + : cap + }); + continue; + } + + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'code', + lang: cap[2], + text: cap[3] + }); + continue; + } + + // heading + if (cap = this.rules.heading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[1].length, + text: cap[2] + }); + continue; + } + + // table no leading pipe (gfm) + if (top && (cap = this.rules.nptable.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i].split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // lheading + if (cap = this.rules.lheading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[2] === '=' ? 1 : 2, + text: cap[1] + }); + continue; + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'list_start', + ordered: isFinite(cap[2]) + }); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) +/, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item[item.length-1] === '\n'; + if (!loose) loose = next; + } + + this.tokens.push({ + type: loose + ? 'loose_item_start' + : 'list_item_start' + }); + + // Recurse. + this.token(item, false); + + this.tokens.push({ + type: 'list_item_end' + }); + } + + this.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + if (cap = this.rules.html.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: this.options.sanitize + ? 'paragraph' + : 'html', + pre: cap[1] === 'pre', + text: cap[0] + }); + continue; + } + + // def + if (top && (cap = this.rules.def.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.links[cap[1].toLowerCase()] = { + href: cap[2], + title: cap[3] + }; + continue; + } + + // table (gfm) + if (top && (cap = this.rules.table.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i] + .replace(/^ *\| *| *\| *$/g, '') + .split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // top-level paragraph + if (top && (cap = this.rules.paragraph.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'paragraph', + text: cap[0] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; +}; + +/** + * Inline-Level Grammar + */ + +var inline = { + escape: /^\\([\\`*{}\[\]()#+\-.!_>|])/, + autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, + url: noop, + tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, + link: /^!?\[(inside)\]\(href\)/, + reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, + nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, + strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, + em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + code: /^(`+)([\s\S]*?[^`])\1(?!`)/, + br: /^ {2,}\n(?!\s*$)/, + del: noop, + text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; + +inline.link = replace(inline.link) + ('inside', inline._inside) + ('href', inline._href) + (); + +inline.reflink = replace(inline.reflink) + ('inside', inline._inside) + (); + +/** + * Normal Inline Grammar + */ + +inline.normal = merge({}, inline); + +/** + * Pedantic Inline Grammar + */ + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ +}); + +/** + * GFM Inline Grammar + */ + +inline.gfm = merge({}, inline.normal, { + escape: replace(inline.escape)('])', '~])')(), + url: /^(https?:\/\/[^\s]+[^.,:;"')\]\s])/, + del: /^~{2,}([\s\S]+?)~{2,}/, + text: replace(inline.text) + (']|', '~]|') + ('|', '|https?://|') + () +}); + +/** + * GFM + Line Breaks Inline Grammar + */ + +inline.breaks = merge({}, inline.gfm, { + br: replace(inline.br)('{2,}', '*')(), + text: replace(inline.gfm.text)('{2,}', '*')() +}); + +/** + * Inline Lexer & Compiler + */ + +function InlineLexer(links, options) { + this.options = options || marked.defaults; + this.links = links; + this.rules = inline.normal; + + if (!this.links) { + throw new + Error('Tokens array requires a `links` property.'); + } + + if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; + } + } else if (this.options.pedantic) { + this.rules = inline.pedantic; + } +} + +/** + * Expose Inline Rules + */ + +InlineLexer.rules = inline; + +/** + * Static Lexing/Compiling Method + */ + +InlineLexer.output = function(src, links, opt) { + var inline = new InlineLexer(links, opt); + return inline.output(src); +}; + +/** + * Lexing/Compiling + */ + +InlineLexer.prototype.output = function(src) { + var out = '' + , link + , text + , href + , cap; + + while (src) { + // escape + if (cap = this.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += cap[1]; + continue; + } + + // autolink + if (cap = this.rules.autolink.exec(src)) { + src = src.substring(cap[0].length); + if (cap[2] === '@') { + text = cap[1][6] === ':' + ? this.mangle(cap[1].substring(7)) + : this.mangle(cap[1]); + href = this.mangle('mailto:') + text; + } else { + text = escape(cap[1]); + href = text; + } + out += '' + + text + + ''; + continue; + } + + // url (gfm) + if (cap = this.rules.url.exec(src)) { + src = src.substring(cap[0].length); + text = escape(cap[1]); + href = text; + out += '' + + text + + ''; + continue; + } + + // tag + if (cap = this.rules.tag.exec(src)) { + src = src.substring(cap[0].length); + out += this.options.sanitize + ? escape(cap[0]) + : cap[0]; + continue; + } + + // link + if (cap = this.rules.link.exec(src)) { + src = src.substring(cap[0].length); + out += this.outputLink(cap, { + href: cap[2], + title: cap[3] + }); + continue; + } + + // reflink, nolink + if ((cap = this.rules.reflink.exec(src)) + || (cap = this.rules.nolink.exec(src))) { + src = src.substring(cap[0].length); + link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = this.links[link.toLowerCase()]; + if (!link || !link.href) { + out += cap[0][0]; + src = cap[0].substring(1) + src; + continue; + } + out += this.outputLink(cap, link); + continue; + } + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += '' + + this.output(cap[2] || cap[1]) + + ''; + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += '' + + this.output(cap[2] || cap[1]) + + ''; + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += '' + + escape(cap[2], true) + + ''; + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += '
'; + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += '' + + this.output(cap[1]) + + ''; + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + out += escape(cap[0]); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +/** + * Compile Link + */ + +InlineLexer.prototype.outputLink = function(cap, link) { + if (cap[0][0] !== '!') { + return '' + + this.output(cap[1]) + + ''; + } else { + return ''
+      + escape(cap[1])
+      + ''; + } +}; + +/** + * Mangle Links + */ + +InlineLexer.prototype.mangle = function(text) { + var out = '' + , l = text.length + , i = 0 + , ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; +}; + +/** + * Parsing & Compiling + */ + +function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; +} + +/** + * Static Parse Method + */ + +Parser.parse = function(src, options) { + var parser = new Parser(options); + return parser.parse(src); +}; + +/** + * Parse Loop + */ + +Parser.prototype.parse = function(src) { + this.inline = new InlineLexer(src.links, this.options); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this.tok(); + } + + return out; +}; + +/** + * Next Token + */ + +Parser.prototype.next = function() { + return this.token = this.tokens.pop(); +}; + +/** + * Preview Next Token + */ + +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length-1] || 0; +}; + +/** + * Parse Text Tokens + */ + +Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); +}; + +/** + * Parse Current Token + */ + +Parser.prototype.tok = function() { + switch (this.token.type) { + case 'space': { + return ''; + } + case 'hr': { + return '
\n'; + } + case 'heading': { + return '' + + this.inline.output(this.token.text) + + '\n'; + } + case 'code': { + if (this.options.highlight) { + var code = this.options.highlight(this.token.text, this.token.lang); + if (code != null && code !== this.token.text) { + this.token.escaped = true; + this.token.text = code; + } + } + + if (!this.token.escaped) { + this.token.text = escape(this.token.text, true); + } + + return '
'
+        + this.token.text
+        + '
\n'; + } + case 'table': { + var body = '' + , heading + , i + , row + , cell + , j; + + // header + body += '\n\n'; + for (i = 0; i < this.token.header.length; i++) { + heading = this.inline.output(this.token.header[i]); + body += this.token.align[i] + ? '' + heading + '\n' + : '' + heading + '\n'; + } + body += '\n\n'; + + // body + body += '\n' + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + body += '\n'; + for (j = 0; j < row.length; j++) { + cell = this.inline.output(row[j]); + body += this.token.align[j] + ? '' + cell + '\n' + : '' + cell + '\n'; + } + body += '\n'; + } + body += '\n'; + + return '\n' + + body + + '
\n'; + } + case 'blockquote_start': { + var body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); + } + + return '
\n' + + body + + '
\n'; + } + case 'list_start': { + var type = this.token.ordered ? 'ol' : 'ul' + , body = ''; + + while (this.next().type !== 'list_end') { + body += this.tok(); + } + + return '<' + + type + + '>\n' + + body + + '\n'; + } + case 'list_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.token.type === 'text' + ? this.parseText() + : this.tok(); + } + + return '
  • ' + + body + + '
  • \n'; + } + case 'loose_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.tok(); + } + + return '
  • ' + + body + + '
  • \n'; + } + case 'html': { + return !this.token.pre && !this.options.pedantic + ? this.inline.output(this.token.text) + : this.token.text; + } + case 'paragraph': { + return '

    ' + + this.inline.output(this.token.text) + + '

    \n'; + } + case 'text': { + return '

    ' + + this.parseText() + + '

    \n'; + } + } +}; + +/** + * Helpers + */ + +function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + +function replace(regex, opt) { + regex = regex.source; + opt = opt || ''; + return function self(name, val) { + if (!name) return new RegExp(regex, opt); + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return self; + }; +} + +function noop() {} +noop.exec = noop; + +function merge(obj) { + var i = 1 + , target + , key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; +} + +/** + * Marked + */ + +function marked(src, opt) { + try { + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/chjj/marked.'; + if ((opt || marked.defaults).silent) { + return 'An error occured:\n' + e.message; + } + throw e; + } +} + +/** + * Options + */ + +marked.options = +marked.setOptions = function(opt) { + marked.defaults = opt; + return marked; +}; + +marked.defaults = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + silent: false, + highlight: null +}; + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; + +marked.parse = marked; + +if (typeof module !== 'undefined') { + module.exports = marked; +} else if (typeof define === 'function' && define.amd) { + define(function() { return marked; }); +} else { + this.marked = marked; +} + +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); +}()); diff --git a/system/lib/EpicEditor/js/epiceditor.min.js b/system/lib/EpicEditor/js/epiceditor.min.js new file mode 100644 index 0000000..e664025 --- /dev/null +++ b/system/lib/EpicEditor/js/epiceditor.min.js @@ -0,0 +1,5 @@ +/** + * EpicEditor - An Embeddable JavaScript Markdown Editor (https://github.com/OscarGodson/EpicEditor) + * Copyright (c) 2011-2012, Oscar Godson. (MIT Licensed) + */(function(e,t){function n(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function r(e,t){for(var n in t)t.hasOwnProperty(n)&&(e.style[n]=t[n])}function i(t,n){var r=t,i=null;return e.getComputedStyle?i=document.defaultView.getComputedStyle(r,null).getPropertyValue(n):r.currentStyle&&(i=r.currentStyle[n]),i}function s(e,t,n){var s={},o;if(t==="save"){for(o in n)n.hasOwnProperty(o)&&(s[o]=i(e,o));r(e,n)}else t==="apply"&&r(e,n);return s}function o(e){var t=parseInt(i(e,"border-left-width"),10)+parseInt(i(e,"border-right-width"),10),n=parseInt(i(e,"padding-left"),10)+parseInt(i(e,"padding-right"),10),r=e.offsetWidth,s;return isNaN(t)&&(t=0),s=t+n+r,s}function u(e){var t=parseInt(i(e,"border-top-width"),10)+parseInt(i(e,"border-bottom-width"),10),n=parseInt(i(e,"padding-top"),10)+parseInt(i(e,"padding-bottom"),10),r=parseInt(i(e,"height"),10),s;return isNaN(t)&&(t=0),s=t+n+r,s}function a(e,t,r){r=r||"";var i=t.getElementsByTagName("head")[0],s=t.createElement("link");n(s,{type:"text/css",id:r,rel:"stylesheet",href:e,name:e,media:"screen"}),i.appendChild(s)}function f(e,t,n){e.className=e.className.replace(t,n)}function l(e){return e.contentDocument||e.contentWindow.document}function c(e){var t;return typeof document.body.innerText=="string"?t=e.innerText:(t=e.innerHTML.replace(/
    /gi,"\n"),t=t.replace(/<(?:.|\n)*?>/gm,""),t=t.replace(/</gi,"<"),t=t.replace(/>/gi,">")),t}function h(e,t){return t=t.replace(//g,">"),t=t.replace(/\n/g,"
    "),t=t.replace(/
    \s/g,"
     "),t=t.replace(/\s\s\s/g,"   "),t=t.replace(/\s\s/g,"  "),t=t.replace(/^ /," "),e.innerHTML=t,!0}function p(e){return e.replace(/\u00a0/g," ").replace(/ /g," ")}function d(){var e=-1,t=navigator.userAgent,n;return navigator.appName=="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]{1,}[\.0-9]{0,})/,n.exec(t)!=null&&(e=parseFloat(RegExp.$1,10))),e}function v(){var t=e.navigator;return t.userAgent.indexOf("Safari")>-1&&t.userAgent.indexOf("Chrome")==-1}function m(){var t=e.navigator;return t.userAgent.indexOf("Firefox")>-1&&t.userAgent.indexOf("Seamonkey")==-1}function g(e){var t={};return e&&t.toString.call(e)==="[object Function]"}function y(){var e=arguments[0]||{},n=1,r=arguments.length,i=!1,s,o,u,a;typeof e=="boolean"&&(i=e,e=arguments[1]||{},n=2),typeof e!="object"&&!g(e)&&(e={}),r===n&&(e=this,--n);for(;n=5||Math.abs(g.x-t.pageX)>=5)h.style.display="block",p&&clearTimeout(p),p=e.setTimeout(function(){h.style.display="none"},1e3);g={y:t.pageY,x:t.pageX}}function M(e){e.keyCode==n.settings.shortcut.modifier&&(N=!0),e.keyCode==17&&(C=!0),N===!0&&e.keyCode==n.settings.shortcut.preview&&!n.is("fullscreen")&&(e.preventDefault(),n.is("edit")&&n._previewEnabled?n.preview():n._editEnabled&&n.edit()),N===!0&&e.keyCode==n.settings.shortcut.fullscreen&&n._fullscreenEnabled&&(e.preventDefault(),n._goFullscreen(T)),N===!0&&e.keyCode!==n.settings.shortcut.modifier&&(N=!1),e.keyCode==27&&n.is("fullscreen")&&n._exitFullscreen(T),C===!0&&e.keyCode==83&&(n.save(),e.preventDefault(),C=!1),e.metaKey&&e.keyCode==83&&(n.save(),e.preventDefault())}function _(e){e.keyCode==n.settings.shortcut.modifier&&(N=!1),e.keyCode==17&&(C=!1)}function D(t){var r;t.clipboardData?(t.preventDefault(),r=t.clipboardData.getData("text/plain"),n.editorIframeDocument.execCommand("insertText",!1,r)):e.clipboardData&&(t.preventDefault(),r=e.clipboardData.getData("Text"),r=r.replace(//g,">"),r=r.replace(/\n/g,"
    "),r=r.replace(/\r/g,""),r=r.replace(/
    \s/g,"
     "),r=r.replace(/\s\s\s/g,"   "),r=r.replace(/\s\s/g,"  "),n.editorIframeDocument.selection.createRange().pasteHTML(r))}if(this.is("loaded"))return this;var n=this,o,u,f,c,h,p,m,g={y:-1,x:-1},y,b,w=!1,E=!1,S=!1,x=!1,T,N=!1,C=!1,k,L,A;n._eeState.startup=!0,n.settings.useNativeFullscreen&&(E=document.body.webkitRequestFullScreen?!0:!1,S=document.body.mozRequestFullScreen?!0:!1,x=document.body.requestFullscreen?!0:!1,w=E||S||x),v()&&(w=!1,E=!1),!n.is("edit")&&!n.is("preview")&&(n._eeState.edit=!0),t=t||function(){},o={chrome:'
    '+(n._previewEnabled?' ':"")+(n._editEnabled?' ':"")+(n._fullscreenEnabled?'':"")+"
    "+"
    ",previewer:'
    ',editor:""},n.element.innerHTML='',n.element.style.height=n.element.offsetHeight+"px",u=document.getElementById(n._instanceId),n.iframeElement=u,n.iframe=l(u),n.iframe.open(),n.iframe.write(o.chrome),n.editorIframe=n.iframe.getElementById("epiceditor-editor-frame"),n.previewerIframe=n.iframe.getElementById("epiceditor-previewer-frame"),n.editorIframeDocument=l(n.editorIframe),n.editorIframeDocument.open(),n.editorIframeDocument.write(o.editor),n.editorIframeDocument.close(),n.previewerIframeDocument=l(n.previewerIframe),n.previewerIframeDocument.open(),n.previewerIframeDocument.write(o.previewer),f=n.previewerIframeDocument.createElement("base"),f.target="_blank",n.previewerIframeDocument.getElementsByTagName("head")[0].appendChild(f),n.previewerIframeDocument.close(),n.reflow(),a(n.settings.theme.base,n.iframe,"theme"),a(n.settings.theme.editor,n.editorIframeDocument,"theme"),a(n.settings.theme.preview,n.previewerIframeDocument,"theme"),n.iframe.getElementById("epiceditor-wrapper").style.position="relative",n.editorIframe.style.position="absolute",n.previewerIframe.style.position="absolute",n.editor=n.editorIframeDocument.body,n.previewer=n.previewerIframeDocument.getElementById("epiceditor-preview"),n.editor.contentEditable=!0,n.iframe.body.style.height=this.element.offsetHeight+"px",n.previewerIframe.style.left="-999999px",this.editorIframeDocument.body.style.wordWrap="break-word",d()>-1&&(this.previewer.style.height=parseInt(i(this.previewer,"height"),10)+2),this.open(n.settings.file.name),n.settings.focusOnLoad&&n.iframe.addEventListener("readystatechange",function(){n.iframe.readyState=="complete"&&n.focus()}),n.previewerIframeDocument.addEventListener("click",function(t){var r=t.target,i=n.previewerIframeDocument.body;r.nodeName=="A"&&r.hash&&r.hostname==e.location.hostname&&(t.preventDefault(),r.target="_self",i.querySelector(r.hash)&&(i.scrollTop=i.querySelector(r.hash).offsetTop))}),c=n.iframe.getElementById("epiceditor-utilbar"),y={},n._goFullscreen=function(t){this._fixScrollbars("auto");if(n.is("fullscreen")){n._exitFullscreen(t);return}w&&(E?t.webkitRequestFullScreen():S?t.mozRequestFullScreen():x&&t.requestFullscreen()),b=n.is("edit"),n._eeState.fullscreen=!0,n._eeState.edit=!0,n._eeState.preview=!0;var r=e.innerWidth,o=e.innerHeight,u=e.outerWidth,a=e.outerHeight;w||(a=e.innerHeight),y.editorIframe=s(n.editorIframe,"save",{width:u/2+"px",height:a+"px","float":"left",cssFloat:"left",styleFloat:"left",display:"block",position:"static",left:""}),y.previewerIframe=s(n.previewerIframe,"save",{width:u/2+"px",height:a+"px","float":"right",cssFloat:"right",styleFloat:"right",display:"block",position:"static",left:""}),y.element=s(n.element,"save",{position:"fixed",top:"0",left:"0",width:"100%","z-index":"9999",zIndex:"9999",border:"none",margin:"0",background:i(n.editor,"background-color"),height:o+"px"}),y.iframeElement=s(n.iframeElement,"save",{width:u+"px",height:o+"px"}),c.style.visibility="hidden",w||(document.body.style.overflow="hidden"),n.preview(),n.focus(),n.emit("fullscreenenter")},n._exitFullscreen=function(e){this._fixScrollbars(),s(n.element,"apply",y.element),s(n.iframeElement,"apply",y.iframeElement),s(n.editorIframe,"apply",y.editorIframe),s(n.previewerIframe,"apply",y.previewerIframe),n.element.style.width=n._eeState.reflowWidth?n._eeState.reflowWidth:"",n.element.style.height=n._eeState.reflowHeight?n._eeState.reflowHeight:"",c.style.visibility="visible",n._eeState.fullscreen=!1,w?E?document.webkitCancelFullScreen():S?document.mozCancelFullScreen():x&&document.exitFullscreen():document.body.style.overflow="auto",b?n.edit():n.preview(),n.reflow(),n.emit("fullscreenexit")},n.editor.addEventListener("keyup",function(){m&&e.clearTimeout(m),m=e.setTimeout(function(){n.is("fullscreen")&&n.preview()},250)}),T=n.iframeElement,c.addEventListener("click",function(e){var t=e.target.className;t.indexOf("epiceditor-toggle-preview-btn")>-1?n.preview():t.indexOf("epiceditor-toggle-edit-btn")>-1?n.edit():t.indexOf("epiceditor-fullscreen-btn")>-1&&n._goFullscreen(T)}),E?document.addEventListener("webkitfullscreenchange",function(){!document.webkitIsFullScreen&&n._eeState.fullscreen&&n._exitFullscreen(T)},!1):S?document.addEventListener("mozfullscreenchange",function(){!document.mozFullScreen&&n._eeState.fullscreen&&n._exitFullscreen(T)},!1):x&&document.addEventListener("fullscreenchange",function(){document.fullscreenElement==null&&n._eeState.fullscreen&&n._exitFullscreen(T)},!1),h=n.iframe.getElementById("epiceditor-utilbar"),n.settings.button.bar!==!0&&(h.style.display="none"),h.addEventListener("mouseover",function(){p&&clearTimeout(p)}),k=[n.previewerIframeDocument,n.editorIframeDocument];for(L=0;Li&&(n=i,a=!0),a?this._fixScrollbars("auto"):this._fixScrollbars("hidden"),n!=this.oldHeight&&(this.getElement("container").style.height=n+"px",this.reflow(),this.settings.autogrow.scroll&&e.scrollBy(0,n-this.oldHeight),this.oldHeight=n))},b.prototype._fixScrollbars=function(e){var t;this.settings.autogrow?t="hidden":t="auto",t=e||t,this.getElement("editor").documentElement.style.overflow=t,this.getElement("previewer").documentElement.style.overflow=t},b.version="0.2.2",b._data={},e.EpicEditor=b})(window),function(){function t(t){this.tokens=[],this.tokens.links={},this.options=t||f.defaults,this.rules=e.normal,this.options.gfm&&(this.options.tables?this.rules=e.tables:this.rules=e.gfm)}function r(e,t){this.options=t||f.defaults,this.links=e,this.rules=n.normal;if(!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=n.breaks:this.rules=n.gfm:this.options.pedantic&&(this.rules=n.pedantic)}function i(e){this.tokens=[],this.token=null,this.options=e||f.defaults}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function o(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function a(e){var t=1,n,r;for(;t[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *([^\s]+)(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^([^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+\n*/,text:/^[^\n]+/};e.bullet=/(?:[*+-]|\d+\.)/,e.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,e.item=o(e.item,"gm")(/bull/g,e.bullet)(),e.list=o(e.list)(/bull/g,e.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)(),e._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b",e.html=o(e.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,e._tag)(),e.paragraph=o(e.paragraph)("hr",e.hr)("heading",e.heading)("lheading",e.lheading)("blockquote",e.blockquote)("tag","<"+e._tag)("def",e.def)(),e.normal=a({},e),e.gfm=a({},e.normal,{fences:/^ *(`{3,}|~{3,}) *(\w+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),e.gfm.paragraph=o(e.paragraph)("(?!","(?!"+e.gfm.fences.source.replace("\\1","\\2")+"|")(),e.tables=a({},e.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=e,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t){var e=e.replace(/^ +$/gm,""),n,r,i,s,o,u,a;while(e){if(i=this.rules.newline.exec(e))e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"});if(i=this.rules.code.exec(e)){e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});continue}if(i=this.rules.fences.exec(e)){e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});continue}if(i=this.rules.heading.exec(e)){e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});continue}if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length),s={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")};for(u=0;u ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});continue}if(i=this.rules.list.exec(e)){e=e.substring(i[0].length),this.tokens.push({type:"list_start",ordered:isFinite(i[2])}),i=i[0].match(this.rules.item),n=!1,a=i.length,u=0;for(;u|])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=o(n.link)("inside",n._inside)("href",n._href)(),n.reflink=o(n.reflink)("inside",n._inside)(),n.normal=a({},n),n.pedantic=a({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=a({},n.normal,{escape:o(n.escape)("])","~])")(),url:/^(https?:\/\/[^\s]+[^.,:;"')\]\s])/,del:/^~{2,}([\s\S]+?)~{2,}/,text:o(n.text)("]|","~]|")("|","|https?://|")()}),n.breaks=a({},n.gfm,{br:o(n.br)("{2,}","*")(),text:o(n.gfm.text)("{2,}","*")()}),r.rules=n,r.output=function(e,t,n){var i=new r(t,n);return i.output(e)},r.prototype.output=function(e){var t="",n,r,i,o;while(e){if(o=this.rules.escape.exec(e)){e=e.substring(o[0].length),t+=o[1];continue}if(o=this.rules.autolink.exec(e)){e=e.substring(o[0].length),o[2]==="@"?(r=o[1][6]===":"?this.mangle(o[1].substring(7)):this.mangle(o[1]),i=this.mangle("mailto:")+r):(r=s(o[1]),i=r),t+=''+r+"";continue}if(o=this.rules.url.exec(e)){e=e.substring(o[0].length),r=s(o[1]),i=r,t+=''+r+"";continue}if(o=this.rules.tag.exec(e)){e=e.substring(o[0].length),t+=this.options.sanitize?s(o[0]):o[0];continue}if(o=this.rules.link.exec(e)){e=e.substring(o[0].length),t+=this.outputLink(o,{href:o[2],title:o[3]});continue}if((o=this.rules.reflink.exec(e))||(o=this.rules.nolink.exec(e))){e=e.substring(o[0].length),n=(o[2]||o[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()];if(!n||!n.href){t+=o[0][0],e=o[0].substring(1)+e;continue}t+=this.outputLink(o,n);continue}if(o=this.rules.strong.exec(e)){e=e.substring(o[0].length),t+=""+this.output(o[2]||o[1])+"";continue}if(o=this.rules.em.exec(e)){e=e.substring(o[0].length),t+=""+this.output(o[2]||o[1])+"";continue}if(o=this.rules.code.exec(e)){e=e.substring(o[0].length),t+=""+s(o[2],!0)+"";continue}if(o=this.rules.br.exec(e)){e=e.substring(o[0].length),t+="
    ";continue}if(o=this.rules.del.exec(e)){e=e.substring(o[0].length),t+=""+this.output(o[1])+"";continue}if(o=this.rules.text.exec(e)){e=e.substring(o[0].length),t+=s(o[0]);continue}if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}return t},r.prototype.outputLink=function(e,t){return e[0][0]!=="!"?'"+this.output(e[1])+"":''+s(e[1])+'"},r.prototype.mangle=function(e){var t="",n=e.length,r=0,i;for(;r.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t},i.parse=function(e,t){var n=new i(t);return n.parse(e)},i.prototype.parse=function(e){this.inline=new r(e.links,this.options),this.tokens=e.reverse();var t="";while(this.next())t+=this.tok();return t},i.prototype.next=function(){return this.token=this.tokens.pop()},i.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},i.prototype.parseText=function(){var e=this.token.text;while(this.peek().type==="text")e+="\n"+this.next().text;return this.inline.output(e)},i.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return"
    \n";case"heading":return""+this.inline.output(this.token.text)+"\n";case"code":if(this.options.highlight){var e=this.options.highlight(this.token.text,this.token.lang);e!=null&&e!==this.token.text&&(this.token.escaped=!0,this.token.text=e)}return this.token.escaped||(this.token.text=s(this.token.text,!0)),"
    "+this.token.text+"
    \n";case"table":var t="",n,r,i,o,u;t+="\n\n";for(r=0;r'+n+"\n":""+n+"\n";t+="\n\n",t+="\n";for(r=0;r\n";for(u=0;u'+o+"\n":""+o+"\n";t+="\n"}return t+="\n","\n"+t+"
    \n";case"blockquote_start":var t="";while(this.next().type!=="blockquote_end" +)t+=this.tok();return"
    \n"+t+"
    \n";case"list_start":var a=this.token.ordered?"ol":"ul",t="";while(this.next().type!=="list_end")t+=this.tok();return"<"+a+">\n"+t+"\n";case"list_item_start":var t="";while(this.next().type!=="list_item_end")t+=this.token.type==="text"?this.parseText():this.tok();return"
  • "+t+"
  • \n";case"loose_item_start":var t="";while(this.next().type!=="list_item_end")t+=this.tok();return"
  • "+t+"
  • \n";case"html":return!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;case"paragraph":return"

    "+this.inline.output(this.token.text)+"

    \n";case"text":return"

    "+this.parseText()+"

    \n"}},u.exec=u,f.options=f.setOptions=function(e){return f.defaults=e,f},f.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,silent:!1,highlight:null},f.Parser=i,f.parser=i.parse,f.Lexer=t,f.lexer=t.lex,f.InlineLexer=r,f.inlineLexer=r.output,f.parse=f,typeof module!="undefined"?module.exports=f:typeof define=="function"&&define.amd?define(function(){return f}):this.marked=f}.call(function(){return this||(typeof window!="undefined"?window:global)}()); \ No newline at end of file diff --git a/system/lib/EpicEditor/themes/base/epiceditor.css b/system/lib/EpicEditor/themes/base/epiceditor.css new file mode 100644 index 0000000..76e58fc --- /dev/null +++ b/system/lib/EpicEditor/themes/base/epiceditor.css @@ -0,0 +1,70 @@ +html, body, iframe, div { + margin:0; + padding:0; +} + +#epiceditor-utilbar { + position:fixed; + bottom:10px; + right:10px; +} + +#epiceditor-utilbar button { + display:block; + float:left; + width:30px; + height:30px; + border:none; + background:none; +} + +#epiceditor-utilbar button.epiceditor-toggle-preview-btn { + background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAf9JREFUeNrsVu1twjAQLZmAEcIGYYKGDWACkgkSkPiQ+CifAoEgyQTQDegEpROQDZoRMgH0HToj1yIglKr90Vg62T6f/e4d9gu50+n09BctlwFnwP8TOAgCA10VRr2ZELaHhbBXx3HCVMC+71voXmD6g4Qi2NB13e1DwAAkZhtmmKYRcxsJhHeBPc8bMMufbDU0PxF4vV4TSyth8477csI6lTV/a71er9tioonBarXaIAmLErliNWyqoM8nrJPpHFNLWLcI4xvj5XKpMo2ZgcvzIvs+75S0wKwPPB/CnpWXsG00Gra2WCwshekOVoC9Sb6IGN1ge2HNsWK+B0iJqxAL5oSpYeDJJW02mxVYLAWSGfDtebylA68Bc4wh+ahK5PcxLh6PR5GUpym/iTOfz89PqNVqhRI4iQf1/o174HNMVYDSGeTDmXQ3znogCGrtdpsYVBhER1aH2Wzm8iE7UR74DMTWGNxUQWmNYqTEzq8APoo9sJ8wKoR5eU7T6VQVjZAvx4YvDJWt1Ol0QsTqkppF8EW8/12OhTnSpT2LCe2/KiCTyUQVkJgPuwgb6XG32w05Xui4q0imLLNDxA/uSuZ4PNaZqZlSsejDYfd6veihj8RoNDK5XOUHAen3Dfr9/j7VZxEJ6AwuxCCvhMTM7oNAARhl/0Ay4Az419qXAAMAfBdK7281j6YAAAAASUVORK5CYII=); +} + +#epiceditor-utilbar button.epiceditor-toggle-edit-btn { + background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnVJREFUeNrsV+lt4lAQNtEWAB2QCtZ0ABWsqYB1BU5AgDgkQOISl9cV4FQQtgLYCuKtIN4K4gogM9H3pMmLTTh24c+O9An7+XnOb8aP1G63M64hN8aV5GqGvxyyyfO8Y3S6hDtc2wTfcZyLRPwdvxEbPSviIwjIRtO49s9ONSRLMIGvwkBI+EPYEEqyQmcZdl2Xo3BgcJ90xPUGDh1veLFYWCBK9oQ6P4BgiXVO6fUjg5zCJcE6kVxsLEN4QTlWzO5yuRwlGp7P55zOxz1RRqK2SfKD8BvOG4IHxUqlEnxop9lsZpITa0KWndGwIeQIXswzHbynpK2xzjXbeBfxdDrlhbUWjYyuiJS9fBJxgL3PItKsprNQrVaD1GQyYUVP2oYelDziPoPnT5+k2QajleEC3usI/exM7oYiXor0hpxS8qhLv5FIVVrcBwkp5ueclbS27qNMvkj7kg3nZX1qtVqAaSUN5OGUwn2M4RUb3263plh700E6I7wTKn1suCAW3PF4zL1r1Ov1SBhXZLEJFqGTQCq5N1BZIp3s+DOi5fXcG7lGo1Ea5DIFSWzcq7a4R6uYqJmlkSqHoeGKeq+w905MtGKj0Yje9TE5ID9pqictQQwmXTfh82cIJ0NML0d0QY8MdhMn13A4zENB0hAJEYn6EnGL3MZ0hsyG3Ww2g70jU8lgMOhqHicJz+KfovVkz3J5/FardfhBgDZzS90SeoJ8cXjQJlUAEmZUCx30kYiTfr9vgFRc72+ChCHSzNH+Qgk+fA7b7fZZJ5AAiIRhT4zUv3/Y07LiaPW9yPE2L5jrI/p/d7wVEZe0U8bJkvr/F+ZS8irAAIorRozUvI0gAAAAAElFTkSuQmCC); +} + +#epiceditor-utilbar button.epiceditor-fullscreen-btn { + background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAY5JREFUeNrsV8tthDAQhYgCtoV04BKghK2En5AQBw4IITjwq2RLgBJcwpawHZAxMpGDYGwTFPaQkUbG1sybj58NmNM0GVfIh3GRXBbYEid932N9d1zXHWWAGAb4m+9VsUA0H5SubKkKIGA4qyUC2qKBxSCe541HKln7dV2nVbHRtq0Nw7CXGNtz/jzwqjZ5odtqTOagQRC82KRpGkcS/L2Ok7lXZV3Xp7Q6DMNR2mqNthMhKXLqzcUCc6Wgn3wU1wlX1PboHs8tjaLoyVtLT7JFK2ZZM6CZvWyE+X1Voaj3la3DMA63epGqqm4wfyCBH8xmz1+Z1WVZ2vyqU2HvHtv9OI4PsRpjL91YV2a7pcB8onmOifYFUhSFLQCTnQtkDpokyYv73JBtcAQsA3zGTXJBEgNXgrF3CcrBZGwnC+4uqxHnH+zN8/ybvexZwvZNhlsHbrt5CyCgDtu1XosUe58K4kuOF9EKnKYp20eVrxDUJssyreM0bDg4kIw0EfCbftvqQ6KKYf7/wvyVfAkwAMjqoFSaWbrBAAAAAElFTkSuQmCC); +} + +@media +only screen and (-webkit-min-device-pixel-ratio: 2), +only screen and ( min--moz-device-pixel-ratio: 2), +only screen and ( -o-min-device-pixel-ratio: 2/1), +only screen and ( min-device-pixel-ratio: 2), +only screen and ( min-resolution: 192dpi), +only screen and ( min-resolution: 2dppx) { + #epiceditor-utilbar button.epiceditor-toggle-preview-btn { + background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABrVBMVEWIiIiHh4eIiIiJiYmEhISEhISEhISMjIyNjY2MjIyNjY2MjIyFhYWDg4OFhYWKioqKioqBgYGJiYmJiYmJiYmKioqKioqFhYWIiIiJiYmIiIiJiYmIiIiGhoaIiIiGhoaIiIiHh4eHh4eGhoaFhYWKioqFhYWEhISFhYWEhISDg4ONjY2NjY2MjIyHh4eMjIyLi4uCgoKCgoKCgoKBgYGBgYGOjo6Ojo6BgYGPj4+Ojo6Hh4eNjY2Pj4+BgYGNjY2BgYGHh4eQkJCNjY2FhYWHh4eDg4OQkJCQkJCAgICCgoKAgICAgICQkJCQkJCQkJCAgICQkJCAgICQkJCFhYWHh4eHh4eGhoaKioqGhoaMjIyDg4OEhISDg4OEhISDg4OEhISKioqBgYGJiYmKioqKioqJiYmMjIyEhISCgoKGhoaLi4uPj4+Pj4+BgYGKioqDg4OGhoaGhoaMjIyHh4eEhISEhISDg4OIiIiJiYmGhoaHh4eJiYkAAACAgICFhYWQkJCIiIiEhISLi4uDg4OHh4eGhoaCgoKBgYGJiYmMjIyOjo6KioqNjY2Pj4+o6Lr0AAAAfnRSTlPfvxDPEL8gv5/Pr3AQ3++vn8+/cCCA34/vj8/vMJ+vgJ+vYN/fMIBAv4/v38/v39+PgBBg74DPgGAwMHDvrzBQj1AggJ8wIHC/IM9gjxBQgO+vv89Qz0C/70Bgz89ggIDvYN/fII8wIHDvMJ+/QBBAMBDPnxBgML9AEI/vQACT8cYwAAACXElEQVR42u2WV1caURRGJ73H9J7YW+y99957ARREURAFQRFEOFGMkybxN+eec2cWUwBnrTwli/1yvvnm7PvEuoMAf0FGzsj/nDwxOTUzdyoxNzM1OWFU7h0aPtUxPNRrQPZ0XKagw3OF7Nm9TMOuJ43cQmpavSWV3HRhgKakcmvjhSEaW/VyV/tvg7R3aeU+9ULZ/fLEQ/ndMvXbPrV88EvBvQdOMCsLMzjNd5TFgSTr3SpWOCuUTYWTVVV6m+Sdr0qqqVGxw6pqXUPyZlziFaU9Vi3HVSyzag+D/YlcbXLZLm+85AsOgMK4hkIABz/YkSVVdpS3fnKevQCIYgCcGqKslGd0g3dbIIR5fP8cZCkMdOANWeSLEJZklt5StxEWcmLIuw+AHGE+YiEWE67jGxnlO8xv8OGTEBGRRSACmNtYyBUjgcCCKJPLqjYMAeD04ENEGIjQ7AGikuUFNhdF8Vogj0T5bDyqEjh55AwI4N7/hmRTe4zRxEM+ZuKYFSYeEP9HzPtuEFjm9pKf9W5KQLbKhSVMbkymfHL90i+s/wR5PM9iCaYiLOcLTogCrKEIYwkLD19T25/4bR+unSG3bkOQwiG1QZfV6gryBaqL5c01XCCZ9lbOCOvNUpouUOGishSK+dpKUHMZ2M6Jz7ZHNEO+hOoLUWVZZROx6a8hn+VcRWh1EOtBUuhcPiy+pBdg3fZ3DaOj2ma7LtXVW1uj0XVqTW2aS9/bUP8jJfUN3is+N97mp8nV9Wavka9kZ/e6zuzuNP59Hhkbn53+QkzPjo+NZP6TZOSM/L/LfwAJ69Ba3fXmtwAAAABJRU5ErkJggg==); + background-size: 30px 30px; + } + + #epiceditor-utilbar button.epiceditor-toggle-edit-btn { + background:url(data:image/png;base64,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); + background-size: 30px 30px; + } + + #epiceditor-utilbar button.epiceditor-fullscreen-btn { + background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAAA5FBMVEWPj4+JiYmJiYmCgoKGhoaPj4+Li4uEhISAgICNjY2Li4uNjY2QkJCFhYWEhISLi4uHh4eHh4eIiIiHh4eGhoaHh4eEhISOjo6EhISJiYmFhYWJiYmFhYWNjY2NjY2Hh4eOjo6CgoKGhoaKioqKioqJiYmKioqDg4ODg4OBgYGGhoaKioqKioqLi4uMjIyMjIyIiIiIiIiMjIyOjo6GhoaDg4ONjY2EhISPj4+CgoIAAACJiYmHh4eIiIiFhYWCgoKPj4+Li4uAgICKioqEhISGhoaBgYGOjo6MjIyQkJCNjY2Dg4O2Jy/OAAAAO3RSTlMQz0DPEHDPz0DvMDBAQBBAQBAQz88wMM/v7zAw788Q7xAQQM9AEBDPEEAwMO/v7zDvMEBA70BAQEBAAAENmbYAAAG1SURBVHja7dftM0JREMdxD5GkEEqKpBJRSc8rQq7Q////2Dnm3t85jtkTmmGG75t7Z3c/t9fN0Tf6x1/Dz0ZrZGZf/BJ8a9QjM/vCwks9Px5aBcslC+P3nPVmi8dcczrcHHM2flug1CHRYcoYNd0YFlrAL1yHqPOC9g9IdbAfjHAjYFjoT+FI1MfRiAM/cZdEl0+oVidVvRaMcAOMgJWGBUYSVhrWjdfvjKqrq1Vzsu7Cy1Vo7XXZhYuj0ahwfHY+sjo/Oy7woyhitkTQsESsZawstG6VlvDCfIlUmfSVVjpDqtL8goBLbKFhsRcwalxcB100CDkxLLQbJxKwpvb3At7Y2iRuJzd4V26HuM2tDQkPWMOamu1Awkeetx2qtDy/lvZaCW173pGIWetA/xBbF+ZgiVgjGcdutLJ7xO1l9VnMiWGhJdzl4vx4CNpN+ifJXUy7RPEuZ2C1AIY1NG5kHI4Dx8MynnBtovYkqHzi25OyP8ONiKFh3djQsCIecn2i/lBvMU+UXxwi3HyE832jvD0RsLuP8CN3Oh0+feRmixE+g7CdLb43WiEz++Jb+M//x/gB/ArCl0G4nsFuEQAAAABJRU5ErkJggg==); + background-size: 30px 30px; + } +} + +#epiceditor-utilbar button:last-child { + margin-left:15px; +} + +#epiceditor-utilbar button:hover { + cursor:pointer; +} + +.epiceditor-edit-mode #epiceditor-utilbar button.epiceditor-toggle-edit-btn { + display:none; +} + +.epiceditor-preview-mode #epiceditor-utilbar button.epiceditor-toggle-preview-btn { + display:none; +} diff --git a/system/lib/EpicEditor/themes/editor/epic-dark.css b/system/lib/EpicEditor/themes/editor/epic-dark.css new file mode 100644 index 0000000..058ace6 --- /dev/null +++ b/system/lib/EpicEditor/themes/editor/epic-dark.css @@ -0,0 +1,13 @@ +html { padding:10px; } + +body { + border:0; + background:rgb(41,41,41); + font-family:monospace; + font-size:14px; + padding:10px; + color:#ddd; + line-height:1.35em; + margin:0; + padding:0; +} diff --git a/system/lib/EpicEditor/themes/editor/epic-light.css b/system/lib/EpicEditor/themes/editor/epic-light.css new file mode 100644 index 0000000..9411cec --- /dev/null +++ b/system/lib/EpicEditor/themes/editor/epic-light.css @@ -0,0 +1,12 @@ +html { padding:10px; } + +body { + border:0; + background:#fcfcfc; + font-family:monospace; + font-size:14px; + padding:10px; + line-height:1.35em; + margin:0; + padding:0; +} diff --git a/system/lib/EpicEditor/themes/preview/bartik.css b/system/lib/EpicEditor/themes/preview/bartik.css new file mode 100644 index 0000000..2ffb6d5 --- /dev/null +++ b/system/lib/EpicEditor/themes/preview/bartik.css @@ -0,0 +1,167 @@ +body { + font-family: Georgia, "Times New Roman", Times, serif; + line-height: 1.5; + font-size: 87.5%; + word-wrap: break-word; + margin: 2em; + padding: 0; + border: 0; + outline: 0; + background: #fff; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 1.0em 0 0.5em; + font-weight: inherit; +} + +h1 { + font-size: 1.357em; + color: #000; +} + +h2 { + font-size: 1.143em; +} + +p { + margin: 0 0 1.2em; +} + +del { + text-decoration: line-through; +} + +tr:nth-child(odd) { + background-color: #dddddd; +} + +img { + outline: 0; +} + +code { + background-color: #f2f2f2; + background-color: rgba(40, 40, 0, 0.06); +} + +pre { + background-color: #f2f2f2; + background-color: rgba(40, 40, 0, 0.06); + margin: 10px 0; + overflow: hidden; + padding: 15px; + white-space: pre-wrap; +} + +pre code { + font-size: 100%; + background-color: transparent; +} + +blockquote { + background: #f7f7f7; + border-left: 1px solid #bbb; + font-style: italic; + margin: 1.5em 10px; + padding: 0.5em 10px; +} + +blockquote:before { + color: #bbb; + content: "\201C"; + font-size: 3em; + line-height: 0.1em; + margin-right: 0.2em; + vertical-align: -.4em; +} + +blockquote:after { + color: #bbb; + content: "\201D"; + font-size: 3em; + line-height: 0.1em; + vertical-align: -.45em; +} + +blockquote > p:first-child { + display: inline; +} + +table { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + border: 0; + border-spacing: 0; + font-size: 0.857em; + margin: 10px 0; + width: 100%; +} + +table table { + font-size: 1em; +} + +table tr th { + background: #757575; + background: rgba(0, 0, 0, 0.51); + border-bottom-style: none; +} + +table tr th, +table tr th a, +table tr th a:hover { + color: #FFF; + font-weight: bold; +} + +table tbody tr th { + vertical-align: top; +} + +tr td, +tr th { + padding: 4px 9px; + border: 1px solid #fff; + text-align: left; /* LTR */ +} + +tr:nth-child(odd) { + background: #e4e4e4; + background: rgba(0, 0, 0, 0.105); +} + +tr, +tr:nth-child(even) { + background: #efefef; + background: rgba(0, 0, 0, 0.063); +} + +a { + color: #0071B3; +} + +a:hover, +a:focus { + color: #018fe2; +} + +a:active { + color: #23aeff; +} + +a:link, +a:visited { + text-decoration: none; +} + +a:hover, +a:active, +a:focus { + text-decoration: underline; +} + diff --git a/system/lib/EpicEditor/themes/preview/github.css b/system/lib/EpicEditor/themes/preview/github.css new file mode 100644 index 0000000..4c78db4 --- /dev/null +++ b/system/lib/EpicEditor/themes/preview/github.css @@ -0,0 +1,368 @@ +html { padding:0 10px; } + +body { + margin:0; + padding:0; + background:#fff; +} + +#epiceditor-wrapper{ + background:white; +} + +#epiceditor-preview{ + padding-top:10px; + padding-bottom:10px; + font-family: Helvetica,arial,freesans,clean,sans-serif; + font-size:13px; + line-height:1.6; +} + +#epiceditor-preview>*:first-child{ + margin-top:0!important; +} + +#epiceditor-preview>*:last-child{ + margin-bottom:0!important; +} + +#epiceditor-preview a{ + color:#4183C4; + text-decoration:none; +} + +#epiceditor-preview a:hover{ + text-decoration:underline; +} + +#epiceditor-preview h1, +#epiceditor-preview h2, +#epiceditor-preview h3, +#epiceditor-preview h4, +#epiceditor-preview h5, +#epiceditor-preview h6{ + margin:20px 0 10px; + padding:0; + font-weight:bold; + -webkit-font-smoothing:antialiased; +} + +#epiceditor-preview h1 tt, +#epiceditor-preview h1 code, +#epiceditor-preview h2 tt, +#epiceditor-preview h2 code, +#epiceditor-preview h3 tt, +#epiceditor-preview h3 code, +#epiceditor-preview h4 tt, +#epiceditor-preview h4 code, +#epiceditor-preview h5 tt, +#epiceditor-preview h5 code, +#epiceditor-preview h6 tt, +#epiceditor-preview h6 code{ + font-size:inherit; +} + +#epiceditor-preview h1{ + font-size:28px; + color:#000; +} + +#epiceditor-preview h2{ + font-size:24px; + border-bottom:1px solid #ccc; + color:#000; +} + +#epiceditor-preview h3{ + font-size:18px; +} + +#epiceditor-preview h4{ + font-size:16px; +} + +#epiceditor-preview h5{ + font-size:14px; +} + +#epiceditor-preview h6{ + color:#777; + font-size:14px; +} + +#epiceditor-preview p, +#epiceditor-preview blockquote, +#epiceditor-preview ul, +#epiceditor-preview ol, +#epiceditor-preview dl, +#epiceditor-preview li, +#epiceditor-preview table, +#epiceditor-preview pre{ + margin:15px 0; +} + +#epiceditor-preview hr{ + background:transparent url('../../images/modules/pulls/dirty-shade.png') repeat-x 0 0; + border:0 none; + color:#ccc; + height:4px; + padding:0; +} + +#epiceditor-preview>h2:first-child, +#epiceditor-preview>h1:first-child, +#epiceditor-preview>h1:first-child+h2, +#epiceditor-preview>h3:first-child, +#epiceditor-preview>h4:first-child, +#epiceditor-preview>h5:first-child, +#epiceditor-preview>h6:first-child{ + margin-top:0; + padding-top:0; +} + +#epiceditor-preview h1+p, +#epiceditor-preview h2+p, +#epiceditor-preview h3+p, +#epiceditor-preview h4+p, +#epiceditor-preview h5+p, +#epiceditor-preview h6+p{ + margin-top:0; +} + +#epiceditor-preview li p.first{ + display:inline-block; +} + +#epiceditor-preview ul, +#epiceditor-preview ol{ + padding-left:30px; +} + +#epiceditor-preview ul li>:first-child, +#epiceditor-preview ol li>:first-child{ + margin-top:0; +} + +#epiceditor-preview ul li>:last-child, +#epiceditor-preview ol li>:last-child{ + margin-bottom:0; +} + +#epiceditor-preview dl{ + padding:0; +} + +#epiceditor-preview dl dt{ + font-size:14px; + font-weight:bold; + font-style:italic; + padding:0; + margin:15px 0 5px; +} + +#epiceditor-preview dl dt:first-child{ + padding:0; +} + +#epiceditor-preview dl dt>:first-child{ + margin-top:0; +} + +#epiceditor-preview dl dt>:last-child{ + margin-bottom:0; +} + +#epiceditor-preview dl dd{ + margin:0 0 15px; + padding:0 15px; +} + +#epiceditor-preview dl dd>:first-child{ + margin-top:0; +} + +#epiceditor-preview dl dd>:last-child{ + margin-bottom:0; +} + +#epiceditor-preview blockquote{ + border-left:4px solid #DDD; + padding:0 15px; + color:#777; +} + +#epiceditor-preview blockquote>:first-child{ + margin-top:0; +} + +#epiceditor-preview blockquote>:last-child{ + margin-bottom:0; +} + +#epiceditor-preview table{ + padding:0; + border-collapse: collapse; + border-spacing: 0; + font-size: 100%; + font: inherit; +} + +#epiceditor-preview table tr{ + border-top:1px solid #ccc; + background-color:#fff; + margin:0; + padding:0; +} + +#epiceditor-preview table tr:nth-child(2n){ + background-color:#f8f8f8; +} + +#epiceditor-preview table tr th{ + font-weight:bold; +} + +#epiceditor-preview table tr th, +#epiceditor-preview table tr td{ + border:1px solid #ccc; + text-align:left; + margin:0; + padding:6px 13px; +} + +#epiceditor-preview table tr th>:first-child, +#epiceditor-preview table tr td>:first-child{ + margin-top:0; +} + +#epiceditor-preview table tr th>:last-child, +#epiceditor-preview table tr td>:last-child{ + margin-bottom:0; +} + +#epiceditor-preview img{ + max-width:100%; +} + +#epiceditor-preview span.frame{ + display:block; + overflow:hidden; +} + +#epiceditor-preview span.frame>span{ + border:1px solid #ddd; + display:block; + float:left; + overflow:hidden; + margin:13px 0 0; + padding:7px; + width:auto; +} + +#epiceditor-preview span.frame span img{ + display:block; + float:left; +} + +#epiceditor-preview span.frame span span{ + clear:both; + color:#333; + display:block; + padding:5px 0 0; +} + +#epiceditor-preview span.align-center{ + display:block; + overflow:hidden; + clear:both; +} + +#epiceditor-preview span.align-center>span{ + display:block; + overflow:hidden; + margin:13px auto 0; + text-align:center; +} + +#epiceditor-preview span.align-center span img{ + margin:0 auto; + text-align:center; +} + +#epiceditor-preview span.align-right{ + display:block; + overflow:hidden; + clear:both; +} + +#epiceditor-preview span.align-right>span{ + display:block; + overflow:hidden; + margin:13px 0 0; + text-align:right; +} + +#epiceditor-preview span.align-right span img{ + margin:0; + text-align:right; +} + +#epiceditor-preview span.float-left{ + display:block; + margin-right:13px; + overflow:hidden; + float:left; +} + +#epiceditor-preview span.float-left span{ + margin:13px 0 0; +} + +#epiceditor-preview span.float-right{ + display:block; + margin-left:13px; + overflow:hidden; + float:right; +} + +#epiceditor-preview span.float-right>span{ + display:block; + overflow:hidden; + margin:13px auto 0; + text-align:right; +} + +#epiceditor-preview code, +#epiceditor-preview tt{ + margin:0 2px; + padding:0 5px; + white-space:nowrap; + border:1px solid #eaeaea; + background-color:#f8f8f8; + border-radius:3px; +} + +#epiceditor-preview pre>code{ + margin:0; + padding:0; + white-space:pre; + border:none; + background:transparent; +} + +#epiceditor-preview .highlight pre, +#epiceditor-preview pre{ + background-color:#f8f8f8; + border:1px solid #ccc; + font-size:13px; + line-height:19px; + overflow:auto; + padding:6px 10px; + border-radius:3px; +} + +#epiceditor-preview pre code, +#epiceditor-preview pre tt{ + background-color:transparent; + border:none; +} diff --git a/system/lib/EpicEditor/themes/preview/preview-dark.css b/system/lib/EpicEditor/themes/preview/preview-dark.css new file mode 100644 index 0000000..620c193 --- /dev/null +++ b/system/lib/EpicEditor/themes/preview/preview-dark.css @@ -0,0 +1,121 @@ +html { padding:0 10px; } + +body { + margin:0; + padding:10px 0; + background:#000; +} + +#epiceditor-preview h1, +#epiceditor-preview h2, +#epiceditor-preview h3, +#epiceditor-preview h4, +#epiceditor-preview h5, +#epiceditor-preview h6, +#epiceditor-preview p, +#epiceditor-preview blockquote { + margin: 0; + padding: 0; +} +#epiceditor-preview { + background:#000; + font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif; + font-size: 13px; + line-height: 18px; + color: #ccc; +} +#epiceditor-preview a { + color: #fff; +} +#epiceditor-preview a:hover { + color: #00ff00; + text-decoration: none; +} +#epiceditor-preview a img { + border: none; +} +#epiceditor-preview p { + margin-bottom: 9px; +} +#epiceditor-preview h1, +#epiceditor-preview h2, +#epiceditor-preview h3, +#epiceditor-preview h4, +#epiceditor-preview h5, +#epiceditor-preview h6 { + color: #cdcdcd; + line-height: 36px; +} +#epiceditor-preview h1 { + margin-bottom: 18px; + font-size: 30px; +} +#epiceditor-preview h2 { + font-size: 24px; +} +#epiceditor-preview h3 { + font-size: 18px; +} +#epiceditor-preview h4 { + font-size: 16px; +} +#epiceditor-preview h5 { + font-size: 14px; +} +#epiceditor-preview h6 { + font-size: 13px; +} +#epiceditor-preview hr { + margin: 0 0 19px; + border: 0; + border-bottom: 1px solid #ccc; +} +#epiceditor-preview blockquote { + padding: 13px 13px 21px 15px; + margin-bottom: 18px; + font-family:georgia,serif; + font-style: italic; +} +#epiceditor-preview blockquote:before { + content:"\201C"; + font-size:40px; + margin-left:-10px; + font-family:georgia,serif; + color:#eee; +} +#epiceditor-preview blockquote p { + font-size: 14px; + font-weight: 300; + line-height: 18px; + margin-bottom: 0; + font-style: italic; +} +#epiceditor-preview code, #epiceditor-preview pre { + font-family: Monaco, Andale Mono, Courier New, monospace; +} +#epiceditor-preview code { + background-color: #000; + color: #f92672; + padding: 1px 3px; + font-size: 12px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +#epiceditor-preview pre { + display: block; + padding: 14px; + color:#66d9ef; + margin: 0 0 18px; + line-height: 16px; + font-size: 11px; + border: 1px solid #d9d9d9; + white-space: pre-wrap; + word-wrap: break-word; +} +#epiceditor-preview pre code { + background-color: #000; + color:#ccc; + font-size: 11px; + padding: 0; +} diff --git a/system/lib/Michelf/Markdown.php b/system/lib/Michelf/Markdown.php new file mode 100644 index 0000000..094b0ee --- /dev/null +++ b/system/lib/Michelf/Markdown.php @@ -0,0 +1,3096 @@ + +# +# Original Markdown +# Copyright (c) 2004-2006 John Gruber +# +# +namespace Michelf; + + +# +# Markdown Parser Class +# + +class Markdown { + + ### Version ### + + const MARKDOWNLIB_VERSION = "1.3"; + + ### Simple Function Interface ### + + public static function defaultTransform($text) { + # + # Initialize the parser and return the result of its transform method. + # This will work fine for derived classes too. + # + # Take parser class on which this function was called. + $parser_class = \get_called_class(); + + # try to take parser from the static parser list + static $parser_list; + $parser =& $parser_list[$parser_class]; + + # create the parser it not already set + if (!$parser) + $parser = new $parser_class; + + # Transform text using parser. + return $parser->transform($text); + } + + ### Configuration Variables ### + + # Change to ">" for HTML output. + public $empty_element_suffix = " />"; + public $tab_width = 4; + + # Change to `true` to disallow markup or entities. + public $no_markup = false; + public $no_entities = false; + + # Predefined urls and titles for reference links and images. + public $predef_urls = array(); + public $predef_titles = array(); + + + ### Parser Implementation ### + + # Regex to match balanced [brackets]. + # Needed to insert a maximum bracked depth while converting to PHP. + protected $nested_brackets_depth = 6; + protected $nested_brackets_re; + + protected $nested_url_parenthesis_depth = 4; + protected $nested_url_parenthesis_re; + + # Table of hash values for escaped characters: + protected $escape_chars = '\`*_{}[]()>#+-.!'; + protected $escape_chars_re; + + + public function __construct() { + # + # Constructor function. Initialize appropriate member variables. + # + $this->_initDetab(); + $this->prepareItalicsAndBold(); + + $this->nested_brackets_re = + str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). + str_repeat('\])*', $this->nested_brackets_depth); + + $this->nested_url_parenthesis_re = + str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). + str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); + + $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; + + # Sort document, block, and span gamut in ascendent priority order. + asort($this->document_gamut); + asort($this->block_gamut); + asort($this->span_gamut); + } + + + # Internal hashes used during transformation. + protected $urls = array(); + protected $titles = array(); + protected $html_hashes = array(); + + # Status flag to avoid invalid nesting. + protected $in_anchor = false; + + + protected function setup() { + # + # Called before the transformation process starts to setup parser + # states. + # + # Clear global hashes. + $this->urls = $this->predef_urls; + $this->titles = $this->predef_titles; + $this->html_hashes = array(); + + $this->in_anchor = false; + } + + protected function teardown() { + # + # Called after the transformation process to clear any variable + # which may be taking up memory unnecessarly. + # + $this->urls = array(); + $this->titles = array(); + $this->html_hashes = array(); + } + + + public function transform($text) { + # + # Main function. Performs some preprocessing on the input text + # and pass it through the document gamut. + # + $this->setup(); + + # Remove UTF-8 BOM and marker character in input, if present. + $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); + + # Standardize line endings: + # DOS to Unix and Mac to Unix + $text = preg_replace('{\r\n?}', "\n", $text); + + # Make sure $text ends with a couple of newlines: + $text .= "\n\n"; + + # Convert all tabs to spaces. + $text = $this->detab($text); + + # Turn block-level HTML blocks into hash entries + $text = $this->hashHTMLBlocks($text); + + # Strip any lines consisting only of spaces and tabs. + # This makes subsequent regexen easier to write, because we can + # match consecutive blank lines with /\n+/ instead of something + # contorted like /[ ]*\n+/ . + $text = preg_replace('/^[ ]+$/m', '', $text); + + # Run document gamut methods. + foreach ($this->document_gamut as $method => $priority) { + $text = $this->$method($text); + } + + $this->teardown(); + + return $text . "\n"; + } + + protected $document_gamut = array( + # Strip link definitions, store in hashes. + "stripLinkDefinitions" => 20, + + "runBasicBlockGamut" => 30, + ); + + + protected function stripLinkDefinitions($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 + [ ]* + \n? # maybe *one* newline + [ ]* + (?: + <(.+?)> # url = $2 + | + (\S+?) # url = $3 + ) + [ ]* + \n? # maybe one newline + [ ]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.*?) # title = $4 + [")] + [ ]* + )? # title is optional + (?:\n+|\Z) + }xm', + array(&$this, '_stripLinkDefinitions_callback'), + $text); + return $text; + } + protected function _stripLinkDefinitions_callback($matches) { + $link_id = strtolower($matches[1]); + $url = $matches[2] == '' ? $matches[3] : $matches[2]; + $this->urls[$link_id] = $url; + $this->titles[$link_id] =& $matches[4]; + return ''; # String that will replace the block + } + + + protected function hashHTMLBlocks($text) { + if ($this->no_markup) return $text; + + $less_than_tab = $this->tab_width - 1; + + # Hashify HTML blocks: + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

    s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded: + # + # * List "a" is made of tags which can be both inline or block-level. + # These will be treated block-level when the start tag is alone on + # its line, otherwise they're not matched here and will be taken as + # inline later. + # * List "b" is made of tags which are always block-level; + # + $block_tags_a_re = 'ins|del'; + $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. + 'script|noscript|form|fieldset|iframe|math|svg|'. + 'article|section|nav|aside|hgroup|header|footer|'. + 'figure'; + + # Regular expression for the content of a block tag. + $nested_tags_level = 4; + $attr = ' + (?> # optional tag attributes + \s # starts with whitespace + (?> + [^>"/]+ # text outside quotes + | + /+(?!>) # slash not followed by ">" + | + "[^"]*" # text inside double quotes (tolerate ">") + | + \'[^\']*\' # text inside single quotes (tolerate ">") + )* + )? + '; + $content = + str_repeat(' + (?> + [^<]+ # content without tag + | + <\2 # nested opening tag + '.$attr.' # attributes + (?> + /> + | + >', $nested_tags_level). # end of opening tag + '.*?'. # last level nested tag content + str_repeat(' + # closing nested tag + ) + | + <(?!/\2\s*> # other tags with a different name + ) + )*', + $nested_tags_level); + $content2 = str_replace('\2', '\3', $content); + + # First, look for nested blocks, e.g.: + #

    + #
    + # tags for inner block must be indented. + #
    + #
    + # + # The outermost tags must start at the left margin for this to match, and + # the inner nested divs must be indented. + # We need to do this before the next, more liberal match, because the next + # match will start at the first `
    ` and stop at the first `
    `. + $text = preg_replace_callback('{(?> + (?> + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + + # Match from `\n` to `\n`, handling nested tags + # in between. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_b_re.')# start tag = $2 + '.$attr.'> # attributes followed by > and \n + '.$content.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special version for tags of group a. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_a_re.')# start tag = $3 + '.$attr.'>[ ]*\n # attributes followed by > + '.$content2.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special case just for
    . It was easier to make a special + # case than to make the other regex more complicated. + + [ ]{0,'.$less_than_tab.'} + <(hr) # start tag = $2 + '.$attr.' # attributes + /?> # the matching end tag + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # Special case for standalone HTML comments: + + [ ]{0,'.$less_than_tab.'} + (?s: + + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # PHP and ASP-style processor instructions ( + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + ) + )}Sxmi', + array(&$this, '_hashHTMLBlocks_callback'), + $text); + + return $text; + } + protected function _hashHTMLBlocks_callback($matches) { + $text = $matches[1]; + $key = $this->hashBlock($text); + return "\n\n$key\n\n"; + } + + + protected function hashPart($text, $boundary = 'X') { + # + # Called whenever a tag must be hashed when a function insert an atomic + # element in the text stream. Passing $text to through this function gives + # a unique text-token which will be reverted back when calling unhash. + # + # The $boundary argument specify what character should be used to surround + # the token. By convension, "B" is used for block elements that needs not + # to be wrapped into paragraph tags at the end, ":" is used for elements + # that are word separators and "X" is used in the general case. + # + # Swap back any tag hash found in $text so we do not have to `unhash` + # multiple times at the end. + $text = $this->unhash($text); + + # Then hash the block. + static $i = 0; + $key = "$boundary\x1A" . ++$i . $boundary; + $this->html_hashes[$key] = $text; + return $key; # String that will replace the tag. + } + + + protected function hashBlock($text) { + # + # Shortcut function for hashPart with block-level boundaries. + # + return $this->hashPart($text, 'B'); + } + + + protected $block_gamut = array( + # + # These are all the transformations that form block-level + # tags like paragraphs, headers, and list items. + # + "doHeaders" => 10, + "doHorizontalRules" => 20, + + "doLists" => 40, + "doCodeBlocks" => 50, + "doBlockQuotes" => 60, + ); + + protected function runBlockGamut($text) { + # + # Run block gamut tranformations. + # + # We need to escape raw HTML in Markdown source before doing anything + # else. This need to be done for each block, and not only at the + # begining in the Markdown function since hashed blocks can be part of + # list items and could have been indented. Indented blocks would have + # been seen as a code block in a previous pass of hashHTMLBlocks. + $text = $this->hashHTMLBlocks($text); + + return $this->runBasicBlockGamut($text); + } + + protected function runBasicBlockGamut($text) { + # + # Run block gamut tranformations, without hashing HTML blocks. This is + # useful when HTML blocks are known to be already hashed, like in the first + # whole-document pass. + # + foreach ($this->block_gamut as $method => $priority) { + $text = $this->$method($text); + } + + # Finally form paragraph and restore hashed blocks. + $text = $this->formParagraphs($text); + + return $text; + } + + + protected function doHorizontalRules($text) { + # Do Horizontal Rules: + return preg_replace( + '{ + ^[ ]{0,3} # Leading space + ([-*_]) # $1: First marker + (?> # Repeated marker group + [ ]{0,2} # Zero, one, or two spaces. + \1 # Marker character + ){2,} # Group repeated at least twice + [ ]* # Tailing spaces + $ # End of line. + }mx', + "\n".$this->hashBlock("empty_element_suffix")."\n", + $text); + } + + + protected $span_gamut = array( + # + # These are all the transformations that occur *within* block-level + # tags like paragraphs, headers, and list items. + # + # Process character escapes, code spans, and inline HTML + # in one shot. + "parseSpan" => -30, + + # Process anchor and image tags. Images must come first, + # because ![foo][f] looks like an anchor. + "doImages" => 10, + "doAnchors" => 20, + + # Make links out of things like `` + # Must come after doAnchors, because you can use < and > + # delimiters in inline links like [this](). + "doAutoLinks" => 30, + "encodeAmpsAndAngles" => 40, + + "doItalicsAndBold" => 50, + "doHardBreaks" => 60, + ); + + protected function runSpanGamut($text) { + # + # Run span gamut tranformations. + # + foreach ($this->span_gamut as $method => $priority) { + $text = $this->$method($text); + } + + return $text; + } + + + protected function doHardBreaks($text) { + # Do hard breaks: + return preg_replace_callback('/ {2,}\n/', + array(&$this, '_doHardBreaks_callback'), $text); + } + protected function _doHardBreaks_callback($matches) { + return $this->hashPart("empty_element_suffix\n"); + } + + + protected function doAnchors($text) { + # + # Turn Markdown link shortcuts into XHTML tags. + # + if ($this->in_anchor) return $text; + $this->in_anchor = true; + + # + # First, handle reference-style links: [link text] [id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + # + # Next, inline-style links: [link text](url "optional title") + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + \( # literal paren + [ \n]* + (?: + <(.+?)> # href = $3 + | + ('.$this->nested_url_parenthesis_re.') # href = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # Title = $7 + \6 # matching quote + [ \n]* # ignore any spaces/tabs between closing quote and ) + )? # title is optional + \) + ) + }xs', + array(&$this, '_doAnchors_inline_callback'), $text); + + # + # Last, handle reference-style shortcuts: [link text] + # These must come last in case you've also got [link text][1] + # or [link text](/foo) + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + $this->in_anchor = false; + return $text; + } + protected function _doAnchors_reference_callback($matches) { + $whole_match = $matches[1]; + $link_text = $matches[2]; + $link_id =& $matches[3]; + + if ($link_id == "") { + # for shortcut links like [this][] or [this]. + $link_id = $link_text; + } + + # lower-case and turn embedded newlines into spaces + $link_id = strtolower($link_id); + $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); + + if (isset($this->urls[$link_id])) { + $url = $this->urls[$link_id]; + $url = $this->encodeAttribute($url); + + $result = "titles[$link_id] ) ) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + $result = $this->hashPart($result); + } + else { + $result = $whole_match; + } + return $result; + } + protected function _doAnchors_inline_callback($matches) { + $whole_match = $matches[1]; + $link_text = $this->runSpanGamut($matches[2]); + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + $url = $this->encodeAttribute($url); + + $result = "encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + + return $this->hashPart($result); + } + + + protected function doImages($text) { + # + # Turn Markdown image shortcuts into tags. + # + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }xs', + array(&$this, '_doImages_reference_callback'), $text); + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + \s? # One optional whitespace character + \( # literal paren + [ \n]* + (?: + <(\S*)> # src url = $3 + | + ('.$this->nested_url_parenthesis_re.') # src url = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # title = $7 + \6 # matching quote + [ \n]* + )? # title is optional + \) + ) + }xs', + array(&$this, '_doImages_inline_callback'), $text); + + return $text; + } + protected function _doImages_reference_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $link_id = strtolower($matches[3]); + + if ($link_id == "") { + $link_id = strtolower($alt_text); # for shortcut links like ![this][]. + } + + $alt_text = $this->encodeAttribute($alt_text); + if (isset($this->urls[$link_id])) { + $url = $this->encodeAttribute($this->urls[$link_id]); + $result = "\"$alt_text\"";titles[$link_id])) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + $result .= $this->empty_element_suffix; + $result = $this->hashPart($result); + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + return $result; + } + protected function _doImages_inline_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + $alt_text = $this->encodeAttribute($alt_text); + $url = $this->encodeAttribute($url); + $result = "\"$alt_text\"";encodeAttribute($title); + $result .= " title=\"$title\""; # $title already quoted + } + $result .= $this->empty_element_suffix; + + return $this->hashPart($result); + } + + + protected function doHeaders($text) { + # Setext-style headers: + # Header 1 + # ======== + # + # Header 2 + # -------- + # + $text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx', + array(&$this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 + # ## Header 2 + # ## Header 2 with closing hashes ## + # ... + # ###### Header 6 + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + \n+ + }xm', + array(&$this, '_doHeaders_callback_atx'), $text); + + return $text; + } + protected function _doHeaders_callback_setext($matches) { + # Terrible hack to check we haven't found an empty list item. + if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) + return $matches[0]; + + $level = $matches[2]{0} == '=' ? 1 : 2; + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + protected function _doHeaders_callback_atx($matches) { + $level = strlen($matches[1]); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + + protected function doLists($text) { + # + # Form HTML ordered (numbered) and unordered (bulleted) lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[\.]'; + $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; + + $markers_relist = array( + $marker_ul_re => $marker_ol_re, + $marker_ol_re => $marker_ul_re, + ); + + foreach ($markers_relist as $marker_re => $other_marker_re) { + # Re-usable pattern to match any entirel ul or ol list: + $whole_list_re = ' + ( # $1 = whole list + ( # $2 + ([ ]{0,'.$less_than_tab.'}) # $3 = number of spaces + ('.$marker_re.') # $4 = first list item marker + [ ]+ + ) + (?s:.+?) + ( # $5 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another list item marker + [ ]* + '.$marker_re.'[ ]+ + ) + | + (?= # Lookahead for another kind of list + \n + \3 # Must have the same indentation + '.$other_marker_re.'[ ]+ + ) + ) + ) + '; // mx + + # We use a different prefix before nested lists than top-level lists. + # See extended comment in _ProcessListItems(). + + if ($this->list_level) { + $text = preg_replace_callback('{ + ^ + '.$whole_list_re.' + }mx', + array(&$this, '_doLists_callback'), $text); + } + else { + $text = preg_replace_callback('{ + (?:(?<=\n)\n|\A\n?) # Must eat the newline + '.$whole_list_re.' + }mx', + array(&$this, '_doLists_callback'), $text); + } + } + + return $text; + } + protected function _doLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[\.]'; + $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; + + $list = $matches[1]; + $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; + + $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); + + $list .= "\n"; + $result = $this->processListItems($list, $marker_any_re); + + $result = $this->hashBlock("<$list_type>\n" . $result . ""); + return "\n". $result ."\n\n"; + } + + protected $list_level = 0; + + protected function processListItems($list_str, $marker_any_re) { + # + # Process the contents of a single ordered or unordered list, splitting it + # into individual list items. + # + # The $this->list_level global keeps track of when we're inside a list. + # Each time we enter a list, we increment it; when we leave a list, + # we decrement. If it's zero, we're not in a list anymore. + # + # We do this because when we're not inside a list, we want to treat + # something like this: + # + # I recommend upgrading to version + # 8. Oops, now this line is treated + # as a sub-list. + # + # As a single paragraph, despite the fact that the second line starts + # with a digit-period-space sequence. + # + # Whereas when we're inside a list (or sub-list), that line will be + # treated as the start of a sub-list. What a kludge, huh? This is + # an aspect of Markdown's syntax that's hard to parse perfectly + # without resorting to mind-reading. Perhaps the solution is to + # change the syntax rules such that sub-lists must start with a + # starting cardinal number; e.g. "1." or "a.". + + $this->list_level++; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + $list_str = preg_replace_callback('{ + (\n)? # leading line = $1 + (^[ ]*) # leading whitespace = $2 + ('.$marker_any_re.' # list marker and space = $3 + (?:[ ]+|(?=\n)) # space only required if item is not empty + ) + ((?s:.*?)) # list item text = $4 + (?:(\n+(?=\n))|\n) # tailing blank line = $5 + (?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n)))) + }xm', + array(&$this, '_processListItems_callback'), $list_str); + + $this->list_level--; + return $list_str; + } + protected function _processListItems_callback($matches) { + $item = $matches[4]; + $leading_line =& $matches[1]; + $leading_space =& $matches[2]; + $marker_space = $matches[3]; + $tailing_blank_line =& $matches[5]; + + if ($leading_line || $tailing_blank_line || + preg_match('/\n{2,}/', $item)) + { + # Replace marker with the appropriate whitespace indentation + $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; + $item = $this->runBlockGamut($this->outdent($item)."\n"); + } + else { + # Recursion for sub-lists: + $item = $this->doLists($this->outdent($item)); + $item = preg_replace('/\n+$/', '', $item); + $item = $this->runSpanGamut($item); + } + + return "
  • " . $item . "
  • \n"; + } + + + protected function doCodeBlocks($text) { + # + # Process Markdown `
    ` blocks.
    +	#
    +		$text = preg_replace_callback('{
    +				(?:\n\n|\A\n?)
    +				(	            # $1 = the code block -- one or more lines, starting with a space/tab
    +				  (?>
    +					[ ]{'.$this->tab_width.'}  # Lines must start with a tab or a tab-width of spaces
    +					.*\n+
    +				  )+
    +				)
    +				((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z)	# Lookahead for non-space at line-start, or end of doc
    +			}xm',
    +			array(&$this, '_doCodeBlocks_callback'), $text);
    +
    +		return $text;
    +	}
    +	protected function _doCodeBlocks_callback($matches) {
    +		$codeblock = $matches[1];
    +
    +		$codeblock = $this->outdent($codeblock);
    +		$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
    +
    +		# trim leading newlines and trailing newlines
    +		$codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
    +
    +		$codeblock = "
    $codeblock\n
    "; + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + + + protected function makeCodeSpan($code) { + # + # Create a code span markup for $code. Called from handleSpanToken. + # + $code = htmlspecialchars(trim($code), ENT_NOQUOTES); + return $this->hashPart("$code"); + } + + + protected $em_relist = array( + '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(?em_relist as $em => $em_re) { + foreach ($this->strong_relist as $strong => $strong_re) { + # Construct list of allowed token expressions. + $token_relist = array(); + if (isset($this->em_strong_relist["$em$strong"])) { + $token_relist[] = $this->em_strong_relist["$em$strong"]; + } + $token_relist[] = $em_re; + $token_relist[] = $strong_re; + + # Construct master expression from list. + $token_re = '{('. implode('|', $token_relist) .')}'; + $this->em_strong_prepared_relist["$em$strong"] = $token_re; + } + } + } + + protected function doItalicsAndBold($text) { + $token_stack = array(''); + $text_stack = array(''); + $em = ''; + $strong = ''; + $tree_char_em = false; + + while (1) { + # + # Get prepared regular expression for seraching emphasis tokens + # in current context. + # + $token_re = $this->em_strong_prepared_relist["$em$strong"]; + + # + # Each loop iteration search for the next emphasis token. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + $text_stack[0] .= $parts[0]; + $token =& $parts[1]; + $text =& $parts[2]; + + if (empty($token)) { + # Reached end of text span: empty stack without emitting. + # any more emphasis. + while ($token_stack[0]) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + break; + } + + $token_len = strlen($token); + if ($tree_char_em) { + # Reached closing marker while inside a three-char emphasis. + if ($token_len == 3) { + # Three-char closing marker, close em and strong. + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + $strong = ''; + } else { + # Other closing marker: close one em or strong and + # change current token state to match the other + $token_stack[0] = str_repeat($token{0}, 3-$token_len); + $tag = $token_len == 2 ? "strong" : "em"; + $span = $text_stack[0]; + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] = $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + $tree_char_em = false; + } else if ($token_len == 3) { + if ($em) { + # Reached closing marker for both em and strong. + # Closing strong marker: + for ($i = 0; $i < 2; ++$i) { + $shifted_token = array_shift($token_stack); + $tag = strlen($shifted_token) == 2 ? "strong" : "em"; + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] .= $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + } else { + # Reached opening three-char emphasis marker. Push on token + # stack; will be handled by the special condition above. + $em = $token{0}; + $strong = "$em$em"; + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $tree_char_em = true; + } + } else if ($token_len == 2) { + if ($strong) { + # Unwind any dangling emphasis marker: + if (strlen($token_stack[0]) == 1) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + # Closing strong marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $strong = ''; + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $strong = $token; + } + } else { + # Here $token_len == 1 + if ($em) { + if (strlen($token_stack[0]) == 1) { + # Closing emphasis marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + } else { + $text_stack[0] .= $token; + } + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $em = $token; + } + } + } + return $text_stack[0]; + } + + + protected function doBlockQuotes($text) { + $text = preg_replace_callback('/ + ( # Wrap whole match in $1 + (?> + ^[ ]*>[ ]? # ">" at the start of a line + .+\n # rest of the first line + (.+\n)* # subsequent consecutive lines + \n* # blanks + )+ + ) + /xm', + array(&$this, '_doBlockQuotes_callback'), $text); + + return $text; + } + protected function _doBlockQuotes_callback($matches) { + $bq = $matches[1]; + # trim one level of quoting - trim whitespace-only lines + $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); + $bq = $this->runBlockGamut($bq); # recurse + + $bq = preg_replace('/^/m', " ", $bq); + # These leading spaces cause problem with
     content, 
    +		# so we need to fix that:
    +		$bq = preg_replace_callback('{(\s*
    .+?
    )}sx', + array(&$this, '_doBlockQuotes_callback2'), $bq); + + return "\n". $this->hashBlock("
    \n$bq\n
    ")."\n\n"; + } + protected function _doBlockQuotes_callback2($matches) { + $pre = $matches[1]; + $pre = preg_replace('/^ /m', '', $pre); + return $pre; + } + + + protected function formParagraphs($text) { + # + # Params: + # $text - string to process with html

    tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

    tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + if (!preg_match('/^B\x1A[0-9]+B$/', $value)) { + # Is a paragraph. + $value = $this->runSpanGamut($value); + $value = preg_replace('/^([ ]*)/', "

    ", $value); + $value .= "

    "; + $grafs[$key] = $this->unhash($value); + } + else { + # Is a block. + # Modify elements of @grafs in-place... + $graf = $value; + $block = $this->html_hashes[$graf]; + $graf = $block; +// if (preg_match('{ +// \A +// ( # $1 =
    tag +//
    ]* +// \b +// markdown\s*=\s* ([\'"]) # $2 = attr quote char +// 1 +// \2 +// [^>]* +// > +// ) +// ( # $3 = contents +// .* +// ) +// (
    ) # $4 = closing tag +// \z +// }xs', $block, $matches)) +// { +// list(, $div_open, , $div_content, $div_close) = $matches; +// +// # We can't call Markdown(), because that resets the hash; +// # that initialization code should be pulled into its own sub, though. +// $div_content = $this->hashHTMLBlocks($div_content); +// +// # Run document gamut methods on the content. +// foreach ($this->document_gamut as $method => $priority) { +// $div_content = $this->$method($div_content); +// } +// +// $div_open = preg_replace( +// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open); +// +// $graf = $div_open . "\n" . $div_content . "\n" . $div_close; +// } + $grafs[$key] = $graf; + } + } + + return implode("\n\n", $grafs); + } + + + protected function encodeAttribute($text) { + # + # Encode text for a double-quoted HTML attribute. This function + # is *not* suitable for attributes enclosed in single quotes. + # + $text = $this->encodeAmpsAndAngles($text); + $text = str_replace('"', '"', $text); + return $text; + } + + + protected function encodeAmpsAndAngles($text) { + # + # Smart processing for ampersands and angle brackets that need to + # be encoded. Valid character entities are left alone unless the + # no-entities mode is set. + # + if ($this->no_entities) { + $text = str_replace('&', '&', $text); + } else { + # Ampersand-encoding based entirely on Nat Irons's Amputator + # MT plugin: + $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', + '&', $text);; + } + # Encode remaining <'s + $text = str_replace('<', '<', $text); + + return $text; + } + + + protected function doAutoLinks($text) { + $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i', + array(&$this, '_doAutoLinks_url_callback'), $text); + + # Email addresses: + $text = preg_replace_callback('{ + < + (?:mailto:)? + ( + (?: + [-!#$%&\'*+/=?^_`.{|}~\w\x80-\xFF]+ + | + ".*?" + ) + \@ + (?: + [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+ + | + \[[\d.a-fA-F:]+\] # IPv4 & IPv6 + ) + ) + > + }xi', + array(&$this, '_doAutoLinks_email_callback'), $text); + + return $text; + } + protected function _doAutoLinks_url_callback($matches) { + $url = $this->encodeAttribute($matches[1]); + $link = "$url"; + return $this->hashPart($link); + } + protected function _doAutoLinks_email_callback($matches) { + $address = $matches[1]; + $link = $this->encodeEmailAddress($address); + return $this->hashPart($link); + } + + + protected function encodeEmailAddress($addr) { + # + # Input: an email address, e.g. "foo@example.com" + # + # Output: the email address as a mailto link, with each character + # of the address encoded as either a decimal or hex entity, in + # the hopes of foiling most address harvesting spam bots. E.g.: + # + #

    foo@exampl + # e.com

    + # + # Based by a filter by Matthew Wickline, posted to BBEdit-Talk. + # With some optimizations by Milian Wolff. + # + $addr = "mailto:" . $addr; + $chars = preg_split('/(? $char) { + $ord = ord($char); + # Ignore non-ascii chars. + if ($ord < 128) { + $r = ($seed * (1 + $key)) % 100; # Pseudo-random function. + # roughly 10% raw, 45% hex, 45% dec + # '@' *must* be encoded. I insist. + if ($r > 90 && $char != '@') /* do nothing */; + else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';'; + else $chars[$key] = '&#'.$ord.';'; + } + } + + $addr = implode('', $chars); + $text = implode('', array_slice($chars, 7)); # text without `mailto:` + $addr = "$text"; + + return $addr; + } + + + protected function parseSpan($str) { + # + # Take the string $str and parse it into tokens, hashing embeded HTML, + # escaped characters and handling code spans. + # + $output = ''; + + $span_re = '{ + ( + \\\\'.$this->escape_chars_re.' + | + (?no_markup ? '' : ' + | + # comment + | + <\?.*?\?> | <%.*?%> # processing instruction + | + <[!$]?[-a-zA-Z0-9:_]+ # regular tags + (?> + \s + (?>[^"\'>]+|"[^"]*"|\'[^\']*\')* + )? + > + | + <[-a-zA-Z0-9:_]+\s*/> # xml-style empty tag + | + # closing tag + ').' + ) + }xs'; + + while (1) { + # + # Each loop iteration seach for either the next tag, the next + # openning code span marker, or the next escaped character. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE); + + # Create token from text preceding tag. + if ($parts[0] != "") { + $output .= $parts[0]; + } + + # Check if we reach the end. + if (isset($parts[1])) { + $output .= $this->handleSpanToken($parts[1], $parts[2]); + $str = $parts[2]; + } + else { + break; + } + } + + return $output; + } + + + protected function handleSpanToken($token, &$str) { + # + # Handle $token provided by parseSpan by determining its nature and + # returning the corresponding value that should replace it. + # + switch ($token{0}) { + case "\\": + return $this->hashPart("&#". ord($token{1}). ";"); + case "`": + # Search for end marker in remaining text. + if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', + $str, $matches)) + { + $str = $matches[2]; + $codespan = $this->makeCodeSpan($matches[1]); + return $this->hashPart($codespan); + } + return $token; // return as text since no ending marker found. + default: + return $this->hashPart($token); + } + } + + + protected function outdent($text) { + # + # Remove one level of line-leading tabs or spaces + # + return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text); + } + + + # String length function for detab. `_initDetab` will create a function to + # hanlde UTF-8 if the default function does not exist. + protected $utf8_strlen = 'mb_strlen'; + + protected function detab($text) { + # + # Replace tabs with the appropriate amount of space. + # + # For each line we separate the line in blocks delemited by + # tab characters. Then we reconstruct every line by adding the + # appropriate number of space between each blocks. + + $text = preg_replace_callback('/^.*\t.*$/m', + array(&$this, '_detab_callback'), $text); + + return $text; + } + protected function _detab_callback($matches) { + $line = $matches[0]; + $strlen = $this->utf8_strlen; # strlen function for UTF-8. + + # Split in blocks. + $blocks = explode("\t", $line); + # Add each blocks to the line. + $line = $blocks[0]; + unset($blocks[0]); # Do not add first block twice. + foreach ($blocks as $block) { + # Calculate amount of space, insert spaces, insert block. + $amount = $this->tab_width - + $strlen($line, 'UTF-8') % $this->tab_width; + $line .= str_repeat(" ", $amount) . $block; + } + return $line; + } + protected function _initDetab() { + # + # Check for the availability of the function in the `utf8_strlen` property + # (initially `mb_strlen`). If the function is not available, create a + # function that will loosely count the number of UTF-8 characters with a + # regular expression. + # + if (function_exists($this->utf8_strlen)) return; + $this->utf8_strlen = create_function('$text', 'return preg_match_all( + "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", + $text, $m);'); + } + + + protected function unhash($text) { + # + # Swap back in all the tags hashed by _HashHTMLBlocks. + # + return preg_replace_callback('/(.)\x1A[0-9]+\1/', + array(&$this, '_unhash_callback'), $text); + } + protected function _unhash_callback($matches) { + return $this->html_hashes[$matches[0]]; + } + +} + + +# +# Temporary Markdown Extra Parser Implementation Class +# +# NOTE: DON'T USE THIS CLASS +# Currently the implementation of of Extra resides here in this temporary class. +# This makes it easier to propagate the changes between the three different +# packaging styles of PHP Markdown. When this issue is resolved, this +# MarkdownExtra_TmpImpl class here will disappear and \Michelf\MarkdownExtra +# will contain the code. So please use \Michelf\MarkdownExtra and ignore this +# one. +# + +class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { + + ### Configuration Variables ### + + # Prefix for footnote ids. + public $fn_id_prefix = ""; + + # Optional title attribute for footnote links and backlinks. + public $fn_link_title = ""; + public $fn_backlink_title = ""; + + # Optional class attribute for footnote links and backlinks. + public $fn_link_class = "footnote-ref"; + public $fn_backlink_class = "footnote-backref"; + + # Class name for table cell alignment (%% replaced left/center/right) + # For instance: 'go-%%' becomes 'go-left' or 'go-right' or 'go-center' + # If empty, the align attribute is used instead of a class name. + public $table_align_class_tmpl = ''; + + # Optional class prefix for fenced code block. + public $code_class_prefix = ""; + # Class attribute for code blocks goes on the `code` tag; + # setting this to true will put attributes on the `pre` tag instead. + public $code_attr_on_pre = false; + + # Predefined abbreviations. + public $predef_abbr = array(); + + + ### Parser Implementation ### + + public function __construct() { + # + # Constructor function. Initialize the parser object. + # + # Add extra escapable characters before parent constructor + # initialize the table. + $this->escape_chars .= ':|'; + + # Insert extra document, block, and span transformations. + # Parent constructor will do the sorting. + $this->document_gamut += array( + "doFencedCodeBlocks" => 5, + "stripFootnotes" => 15, + "stripAbbreviations" => 25, + "appendFootnotes" => 50, + ); + $this->block_gamut += array( + "doFencedCodeBlocks" => 5, + "doTables" => 15, + "doDefLists" => 45, + ); + $this->span_gamut += array( + "doFootnotes" => 5, + "doAbbreviations" => 70, + ); + + parent::__construct(); + } + + + # Extra variables used during extra transformations. + protected $footnotes = array(); + protected $footnotes_ordered = array(); + protected $footnotes_ref_count = array(); + protected $footnotes_numbers = array(); + protected $abbr_desciptions = array(); + protected $abbr_word_re = ''; + + # Give the current footnote number. + protected $footnote_counter = 1; + + + protected function setup() { + # + # Setting up Extra-specific variables. + # + parent::setup(); + + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->footnotes_ref_count = array(); + $this->footnotes_numbers = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + $this->footnote_counter = 1; + + foreach ($this->predef_abbr as $abbr_word => $abbr_desc) { + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + } + } + + protected function teardown() { + # + # Clearing Extra-specific variables. + # + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->footnotes_ref_count = array(); + $this->footnotes_numbers = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + + parent::teardown(); + } + + + ### Extra Attribute Parser ### + + # Expression to use to catch attributes (includes the braces) + protected $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\}'; + # Expression to use when parsing in a context when no capture is desired + protected $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){1,}[ ]*\}'; + + protected function doExtraAttributes($tag_name, $attr) { + # + # Parse attributes caught by the $this->id_class_attr_catch_re expression + # and return the HTML-formatted list of attributes. + # + # Currently supported attributes are .class and #id. + # + if (empty($attr)) return ""; + + # Split on components + preg_match_all('/[#.][-_:a-zA-Z0-9]+/', $attr, $matches); + $elements = $matches[0]; + + # handle classes and ids (only first id taken into account) + $classes = array(); + $id = false; + foreach ($elements as $element) { + if ($element{0} == '.') { + $classes[] = substr($element, 1); + } else if ($element{0} == '#') { + if ($id === false) $id = substr($element, 1); + } + } + + # compose attributes as string + $attr_str = ""; + if (!empty($id)) { + $attr_str .= ' id="'.$id.'"'; + } + if (!empty($classes)) { + $attr_str .= ' class="'.implode(" ", $classes).'"'; + } + return $attr_str; + } + + + protected function stripLinkDefinitions($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 + [ ]* + \n? # maybe *one* newline + [ ]* + (?: + <(.+?)> # url = $2 + | + (\S+?) # url = $3 + ) + [ ]* + \n? # maybe one newline + [ ]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.*?) # title = $4 + [")] + [ ]* + )? # title is optional + (?:[ ]* '.$this->id_class_attr_catch_re.' )? # $5 = extra id & class attr + (?:\n+|\Z) + }xm', + array(&$this, '_stripLinkDefinitions_callback'), + $text); + return $text; + } + protected function _stripLinkDefinitions_callback($matches) { + $link_id = strtolower($matches[1]); + $url = $matches[2] == '' ? $matches[3] : $matches[2]; + $this->urls[$link_id] = $url; + $this->titles[$link_id] =& $matches[4]; + $this->ref_attr[$link_id] = $this->doExtraAttributes("", $dummy =& $matches[5]); + return ''; # String that will replace the block + } + + + ### HTML Block Parser ### + + # Tags that are always treated as block tags: + protected $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption'; + + # Tags treated as block tags only if the opening tag is alone on its line: + protected $context_block_tags_re = 'script|noscript|ins|del|iframe|object|source|track|param|math|svg|canvas|audio|video'; + + # Tags where markdown="1" default to span mode: + protected $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address'; + + # Tags which must not have their contents modified, no matter where + # they appear: + protected $clean_tags_re = 'script|math|svg'; + + # Tags that do not need to be closed. + protected $auto_close_tags_re = 'hr|img|param|source|track'; + + + protected function hashHTMLBlocks($text) { + # + # Hashify HTML Blocks and "clean tags". + # + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

    s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded. + # + # This works by calling _HashHTMLBlocks_InMarkdown, which then calls + # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1" + # attribute is found within a tag, _HashHTMLBlocks_InHTML calls back + # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag. + # These two functions are calling each other. It's recursive! + # + if ($this->no_markup) return $text; + + # + # Call the HTML-in-Markdown hasher. + # + list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text); + + return $text; + } + protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0, + $enclosing_tag_re = '', $span = false) + { + # + # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags. + # + # * $indent is the number of space to be ignored when checking for code + # blocks. This is important because if we don't take the indent into + # account, something like this (which looks right) won't work as expected: + # + #

    + #
    + # Hello World. <-- Is this a Markdown code block or text? + #
    <-- Is this a Markdown code block or a real tag? + #
    + # + # If you don't like this, just don't indent the tag on which + # you apply the markdown="1" attribute. + # + # * If $enclosing_tag_re is not empty, stops at the first unmatched closing + # tag with that name. Nested tags supported. + # + # * If $span is true, text inside must treated as span. So any double + # newline will be replaced by a single newline so that it does not create + # paragraphs. + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to check for the presense of newlines around a block tag. + $newline_before_re = '/(?:^\n?|\n\n)*$/'; + $newline_after_re = + '{ + ^ # Start of text following the tag. + (?>[ ]*)? # Optional comment. + [ ]*\n # Must be followed by newline. + }xs'; + + # Regex to match any tag. + $block_tag_re = + '{ + ( # $2: Capture whole tag. + # Tag name. + '.$this->block_tags_re.' | + '.$this->context_block_tags_re.' | + '.$this->clean_tags_re.' | + (?!\s)'.$enclosing_tag_re.' + ) + (?: + (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name. + (?> + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + | + # Code span marker + `+ + '. ( !$span ? ' # If not in span. + | + # Indented code block + (?: ^[ ]*\n | ^ | \n[ ]*\n ) + [ ]{'.($indent+4).'}[^\n]* \n + (?> + (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n + )* + | + # Fenced code block marker + (?<= ^ | \n ) + [ ]{0,'.($indent+3).'}~{3,} + [ ]* + (?: + \.?[-_:a-zA-Z0-9]+ # standalone class name + | + '.$this->id_class_attr_nocatch_re.' # extra attributes + )? + [ ]* + \n + ' : '' ). ' # End (if not is span). + ) + }xs'; + + + $depth = 0; # Current depth inside the tag tree. + $parsed = ""; # Parsed text that will be returned. + + # + # Loop through every tag until we find the closing tag of the parent + # or loop until reaching the end of text if no parent tag specified. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($block_tag_re, $text, 2, + PREG_SPLIT_DELIM_CAPTURE); + + # If in Markdown span mode, add a empty-string span-level hash + # after each newline to prevent triggering any block element. + if ($span) { + $void = $this->hashPart("", ':'); + $newline = "$void\n"; + $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; + } + + $parsed .= $parts[0]; # Text before current tag. + + # If end of $text has been reached. Stop loop. + if (count($parts) < 3) { + $text = ""; + break; + } + + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + $tag_re = preg_quote($tag); # For use in a regular expression. + + # + # Check for: Code span marker + # + if ($tag{0} == "`") { + # Find corresponding end marker. + $tag_re = preg_quote($tag); + if (preg_match('{^(?>.+?|\n(?!\n))*?(?.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text, + $matches)) + { + # End marker found: pass text unchanged until marker. + $parsed .= $tag . $matches[0]; + $text = substr($text, strlen($matches[0])); + } + else { + # No end marker: just skip it. + $parsed .= $tag; + } + } + # + # Check for: Indented code block. + # + else if ($tag{0} == "\n" || $tag{0} == " ") { + # Indented code block: pass it unchanged, will be handled + # later. + $parsed .= $tag; + } + # + # Check for: Opening Block level tag or + # Opening Context Block tag (like ins and del) + # used as a block tag (tag is alone on it's line). + # + else if (preg_match('{^<(?:'.$this->block_tags_re.')\b}', $tag) || + ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) && + preg_match($newline_before_re, $parsed) && + preg_match($newline_after_re, $text) ) + ) + { + # Need to parse tag and following text using the HTML parser. + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true); + + # Make sure it stays outside of any paragraph by adding newlines. + $parsed .= "\n\n$block_text\n\n"; + } + # + # Check for: Clean tag (like script, math) + # HTML Comments, processing instructions. + # + else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Need to parse tag and following text using the HTML parser. + # (don't check for markdown attribute) + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false); + + $parsed .= $block_text; + } + # + # Check for: Tag with same name as enclosing tag. + # + else if ($enclosing_tag_re !== '' && + # Same name as enclosing tag. + preg_match('{^= 0); + + return array($parsed, $text); + } + protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { + # + # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags. + # + # * Calls $hash_method to convert any blocks. + # * Stops when the first opening tag closes. + # * $md_attr indicate if the use of the `markdown="1"` attribute is allowed. + # (it is not inside clean tags) + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to match `markdown` attribute inside of a tag. + $markdown_attr_re = ' + { + \s* # Eat whitespace before the `markdown` attribute + markdown + \s*=\s* + (?> + (["\']) # $1: quote delimiter + (.*?) # $2: attribute value + \1 # matching delimiter + | + ([^\s>]*) # $3: unquoted attribute value + ) + () # $4: make $3 always defined (avoid warnings) + }xs'; + + # Regex to match any tag. + $tag_re = '{ + ( # $2: Capture whole tag. + + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + ) + }xs'; + + $original_text = $text; # Save original text in case of faliure. + + $depth = 0; # Current depth inside the tag tree. + $block_text = ""; # Temporary text holder for current text. + $parsed = ""; # Parsed text that will be returned. + + # + # Get the name of the starting tag. + # (This pattern makes $base_tag_name_re safe without quoting.) + # + if (preg_match('/^<([\w:$]*)\b/', $text, $matches)) + $base_tag_name_re = $matches[1]; + + # + # Loop through every tag until we find the corresponding closing tag. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + + if (count($parts) < 3) { + # + # End of $text reached with unbalenced tag(s). + # In that case, we return original text unchanged and pass the + # first character as filtered to prevent an infinite loop in the + # parent function. + # + return array($original_text{0}, substr($original_text, 1)); + } + + $block_text .= $parts[0]; # Text before current tag. + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + + # + # Check for: Auto-close tag (like
    ) + # Comments and Processing Instructions. + # + if (preg_match('{^auto_close_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Just add the tag to the block as if it was text. + $block_text .= $tag; + } + else { + # + # Increase/decrease nested tag count. Only do so if + # the tag's name match base tag's. + # + if (preg_match('{^mode = $attr_m[2] . $attr_m[3]; + $span_mode = $this->mode == 'span' || $this->mode != 'block' && + preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag); + + # Calculate indent before tag. + if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) { + $strlen = $this->utf8_strlen; + $indent = $strlen($matches[1], 'UTF-8'); + } else { + $indent = 0; + } + + # End preceding block with this tag. + $block_text .= $tag; + $parsed .= $this->$hash_method($block_text); + + # Get enclosing tag name for the ParseMarkdown function. + # (This pattern makes $tag_name_re safe without quoting.) + preg_match('/^<([\w:$]*)\b/', $tag, $matches); + $tag_name_re = $matches[1]; + + # Parse the content using the HTML-in-Markdown parser. + list ($block_text, $text) + = $this->_hashHTMLBlocks_inMarkdown($text, $indent, + $tag_name_re, $span_mode); + + # Outdent markdown text. + if ($indent > 0) { + $block_text = preg_replace("/^[ ]{1,$indent}/m", "", + $block_text); + } + + # Append tag content to parsed text. + if (!$span_mode) $parsed .= "\n\n$block_text\n\n"; + else $parsed .= "$block_text"; + + # Start over with a new block. + $block_text = ""; + } + else $block_text .= $tag; + } + + } while ($depth > 0); + + # + # Hash last block text that wasn't processed inside the loop. + # + $parsed .= $this->$hash_method($block_text); + + return array($parsed, $text); + } + + + protected function hashClean($text) { + # + # Called whenever a tag must be hashed when a function inserts a "clean" tag + # in $text, it passes through this function and is automaticaly escaped, + # blocking invalid nested overlap. + # + return $this->hashPart($text, 'C'); + } + + + protected function doAnchors($text) { + # + # Turn Markdown link shortcuts into XHTML tags. + # + if ($this->in_anchor) return $text; + $this->in_anchor = true; + + # + # First, handle reference-style links: [link text] [id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + # + # Next, inline-style links: [link text](url "optional title") + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + \( # literal paren + [ \n]* + (?: + <(.+?)> # href = $3 + | + ('.$this->nested_url_parenthesis_re.') # href = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # Title = $7 + \6 # matching quote + [ \n]* # ignore any spaces/tabs between closing quote and ) + )? # title is optional + \) + (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes + ) + }xs', + array(&$this, '_doAnchors_inline_callback'), $text); + + # + # Last, handle reference-style shortcuts: [link text] + # These must come last in case you've also got [link text][1] + # or [link text](/foo) + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + $this->in_anchor = false; + return $text; + } + protected function _doAnchors_reference_callback($matches) { + $whole_match = $matches[1]; + $link_text = $matches[2]; + $link_id =& $matches[3]; + + if ($link_id == "") { + # for shortcut links like [this][] or [this]. + $link_id = $link_text; + } + + # lower-case and turn embedded newlines into spaces + $link_id = strtolower($link_id); + $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); + + if (isset($this->urls[$link_id])) { + $url = $this->urls[$link_id]; + $url = $this->encodeAttribute($url); + + $result = "titles[$link_id] ) ) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + if (isset($this->ref_attr[$link_id])) + $result .= $this->ref_attr[$link_id]; + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + $result = $this->hashPart($result); + } + else { + $result = $whole_match; + } + return $result; + } + protected function _doAnchors_inline_callback($matches) { + $whole_match = $matches[1]; + $link_text = $this->runSpanGamut($matches[2]); + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + $attr = $this->doExtraAttributes("a", $dummy =& $matches[8]); + + + $url = $this->encodeAttribute($url); + + $result = "encodeAttribute($title); + $result .= " title=\"$title\""; + } + $result .= $attr; + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + + return $this->hashPart($result); + } + + + protected function doImages($text) { + # + # Turn Markdown image shortcuts into tags. + # + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }xs', + array(&$this, '_doImages_reference_callback'), $text); + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + \s? # One optional whitespace character + \( # literal paren + [ \n]* + (?: + <(\S*)> # src url = $3 + | + ('.$this->nested_url_parenthesis_re.') # src url = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # title = $7 + \6 # matching quote + [ \n]* + )? # title is optional + \) + (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes + ) + }xs', + array(&$this, '_doImages_inline_callback'), $text); + + return $text; + } + protected function _doImages_reference_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $link_id = strtolower($matches[3]); + + if ($link_id == "") { + $link_id = strtolower($alt_text); # for shortcut links like ![this][]. + } + + $alt_text = $this->encodeAttribute($alt_text); + if (isset($this->urls[$link_id])) { + $url = $this->encodeAttribute($this->urls[$link_id]); + $result = "\"$alt_text\"";titles[$link_id])) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + if (isset($this->ref_attr[$link_id])) + $result .= $this->ref_attr[$link_id]; + $result .= $this->empty_element_suffix; + $result = $this->hashPart($result); + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + return $result; + } + protected function _doImages_inline_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + $attr = $this->doExtraAttributes("img", $dummy =& $matches[8]); + + $alt_text = $this->encodeAttribute($alt_text); + $url = $this->encodeAttribute($url); + $result = "\"$alt_text\"";encodeAttribute($title); + $result .= " title=\"$title\""; # $title already quoted + } + $result .= $attr; + $result .= $this->empty_element_suffix; + + return $this->hashPart($result); + } + + + protected function doHeaders($text) { + # + # Redefined to add id and class attribute support. + # + # Setext-style headers: + # Header 1 {#header1} + # ======== + # + # Header 2 {#header2 .class1 .class2} + # -------- + # + $text = preg_replace_callback( + '{ + (^.+?) # $1: Header text + (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes + [ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer + }mx', + array(&$this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 {#header1} + # ## Header 2 {#header2} + # ## Header 2 with closing hashes ## {#header3.class1.class2} + # ... + # ###### Header 6 {.class2} + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes + [ ]* + \n+ + }xm', + array(&$this, '_doHeaders_callback_atx'), $text); + + return $text; + } + protected function _doHeaders_callback_setext($matches) { + if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) + return $matches[0]; + $level = $matches[3]{0} == '=' ? 1 : 2; + $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]); + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + protected function _doHeaders_callback_atx($matches) { + $level = strlen($matches[1]); + $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[3]); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + + protected function doTables($text) { + # + # Form HTML tables. + # + $less_than_tab = $this->tab_width - 1; + # + # Find tables with leading pipe. + # + # | Header 1 | Header 2 + # | -------- | -------- + # | Cell 1 | Cell 2 + # | Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] # Optional leading pipe (present) + (.+) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + [ ]* # Allowed whitespace. + [|] .* \n # Row content. + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array(&$this, '_doTable_leadingPipe_callback'), $text); + + # + # Find tables without leading pipe. + # + # Header 1 | Header 2 + # -------- | -------- + # Cell 1 | Cell 2 + # Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + (\S.*[|].*) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + .* [|] .* \n # Row content + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array(&$this, '_DoTable_callback'), $text); + + return $text; + } + protected function _doTable_leadingPipe_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove leading pipe for each row. + $content = preg_replace('/^ *[|]/m', '', $content); + + return $this->_doTable_callback(array($matches[0], $head, $underline, $content)); + } + protected function _doTable_makeAlignAttr($alignname) + { + if (empty($this->table_align_class_tmpl)) + return " align=\"$alignname\""; + + $classname = str_replace('%%', $alignname, $this->table_align_class_tmpl); + return " class=\"$classname\""; + } + protected function _doTable_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove any tailing pipes for each line. + $head = preg_replace('/[|] *$/m', '', $head); + $underline = preg_replace('/[|] *$/m', '', $underline); + $content = preg_replace('/[|] *$/m', '', $content); + + # Reading alignement from header underline. + $separators = preg_split('/ *[|] */', $underline); + foreach ($separators as $n => $s) { + if (preg_match('/^ *-+: *$/', $s)) + $attr[$n] = $this->_doTable_makeAlignAttr('right'); + else if (preg_match('/^ *:-+: *$/', $s)) + $attr[$n] = $this->_doTable_makeAlignAttr('center'); + else if (preg_match('/^ *:-+ *$/', $s)) + $attr[$n] = $this->_doTable_makeAlignAttr('left'); + else + $attr[$n] = ''; + } + + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $head = $this->parseSpan($head); + $headers = preg_split('/ *[|] */', $head); + $col_count = count($headers); + $attr = array_pad($attr, $col_count, ''); + + # Write column headers. + $text = "\n"; + $text .= "\n"; + $text .= "\n"; + foreach ($headers as $n => $header) + $text .= " ".$this->runSpanGamut(trim($header))."\n"; + $text .= "\n"; + $text .= "\n"; + + # Split content by row. + $rows = explode("\n", trim($content, "\n")); + + $text .= "\n"; + foreach ($rows as $row) { + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $row = $this->parseSpan($row); + + # Split row by cell. + $row_cells = preg_split('/ *[|] */', $row, $col_count); + $row_cells = array_pad($row_cells, $col_count, ''); + + $text .= "\n"; + foreach ($row_cells as $n => $cell) + $text .= " ".$this->runSpanGamut(trim($cell))."\n"; + $text .= "\n"; + } + $text .= "\n"; + $text .= "
    "; + + return $this->hashBlock($text) . "\n"; + } + + + protected function doDefLists($text) { + # + # Form HTML definition lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable pattern to match any entire dl list: + $whole_list_re = '(?> + ( # $1 = whole list + ( # $2 + [ ]{0,'.$less_than_tab.'} + ((?>.*\S.*\n)+) # $3 = defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?s:.+?) + ( # $4 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another term + [ ]{0,'.$less_than_tab.'} + (?: \S.*\n )+? # defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?! # Negative lookahead for another definition + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + ) + ) + )'; // mx + + $text = preg_replace_callback('{ + (?>\A\n?|(?<=\n\n)) + '.$whole_list_re.' + }mx', + array(&$this, '_doDefLists_callback'), $text); + + return $text; + } + protected function _doDefLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $list = $matches[1]; + + # Turn double returns into triple returns, so that we can make a + # paragraph for the last item in a list, if necessary: + $result = trim($this->processDefListItems($list)); + $result = "
    \n" . $result . "\n
    "; + return $this->hashBlock($result) . "\n\n"; + } + + + protected function processDefListItems($list_str) { + # + # Process the contents of a single definition list, splitting it + # into individual term and definition list items. + # + $less_than_tab = $this->tab_width - 1; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + # Process definition terms. + $list_str = preg_replace_callback('{ + (?>\A\n?|\n\n+) # leading line + ( # definition terms = $1 + [ ]{0,'.$less_than_tab.'} # leading whitespace + (?!\:[ ]|[ ]) # negative lookahead for a definition + # mark (colon) or more whitespace. + (?> \S.* \n)+? # actual term (not whitespace). + ) + (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed + # with a definition mark. + }xm', + array(&$this, '_processDefListItems_callback_dt'), $list_str); + + # Process actual definitions. + $list_str = preg_replace_callback('{ + \n(\n+)? # leading line = $1 + ( # marker space = $2 + [ ]{0,'.$less_than_tab.'} # whitespace before colon + \:[ ]+ # definition mark (colon) + ) + ((?s:.+?)) # definition text = $3 + (?= \n+ # stop at next definition mark, + (?: # next term or end of text + [ ]{0,'.$less_than_tab.'} \:[ ] | +
    | \z + ) + ) + }xm', + array(&$this, '_processDefListItems_callback_dd'), $list_str); + + return $list_str; + } + protected function _processDefListItems_callback_dt($matches) { + $terms = explode("\n", trim($matches[1])); + $text = ''; + foreach ($terms as $term) { + $term = $this->runSpanGamut(trim($term)); + $text .= "\n
    " . $term . "
    "; + } + return $text . "\n"; + } + protected function _processDefListItems_callback_dd($matches) { + $leading_line = $matches[1]; + $marker_space = $matches[2]; + $def = $matches[3]; + + if ($leading_line || preg_match('/\n{2,}/', $def)) { + # Replace marker with the appropriate whitespace indentation + $def = str_repeat(' ', strlen($marker_space)) . $def; + $def = $this->runBlockGamut($this->outdent($def . "\n\n")); + $def = "\n". $def ."\n"; + } + else { + $def = rtrim($def); + $def = $this->runSpanGamut($this->outdent($def)); + } + + return "\n
    " . $def . "
    \n"; + } + + + protected function doFencedCodeBlocks($text) { + # + # Adding the fenced code block syntax to regular Markdown: + # + # ~~~ + # Code block + # ~~~ + # + $less_than_tab = $this->tab_width; + + $text = preg_replace_callback('{ + (?:\n|\A) + # 1: Opening marker + ( + ~{3,} # Marker: three tilde or more. + ) + [ ]* + (?: + \.?([-_:a-zA-Z0-9]+) # 2: standalone class name + | + '.$this->id_class_attr_catch_re.' # 3: Extra attributes + )? + [ ]* \n # Whitespace and newline following marker. + + # 4: Content + ( + (?> + (?!\1 [ ]* \n) # Not a closing marker. + .*\n+ + )+ + ) + + # Closing marker. + \1 [ ]* \n + }xm', + array(&$this, '_doFencedCodeBlocks_callback'), $text); + + return $text; + } + protected function _doFencedCodeBlocks_callback($matches) { + $classname =& $matches[2]; + $attrs =& $matches[3]; + $codeblock = $matches[4]; + $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); + $codeblock = preg_replace_callback('/^\n+/', + array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock); + + if ($classname != "") { + if ($classname{0} == '.') + $classname = substr($classname, 1); + $attr_str = ' class="'.$this->code_class_prefix.$classname.'"'; + } else { + $attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? "pre" : "code", $attrs); + } + $pre_attr_str = $this->code_attr_on_pre ? $attr_str : ''; + $code_attr_str = $this->code_attr_on_pre ? '' : $attr_str; + $codeblock = "$codeblock
    "; + + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + protected function _doFencedCodeBlocks_newlines($matches) { + return str_repeat("empty_element_suffix", + strlen($matches[0])); + } + + + # + # Redefining emphasis markers so that emphasis by underscore does not + # work in the middle of a word. + # + protected $em_relist = array( + '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

    tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + $value = trim($this->runSpanGamut($value)); + + # Check if this should be enclosed in a paragraph. + # Clean tag hashes & block tag hashes are left alone. + $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value); + + if ($is_p) { + $value = "

    $value

    "; + } + $grafs[$key] = $value; + } + + # Join grafs in one text, then unhash HTML tags. + $text = implode("\n\n", $grafs); + + # Finish by removing any tag hashes still present in $text. + $text = $this->unhash($text); + + return $text; + } + + + ### Footnotes + + protected function stripFootnotes($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [^id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1 + [ ]* + \n? # maybe *one* newline + ( # text = $2 (no blank lines allowed) + (?: + .+ # actual text + | + \n # newlines but + (?!\[\^.+?\]:\s)# negative lookahead for footnote marker. + (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed + # by non-indented content + )* + ) + }xm', + array(&$this, '_stripFootnotes_callback'), + $text); + return $text; + } + protected function _stripFootnotes_callback($matches) { + $note_id = $this->fn_id_prefix . $matches[1]; + $this->footnotes[$note_id] = $this->outdent($matches[2]); + return ''; # String that will replace the block + } + + + protected function doFootnotes($text) { + # + # Replace footnote references in $text [^id] with a special text-token + # which will be replaced by the actual footnote marker in appendFootnotes. + # + if (!$this->in_anchor) { + $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text); + } + return $text; + } + + + protected function appendFootnotes($text) { + # + # Append footnote list to text. + # + $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array(&$this, '_appendFootnotes_callback'), $text); + + if (!empty($this->footnotes_ordered)) { + $text .= "\n\n"; + $text .= "
    \n"; + $text .= "empty_element_suffix ."\n"; + $text .= "
      \n\n"; + + $attr = " rev=\"footnote\""; + if ($this->fn_backlink_class != "") { + $class = $this->fn_backlink_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_backlink_title != "") { + $title = $this->fn_backlink_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + $num = 0; + + while (!empty($this->footnotes_ordered)) { + $footnote = reset($this->footnotes_ordered); + $note_id = key($this->footnotes_ordered); + unset($this->footnotes_ordered[$note_id]); + $ref_count = $this->footnotes_ref_count[$note_id]; + unset($this->footnotes_ref_count[$note_id]); + unset($this->footnotes[$note_id]); + + $footnote .= "\n"; # Need to append newline before parsing. + $footnote = $this->runBlockGamut("$footnote\n"); + $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array(&$this, '_appendFootnotes_callback'), $footnote); + + $attr = str_replace("%%", ++$num, $attr); + $note_id = $this->encodeAttribute($note_id); + + # Prepare backlink, multiple backlinks if multiple references + $backlink = ""; + for ($ref_num = 2; $ref_num <= $ref_count; ++$ref_num) { + $backlink .= " "; + } + # Add backlink to last paragraph; create new paragraph if needed. + if (preg_match('{

      $}', $footnote)) { + $footnote = substr($footnote, 0, -4) . " $backlink

      "; + } else { + $footnote .= "\n\n

      $backlink

      "; + } + + $text .= "
    1. \n"; + $text .= $footnote . "\n"; + $text .= "
    2. \n\n"; + } + + $text .= "
    \n"; + $text .= "
    "; + } + return $text; + } + protected function _appendFootnotes_callback($matches) { + $node_id = $this->fn_id_prefix . $matches[1]; + + # Create footnote marker only if it has a corresponding footnote *and* + # the footnote hasn't been used by another marker. + if (isset($this->footnotes[$node_id])) { + $num =& $this->footnotes_numbers[$node_id]; + if (!isset($num)) { + # Transfer footnote content to the ordered list and give it its + # number + $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id]; + $this->footnotes_ref_count[$node_id] = 1; + $num = $this->footnote_counter++; + $ref_count_mark = ''; + } else { + $ref_count_mark = $this->footnotes_ref_count[$node_id] += 1; + } + + $attr = ""; + if ($this->fn_link_class != "") { + $class = $this->fn_link_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_link_title != "") { + $title = $this->fn_link_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + + $attr = str_replace("%%", $num, $attr); + $node_id = $this->encodeAttribute($node_id); + + return + "". + "$num". + ""; + } + + return "[^".$matches[1]."]"; + } + + + ### Abbreviations ### + + protected function stripAbbreviations($text) { + # + # Strips abbreviations from text, stores titles in hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [id]*: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1 + (.*) # text = $2 (no blank lines allowed) + }xm', + array(&$this, '_stripAbbreviations_callback'), + $text); + return $text; + } + protected function _stripAbbreviations_callback($matches) { + $abbr_word = $matches[1]; + $abbr_desc = $matches[2]; + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + return ''; # String that will replace the block + } + + + protected function doAbbreviations($text) { + # + # Find defined abbreviations in text and wrap them in elements. + # + if ($this->abbr_word_re) { + // cannot use the /x modifier because abbr_word_re may + // contain significant spaces: + $text = preg_replace_callback('{'. + '(?abbr_word_re.')'. + '(?![\w\x1A])'. + '}', + array(&$this, '_doAbbreviations_callback'), $text); + } + return $text; + } + protected function _doAbbreviations_callback($matches) { + $abbr = $matches[0]; + if (isset($this->abbr_desciptions[$abbr])) { + $desc = $this->abbr_desciptions[$abbr]; + if (empty($desc)) { + return $this->hashPart("$abbr"); + } else { + $desc = $this->encodeAttribute($desc); + return $this->hashPart("$abbr"); + } + } else { + return $matches[0]; + } + } + +} + + +?> \ No newline at end of file diff --git a/system/lib/Michelf/MarkdownExtra.php b/system/lib/Michelf/MarkdownExtra.php new file mode 100644 index 0000000..267bf16 --- /dev/null +++ b/system/lib/Michelf/MarkdownExtra.php @@ -0,0 +1,40 @@ + +# +# Original Markdown +# Copyright (c) 2004-2006 John Gruber +# +# +namespace Michelf; + + +# Just force Michelf/Markdown.php to load. This is needed to load +# the temporary implementation class. See below for details. +\Michelf\Markdown::MARKDOWNLIB_VERSION; + +# +# Markdown Extra Parser Class +# +# Note: Currently the implementation resides in the temporary class +# \Michelf\MarkdownExtra_TmpImpl (in the same file as \Michelf\Markdown). +# This makes it easier to propagate the changes between the three different +# packaging styles of PHP Markdown. Once this issue is resolved, the +# _MarkdownExtra_TmpImpl will disappear and this one will contain the code. +# + +class MarkdownExtra extends \Michelf\_MarkdownExtra_TmpImpl { + + ### Parser Implementation ### + + # Temporarily, the implemenation is in the _MarkdownExtra_TmpImpl class. + # See note above. + +} + + +?> \ No newline at end of file diff --git a/system/lib/Michelf/extra/License.md b/system/lib/Michelf/extra/License.md new file mode 100644 index 0000000..027becb --- /dev/null +++ b/system/lib/Michelf/extra/License.md @@ -0,0 +1,36 @@ +PHP Markdown Lib +Copyright (c) 2004-2013 Michel Fortin + +All rights reserved. + +Based on Markdown +Copyright (c) 2003-2006 John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. diff --git a/system/lib/Michelf/extra/Readme.md b/system/lib/Michelf/extra/Readme.md new file mode 100644 index 0000000..8ee5fae --- /dev/null +++ b/system/lib/Michelf/extra/Readme.md @@ -0,0 +1,259 @@ +PHP Markdown +============ + +PHP Markdown Lib 1.3 - 11 Apr 2013 + +by Michel Fortin + + +based on Markdown by John Gruber + + + +Introduction +------------ + +This is a library package that includes the PHP Markdown parser and its +sibling PHP Markdown Extra which additional features. + +Markdown is a text-to-HTML conversion tool for web writers. Markdown +allows you to write using an easy-to-read, easy-to-write plain text +format, then convert it to structurally valid XHTML (or HTML). + +"Markdown" is two things: a plain text markup syntax, and a software +tool, written in Perl, that converts the plain text markup to HTML. +PHP Markdown is a port to PHP of the original Markdown program by +John Gruber. + +PHP Markdown can work as a plug-in for WordPress, as a modifier for +the Smarty templating engine, or as a replacement for Textile +formatting in any software that supports Textile. + +Full documentation of Markdown's syntax is available on John's +Markdown page: + + +Requirement +----------- + +This library package requires PHP 5.3 or later. + +Note: The older plugin/library hybrid package for PHP Markdown and +PHP Markdown Extra is still maintained and will work with PHP 4.0.5 and later. + +Before PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small +in many situations. You might need to set it to higher values. Later PHP +releases defaults to 1 000 000, which is usually fine. + + +Usage +----- + +This library package is meant to be used with class autoloading. For autoloading +to work, your project needs have setup a PSR-0-compatible autoloader. See the +included Readme.php file for a minimal autoloader setup. (If you don't want to +use autoloading you can do a classic `require_once` to manually include the +files prior use instead.) + +With class autoloading in place, putting the 'Michelf' folder in your +include path should be enough for this to work: + + use \Michelf\Markdown; + $my_html = Markdown::defaultTransform($my_text); + +Markdown Extra syntax is also available the same way: + + use \Michelf\MarkdownExtra; + $my_html = MarkdownExtra::defaultTransform($my_text); + +If you wish to use PHP Markdown with another text filter function +built to parse HTML, you should filter the text *after* the `transform` +function call. This is an example with [PHP SmartyPants][psp]: + + use \Michelf\Markdown, \Michelf\SmartyPants; + $my_html = Markdown::defaultTransform($my_text); + $my_html = SmartyPants::defaultTransform($my_html); + +All these examples are using the static `defaultTransform` static function +found inside the parser class. If you want to customize the parser +configuration, you can also instantiate it directly and change some +configuration variables: + + use \Michelf\MarkdownExtra; + $parser = new MarkdownExtra; + $parser->fn_id_prefix = "post22-"; + $my_html = $parser->transform($my_text); + + +Usage +----- + +This library package is meant to be used with class autoloading. For autoloading +to work, your project needs have setup a PSR-0-compatible autoloader. See the +included Readme.php file for a minimal autoloader setup. (If you don't want to +use autoloading you can do a classic `require_once` to manually include the +files prior use instead.) + +With class autoloading in place, putting the 'Michelf' folder in your +include path should be enough for this to work: + + use \Michelf\Markdown; + $my_html = Markdown::defaultTransform($my_text); + +Markdown Extra syntax is also available the same way: + + use \Michelf\MarkdownExtra; + $my_html = MarkdownExtra::defaultTransform($my_text); + +If you wish to use PHP Markdown with another text filter function +built to parse HTML, you should filter the text *after* the `transform` +function call. This is an example with [PHP SmartyPants][psp]: + + use \Michelf\Markdown, \Michelf\SmartyPants; + $my_html = Markdown::defaultTransform($my_text); + $my_html = SmartyPants::defaultTransform($my_html); + +All these examples are using the static `defaultTransform` static function +found inside the parser class. If you want to customize the parser +configuration, you can also instantiate it directly and change some +configuration variables: + + use \Michelf\MarkdownExtra; + $parser = new MarkdownExtra; + $parser->fn_id_prefix = "post22-"; + $my_html = $parser->transform($my_text); + +To learn more, see the full list of [configuration variables]. + + [configuration variables]: http://michelf.ca/project/php-markdown/configuration/ + + +Public API and Versionning Policy +--------------------------------- + +Version numbers are of the form *major*.*minor*.*patch*. + +The public API of PHP Markdown consist of the two parser classes `Markdown` +and `MarkdownExtra`, their constructors, the `transform` and `defaultTransform` +functions and their configuration variables. The public API is stable for +a given major version number. It might get additions when the minor version +number increments. + +**Protected members are not considered public API.** This is unconventionnal +and deserves an explanation. Incrementing the major version number every time +the underlying implementation of something changes is going to give nonsential +version numbers for the vast majority of people who just use the parser. +Protected members are meant to create parser subclasses that behave in +different ways. Very few people create parser subclasses. I don't want to +discourage it by making everything private, but at the same time I can't +guarenty any stable hook between versions if you use protected members. + +**Syntax changes** will increment the minor number for new features, and the +patch number for small corrections. A *new feature* is something that needs a +change in the syntax documentation. Note that since PHP Markdown Lib includes +two parsers, a syntax change for either of them will increment the minor +number. Also note that there is nothigng perfectly backward-compatible with the +Markdown syntax: all inputs are always valid, so new features always replace +something that was previously legal, although generally non-sensial to do. + + +Bugs +---- + +To file bug reports please send email to: + + +Please include with your report: (1) the example input; (2) the output you +expected; (3) the output PHP Markdown actually produced. + +If you have a problem where Markdown gives you an empty result, first check +that the backtrack limit is not too low by running `php --info | grep pcre`. +See Installation and Requirement above for details. + + +Version History +--------------- + +PHP Markdown Lib 1.3 (11 Apr 2013): + +This is the first release of PHP Markdown Lib. This package requires PHP +version 4.3 or later and is designed to work with PSR-0 autoloading and, +optionally with Composer. Here is a list of the changes since +PHP Markdown Extra 1.2.6: + +* Plugin interface for Wordpress and other systems is no longer present in + the Lib package. The classic package is still available if you need it: + + +* Added `public` and `protected` protection attributes, plus a section about + what is "public API" and what isn't in the Readme file. + +* Changed HTML output for footnotes: now instead of adding `rel` and `rev` + attributes, footnotes links have the class name `footnote-ref` and + backlinks `footnote-backref`. + +* Fixed some regular expressions to make PCRE not shout warnings about POSIX + collation classes (dependent on your version of PCRE). + +* Added optional class and id attributes to images and links using the same + syntax as for headers: + + [link](url){#id .class} + ![img](url){#id .class} + + It work too for reference-style links and images. In this case you need + to put those attributes at the reference definition: + + [link][linkref] or [linkref] + ![img][linkref] + + [linkref]: url "optional title" {#id .class} + +* Fixed a PHP notice message triggered when some table column separator + markers are missing on the separator line below column headers. + +* Fixed a small mistake that could cause the parser to retain an invalid + state related to parsing links across multiple runs. This was never + observed (that I know of), but it's still worth fixing. + + +Copyright and License +--------------------- + +PHP Markdown Lib +Copyright (c) 2004-2013 Michel Fortin + +All rights reserved. + +Based on Markdown +Copyright (c) 2003-2005 John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. diff --git a/system/lib/Michelf/extra/Readme.php b/system/lib/Michelf/extra/Readme.php new file mode 100644 index 0000000..75e23e0 --- /dev/null +++ b/system/lib/Michelf/extra/Readme.php @@ -0,0 +1,31 @@ + + + + + PHP Markdown Lib - Readme + + + + + diff --git a/system/lib/Michelf/extra/composer.json b/system/lib/Michelf/extra/composer.json new file mode 100644 index 0000000..670fc96 --- /dev/null +++ b/system/lib/Michelf/extra/composer.json @@ -0,0 +1,31 @@ +{ + "name": "michelf/php-markdown", + "type": "library", + "description": "PHP Markdown", + "homepage": "http://michelf.ca/projects/php-markdown/", + "keywords": ["markdown"], + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "http://michelf.ca/", + "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "http://daringfireball.net/" + } + ], + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "psr-0": { "Michelf": "" } + }, + "extra": { + "branch-alias": { + "dev-lib": "1.3.x-dev" + } + } +} diff --git a/system/lib/autoload.inc.php b/system/lib/autoload.inc.php new file mode 100644 index 0000000..0057f5e --- /dev/null +++ b/system/lib/autoload.inc.php @@ -0,0 +1,2 @@ +logged){ + return false;} //alrdy logged(this prevents proper thrown value for every system exception) + + \SYSTEM\DBD\SYS_LOG_INSERT::Q1( array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5), + $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), + array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, + array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, + ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null, $thrown ? 1 : 0), + array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5),date('Y-m-d H:i:s', microtime(true)), + $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), + array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, + array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, + ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null,$thrown)); + if(\property_exists(get_class($E), 'logged')){ + $E->logged = true;} //we just did log + } catch (\Exception $E){return false;} //Error -> Ignore + + return false; //We just log and do not handle the error! + } +} \ No newline at end of file diff --git a/system/log/error_handler/error_handler_jsonoutput.php b/system/log/error_handler/error_handler_jsonoutput.php new file mode 100644 index 0000000..2058311 --- /dev/null +++ b/system/log/error_handler/error_handler_jsonoutput.php @@ -0,0 +1,15 @@ + Ignore + return die(); //die is required cuz else some fatals cant be catched properly + } + } +} \ No newline at end of file diff --git a/system/log/exceptions/COUNTER.php b/system/log/exceptions/COUNTER.php new file mode 100644 index 0000000..26dcfbd --- /dev/null +++ b/system/log/exceptions/COUNTER.php @@ -0,0 +1,5 @@ + 0, 'status' => false, 'result' => $error); + header('Access-Control-Allow-Origin: *');//allow cross domain calls + header('content-type: application/json'); + return json_encode($result);} + return $bufferContent; + } +} + diff --git a/system/log/register_exception_shortcut.php b/system/log/register_exception_shortcut.php new file mode 100644 index 0000000..1e0f90e --- /dev/null +++ b/system/log/register_exception_shortcut.php @@ -0,0 +1,2 @@ +getMessage(); + $error['code'] = $e->getCode(); + $error['file'] = $e->getFile(); + $error['line'] = $e->getLine(); + $error['trace'] = array_slice(explode('#', $e->getTraceAsString()), 1, -1); + + return self::toString($error, self::JSONRESULT_ERROR); + } + + //Returns OK status + public static function ok(){ + return self::toString(NULL);} +} \ No newline at end of file diff --git a/system/log/result_shortcut/JsonResult.php b/system/log/result_shortcut/JsonResult.php new file mode 100644 index 0000000..30dabf6 --- /dev/null +++ b/system/log/result_shortcut/JsonResult.php @@ -0,0 +1,3 @@ +next()){ + $row['url'] = \SYSTEM\PAGE\replace::replace($row['url'], $vars); + $row['css'] = $row['js'] = array(); + if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'css') && \is_callable($row['php_class'].'::css')){ + $row['css'] = array_merge($row['css'], call_user_func($row['php_class'].'::css'));} + if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'js') && \is_callable($row['php_class'].'::js')){ + $row['js'] = array_merge($row['js'], call_user_func($row['php_class'].'::js'));} + $result[] = $row;} + return $returnasjson ? \SYSTEM\LOG\JsonResult::toString($result) : $result;} +} \ No newline at end of file diff --git a/system/page/autoload.inc.php b/system/page/autoload.inc.php new file mode 100644 index 0000000..33a05ec --- /dev/null +++ b/system/page/autoload.inc.php @@ -0,0 +1,2 @@ +$value){ + if(!is_array($value)){ + $search[] = '/\${'.$key.'}/'; + $replace[] = $value;} + } + return @preg_replace($search, $replace, $text); + } + public static function replaceFile($path, $vars){ + $buffer = file_get_contents($path); + return self::replace($buffer, $vars);} +} \ No newline at end of file diff --git a/system/readme.md b/system/readme.md new file mode 100644 index 0000000..ec83551 --- /dev/null +++ b/system/readme.md @@ -0,0 +1,26 @@ +system +====== +System - PHP Framework + + +License +======= +Copyright (c) 2013-2014 Ulf Gebhardt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/system/sai/autoload.inc.php b/system/sai/autoload.inc.php new file mode 100644 index 0000000..b7e18c5 --- /dev/null +++ b/system/sai/autoload.inc.php @@ -0,0 +1,5 @@ +> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + /* + * Bitwise rotate a 32-bit number to the left. + */ + function bit_rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + } + + /* + * These functions implement the four basic operations the algorithm uses. + */ + function md5_cmn(q, a, b, x, s, t) { + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); + } + function md5_ff(a, b, c, d, x, s, t) { + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); + } + function md5_gg(a, b, c, d, x, s, t) { + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); + } + function md5_hh(a, b, c, d, x, s, t) { + return md5_cmn(b ^ c ^ d, a, b, x, s, t); + } + function md5_ii(a, b, c, d, x, s, t) { + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); + } + + /* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + function binl_md5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var i, olda, oldb, oldc, oldd, + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878; + + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + + a = md5_ff(a, b, c, d, x[i], 7, -680876936); + d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i], 20, -373897302); + a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5_hh(d, a, b, c, x[i], 11, -358537222); + c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i], 6, -198630844); + d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return [a, b, c, d]; + } + + /* + * Convert an array of little-endian words to a string + */ + function binl2rstr(input) { + var i, + output = ''; + for (i = 0; i < input.length * 32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF); + } + return output; + } + + /* + * Convert a raw string to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + function rstr2binl(input) { + var i, + output = []; + output[(input.length >> 2) - 1] = undefined; + for (i = 0; i < output.length; i += 1) { + output[i] = 0; + } + for (i = 0; i < input.length * 8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32); + } + return output; + } + + /* + * Calculate the MD5 of a raw string + */ + function rstr_md5(s) { + return binl2rstr(binl_md5(rstr2binl(s), s.length * 8)); + } + + /* + * Calculate the HMAC-MD5, of a key and some data (raw strings) + */ + function rstr_hmac_md5(key, data) { + var i, + bkey = rstr2binl(key), + ipad = [], + opad = [], + hash; + ipad[15] = opad[15] = undefined; + if (bkey.length > 16) { + bkey = binl_md5(bkey, key.length * 8); + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8); + return binl2rstr(binl_md5(opad.concat(hash), 512 + 128)); + } + + /* + * Convert a raw string to a hex string + */ + function rstr2hex(input) { + var hex_tab = '0123456789abcdef', + output = '', + x, + i; + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i); + output += hex_tab.charAt((x >>> 4) & 0x0F) + + hex_tab.charAt(x & 0x0F); + } + return output; + } + + /* + * Encode a string as utf-8 + */ + function str2rstr_utf8(input) { + return unescape(encodeURIComponent(input)); + } + + /* + * Take string arguments and return either raw or hex encoded strings + */ + function raw_md5(s) { + return rstr_md5(str2rstr_utf8(s)); + } + function hex_md5(s) { + return rstr2hex(raw_md5(s)); + } + function raw_hmac_md5(k, d) { + return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)); + } + function hex_hmac_md5(k, d) { + return rstr2hex(raw_hmac_md5(k, d)); + } + + $.md5 = function (string, key, raw) { + if (!key) { + if (!raw) { + return hex_md5(string); + } else { + return raw_md5(string); + } + } + if (!raw) { + return hex_hmac_md5(key, string); + } else { + return raw_hmac_md5(key, string); + } + }; + +}(typeof jQuery === 'function' ? jQuery : this)); \ No newline at end of file diff --git a/system/sai/js/crypto/jquery.sha1.js b/system/sai/js/crypto/jquery.sha1.js new file mode 100644 index 0000000..40c5725 --- /dev/null +++ b/system/sai/js/crypto/jquery.sha1.js @@ -0,0 +1,170 @@ + +/** + * jQuery SHA1 hash algorithm function + * + * + * Calculate the sha1 hash of a String + * String $.sha1 ( String str ) + * + * + * Calculates the sha1 hash of str using the US Secure Hash Algorithm 1. + * SHA-1 the Secure Hash Algorithm (SHA) was developed by NIST and is specified in the Secure Hash Standard (SHS, FIPS 180). + * This script is used to process variable length message into a fixed-length output using the SHA-1 algorithm. It is fully compatible with UTF-8 encoding. + * If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag). + * This function orginally get from the WebToolkit and rewrite for using as the jQuery plugin. + * + * Example + * Code + * + * $.sha1("I'm Persian."); + * + * Result + * + * "1d302f9dc925d62fc859055999d2052e274513ed" + * + * + * @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com > + * @link http://www.semnanweb.com/jquery-plugin/sha1.html + * @see http://www.webtoolkit.info/ + * @license http://www.gnu.org/licenses/gpl.html [GNU General Public License] + * @param {jQuery} {sha1:function(string)) + * @return string + */ + +(function($){ + + var rotateLeft = function(lValue, iShiftBits) { + return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); + } + + var lsbHex = function(value) { + var string = ""; + var i; + var vh; + var vl; + for(i = 0;i <= 6;i += 2) { + vh = (value>>>(i * 4 + 4))&0x0f; + vl = (value>>>(i*4))&0x0f; + string += vh.toString(16) + vl.toString(16); + } + return string; + }; + + var cvtHex = function(value) { + var string = ""; + var i; + var v; + for(i = 7;i >= 0;i--) { + v = (value>>>(i * 4))&0x0f; + string += v.toString(16); + } + return string; + }; + + var uTF8Encode = function(string) { + string = string.replace(/\x0d\x0a/g, "\x0a"); + var output = ""; + for (var n = 0; n < string.length; n++) { + var c = string.charCodeAt(n); + if (c < 128) { + output += String.fromCharCode(c); + } else if ((c > 127) && (c < 2048)) { + output += String.fromCharCode((c >> 6) | 192); + output += String.fromCharCode((c & 63) | 128); + } else { + output += String.fromCharCode((c >> 12) | 224); + output += String.fromCharCode(((c >> 6) & 63) | 128); + output += String.fromCharCode((c & 63) | 128); + } + } + return output; + }; + + $.extend({ + sha1: function(string) { + var blockstart; + var i, j; + var W = new Array(80); + var H0 = 0x67452301; + var H1 = 0xEFCDAB89; + var H2 = 0x98BADCFE; + var H3 = 0x10325476; + var H4 = 0xC3D2E1F0; + var A, B, C, D, E; + var tempValue; + string = uTF8Encode(string); + var stringLength = string.length; + var wordArray = new Array(); + for(i = 0;i < stringLength - 3;i += 4) { + j = string.charCodeAt(i)<<24 | string.charCodeAt(i + 1)<<16 | string.charCodeAt(i + 2)<<8 | string.charCodeAt(i + 3); + wordArray.push(j); + } + switch(stringLength % 4) { + case 0: + i = 0x080000000; + break; + case 1: + i = string.charCodeAt(stringLength - 1)<<24 | 0x0800000; + break; + case 2: + i = string.charCodeAt(stringLength - 2)<<24 | string.charCodeAt(stringLength - 1)<<16 | 0x08000; + break; + case 3: + i = string.charCodeAt(stringLength - 3)<<24 | string.charCodeAt(stringLength - 2)<<16 | string.charCodeAt(stringLength - 1)<<8 | 0x80; + break; + } + wordArray.push(i); + while((wordArray.length % 16) != 14 ) wordArray.push(0); + wordArray.push(stringLength>>>29); + wordArray.push((stringLength<<3)&0x0ffffffff); + for(blockstart = 0;blockstart < wordArray.length;blockstart += 16) { + for(i = 0;i < 16;i++) W[i] = wordArray[blockstart+i]; + for(i = 16;i <= 79;i++) W[i] = rotateLeft(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); + A = H0; + B = H1; + C = H2; + D = H3; + E = H4; + for(i = 0;i <= 19;i++) { + tempValue = (rotateLeft(A, 5) + ((B&C) | (~B&D)) + E + W[i] + 0x5A827999) & 0x0ffffffff; + E = D; + D = C; + C = rotateLeft(B, 30); + B = A; + A = tempValue; + } + for(i = 20;i <= 39;i++) { + tempValue = (rotateLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff; + E = D; + D = C; + C = rotateLeft(B, 30); + B = A; + A = tempValue; + } + for(i = 40;i <= 59;i++) { + tempValue = (rotateLeft(A, 5) + ((B&C) | (B&D) | (C&D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff; + E = D; + D = C; + C = rotateLeft(B, 30); + B = A; + A = tempValue; + } + for(i = 60;i <= 79;i++) { + tempValue = (rotateLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff; + E = D; + D = C; + C = rotateLeft(B, 30); + B = A; + A = tempValue; + } + H0 = (H0 + A) & 0x0ffffffff; + H1 = (H1 + B) & 0x0ffffffff; + H2 = (H2 + C) & 0x0ffffffff; + H3 = (H3 + D) & 0x0ffffffff; + H4 = (H4 + E) & 0x0ffffffff; + } + var tempValue = cvtHex(H0) + cvtHex(H1) + cvtHex(H2) + cvtHex(H3) + cvtHex(H4); + return tempValue.toLowerCase(); + } + }); +})(jQuery); \ No newline at end of file diff --git a/system/sai/js/jqBootstrapValidation.js b/system/sai/js/jqBootstrapValidation.js new file mode 100644 index 0000000..29cbb08 --- /dev/null +++ b/system/sai/js/jqBootstrapValidation.js @@ -0,0 +1,912 @@ +/* jqBootstrapValidation + * A plugin for automating validation on Twitter Bootstrap formatted forms. + * + * v1.3.6 + * + * License: MIT - see LICENSE file + * + * http://ReactiveRaven.github.com/jqBootstrapValidation/ + */ + +(function( $ ){ + + var createdElements = []; + + var defaults = { + options: { + prependExistingHelpBlock: false, + sniffHtml: true, // sniff for 'required', 'maxlength', etc + preventSubmit: true, // stop the form submit event from firing if validation fails + submitError: false, // function called if there is an error when trying to submit + submitSuccess: false, // function called just before a successful submit event is sent to the server + semanticallyStrict: false, // set to true to tidy up generated HTML output + autoAdd: { + helpBlocks: true + }, + filter: function () { + // return $(this).is(":visible"); // only validate elements you can see + return true; // validate everything + } + }, + methods: { + init : function( options ) { + + var settings = $.extend(true, {}, defaults); + + settings.options = $.extend(true, settings.options, options); + + var $siblingElements = this; + + var uniqueForms = $.unique( + $siblingElements.map( function () { + return $(this).parents("form")[0]; + }).toArray() + ); + + $(uniqueForms).bind("submit", function (e) { + var $form = $(this); + var warningsFound = 0; + var $inputs = $form.find("input,textarea,select").not("[type=submit],[type=image]").filter(settings.options.filter); + $inputs.trigger("submit.validation").trigger("validationLostFocus.validation"); + + $inputs.each(function (i, el) { + var $this = $(el), + $controlGroup = $this.parents(".control-group").first(); + if ( + $controlGroup.hasClass("warning") + ) { + $controlGroup.removeClass("warning").addClass("error"); + warningsFound++; + } + }); + + $inputs.trigger("validationLostFocus.validation"); + + if (warningsFound) { + if (settings.options.preventSubmit) { + e.preventDefault(); + } + $form.addClass("error"); + if ($.isFunction(settings.options.submitError)) { + settings.options.submitError($form, e, $inputs.jqBootstrapValidation("collectErrors", true)); + } + } else { + $form.removeClass("error"); + if ($.isFunction(settings.options.submitSuccess)) { + settings.options.submitSuccess($form, e); + } + } + }); + + return this.each(function(){ + + // Get references to everything we're interested in + var $this = $(this), + $controlGroup = $this.parents(".control-group").first(), + $helpBlock = $controlGroup.find(".help-block").first(), + $form = $this.parents("form").first(), + validatorNames = []; + + // create message container if not exists + if (!$helpBlock.length && settings.options.autoAdd && settings.options.autoAdd.helpBlocks) { + $helpBlock = $('
    '); + $controlGroup.find('.controls').append($helpBlock); + createdElements.push($helpBlock[0]); + } + + // ============================================================= + // SNIFF HTML FOR VALIDATORS + // ============================================================= + + // *snort sniff snuffle* + + if (settings.options.sniffHtml) { + var message = ""; + // --------------------------------------------------------- + // PATTERN + // --------------------------------------------------------- + if ($this.attr("pattern") !== undefined) { + message = "Not in the expected format"; + if ($this.data("validationPatternMessage")) { + message = $this.data("validationPatternMessage"); + } + $this.data("validationPatternMessage", message); + $this.data("validationPatternRegex", $this.attr("pattern")); + } + // --------------------------------------------------------- + // MAX + // --------------------------------------------------------- + if ($this.attr("max") !== undefined || $this.attr("aria-valuemax") !== undefined) { + var max = ($this.attr("max") !== undefined ? $this.attr("max") : $this.attr("aria-valuemax")); + message = "Too high: Maximum of '" + max + "'"; + if ($this.data("validationMaxMessage")) { + message = $this.data("validationMaxMessage"); + } + $this.data("validationMaxMessage", message); + $this.data("validationMaxMax", max); + } + // --------------------------------------------------------- + // MIN + // --------------------------------------------------------- + if ($this.attr("min") !== undefined || $this.attr("aria-valuemin") !== undefined) { + var min = ($this.attr("min") !== undefined ? $this.attr("min") : $this.attr("aria-valuemin")); + message = "Too low: Minimum of '" + min + "'"; + if ($this.data("validationMinMessage")) { + message = $this.data("validationMinMessage"); + } + $this.data("validationMinMessage", message); + $this.data("validationMinMin", min); + } + // --------------------------------------------------------- + // MAXLENGTH + // --------------------------------------------------------- + if ($this.attr("maxlength") !== undefined) { + message = "Too long: Maximum of '" + $this.attr("maxlength") + "' characters"; + if ($this.data("validationMaxlengthMessage")) { + message = $this.data("validationMaxlengthMessage"); + } + $this.data("validationMaxlengthMessage", message); + $this.data("validationMaxlengthMaxlength", $this.attr("maxlength")); + } + // --------------------------------------------------------- + // MINLENGTH + // --------------------------------------------------------- + if ($this.attr("minlength") !== undefined) { + message = "Too short: Minimum of '" + $this.attr("minlength") + "' characters"; + if ($this.data("validationMinlengthMessage")) { + message = $this.data("validationMinlengthMessage"); + } + $this.data("validationMinlengthMessage", message); + $this.data("validationMinlengthMinlength", $this.attr("minlength")); + } + // --------------------------------------------------------- + // REQUIRED + // --------------------------------------------------------- + if ($this.attr("required") !== undefined || $this.attr("aria-required") !== undefined) { + message = settings.builtInValidators.required.message; + if ($this.data("validationRequiredMessage")) { + message = $this.data("validationRequiredMessage"); + } + $this.data("validationRequiredMessage", message); + } + // --------------------------------------------------------- + // NUMBER + // --------------------------------------------------------- + if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "number") { + message = settings.builtInValidators.number.message; + if ($this.data("validationNumberMessage")) { + message = $this.data("validationNumberMessage"); + } + $this.data("validationNumberMessage", message); + } + // --------------------------------------------------------- + // EMAIL + // --------------------------------------------------------- + if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "email") { + message = "Not a valid email address"; + if ($this.data("validationValidemailMessage")) { + message = $this.data("validationValidemailMessage"); + } else if ($this.data("validationEmailMessage")) { + message = $this.data("validationEmailMessage"); + } + $this.data("validationValidemailMessage", message); + } + // --------------------------------------------------------- + // MINCHECKED + // --------------------------------------------------------- + if ($this.attr("minchecked") !== undefined) { + message = "Not enough options checked; Minimum of '" + $this.attr("minchecked") + "' required"; + if ($this.data("validationMincheckedMessage")) { + message = $this.data("validationMincheckedMessage"); + } + $this.data("validationMincheckedMessage", message); + $this.data("validationMincheckedMinchecked", $this.attr("minchecked")); + } + // --------------------------------------------------------- + // MAXCHECKED + // --------------------------------------------------------- + if ($this.attr("maxchecked") !== undefined) { + message = "Too many options checked; Maximum of '" + $this.attr("maxchecked") + "' required"; + if ($this.data("validationMaxcheckedMessage")) { + message = $this.data("validationMaxcheckedMessage"); + } + $this.data("validationMaxcheckedMessage", message); + $this.data("validationMaxcheckedMaxchecked", $this.attr("maxchecked")); + } + } + + // ============================================================= + // COLLECT VALIDATOR NAMES + // ============================================================= + + // Get named validators + if ($this.data("validation") !== undefined) { + validatorNames = $this.data("validation").split(","); + } + + // Get extra ones defined on the element's data attributes + $.each($this.data(), function (i, el) { + var parts = i.replace(/([A-Z])/g, ",$1").split(","); + if (parts[0] === "validation" && parts[1]) { + validatorNames.push(parts[1]); + } + }); + + // ============================================================= + // NORMALISE VALIDATOR NAMES + // ============================================================= + + var validatorNamesToInspect = validatorNames; + var newValidatorNamesToInspect = []; + + do // repeatedly expand 'shortcut' validators into their real validators + { + // Uppercase only the first letter of each name + $.each(validatorNames, function (i, el) { + validatorNames[i] = formatValidatorName(el); + }); + + // Remove duplicate validator names + validatorNames = $.unique(validatorNames); + + // Pull out the new validator names from each shortcut + newValidatorNamesToInspect = []; + $.each(validatorNamesToInspect, function(i, el) { + if ($this.data("validation" + el + "Shortcut") !== undefined) { + // Are these custom validators? + // Pull them out! + $.each($this.data("validation" + el + "Shortcut").split(","), function(i2, el2) { + newValidatorNamesToInspect.push(el2); + }); + } else if (settings.builtInValidators[el.toLowerCase()]) { + // Is this a recognised built-in? + // Pull it out! + var validator = settings.builtInValidators[el.toLowerCase()]; + if (validator.type.toLowerCase() === "shortcut") { + $.each(validator.shortcut.split(","), function (i, el) { + el = formatValidatorName(el); + newValidatorNamesToInspect.push(el); + validatorNames.push(el); + }); + } + } + }); + + validatorNamesToInspect = newValidatorNamesToInspect; + + } while (validatorNamesToInspect.length > 0) + + // ============================================================= + // SET UP VALIDATOR ARRAYS + // ============================================================= + + var validators = {}; + + $.each(validatorNames, function (i, el) { + // Set up the 'override' message + var message = $this.data("validation" + el + "Message"); + var hasOverrideMessage = (message !== undefined); + var foundValidator = false; + message = + ( + message + ? message + : "'" + el + "' validation failed " + ) + ; + + $.each( + settings.validatorTypes, + function (validatorType, validatorTemplate) { + if (validators[validatorType] === undefined) { + validators[validatorType] = []; + } + if (!foundValidator && $this.data("validation" + el + formatValidatorName(validatorTemplate.name)) !== undefined) { + validators[validatorType].push( + $.extend( + true, + { + name: formatValidatorName(validatorTemplate.name), + message: message + }, + validatorTemplate.init($this, el) + ) + ); + foundValidator = true; + } + } + ); + + if (!foundValidator && settings.builtInValidators[el.toLowerCase()]) { + + var validator = $.extend(true, {}, settings.builtInValidators[el.toLowerCase()]); + if (hasOverrideMessage) { + validator.message = message; + } + var validatorType = validator.type.toLowerCase(); + + if (validatorType === "shortcut") { + foundValidator = true; + } else { + $.each( + settings.validatorTypes, + function (validatorTemplateType, validatorTemplate) { + if (validators[validatorTemplateType] === undefined) { + validators[validatorTemplateType] = []; + } + if (!foundValidator && validatorType === validatorTemplateType.toLowerCase()) { + $this.data("validation" + el + formatValidatorName(validatorTemplate.name), validator[validatorTemplate.name.toLowerCase()]); + validators[validatorType].push( + $.extend( + validator, + validatorTemplate.init($this, el) + ) + ); + foundValidator = true; + } + } + ); + } + } + + if (! foundValidator) { + $.error("Cannot find validation info for '" + el + "'"); + } + }); + + // ============================================================= + // STORE FALLBACK VALUES + // ============================================================= + + $helpBlock.data( + "original-contents", + ( + $helpBlock.data("original-contents") + ? $helpBlock.data("original-contents") + : $helpBlock.html() + ) + ); + + $helpBlock.data( + "original-role", + ( + $helpBlock.data("original-role") + ? $helpBlock.data("original-role") + : $helpBlock.attr("role") + ) + ); + + $controlGroup.data( + "original-classes", + ( + $controlGroup.data("original-clases") + ? $controlGroup.data("original-classes") + : $controlGroup.attr("class") + ) + ); + + $this.data( + "original-aria-invalid", + ( + $this.data("original-aria-invalid") + ? $this.data("original-aria-invalid") + : $this.attr("aria-invalid") + ) + ); + + // ============================================================= + // VALIDATION + // ============================================================= + + $this.bind( + "validation.validation", + function (event, params) { + + var value = getValue($this); + + // Get a list of the errors to apply + var errorsFound = []; + + $.each(validators, function (validatorType, validatorTypeArray) { + if (value || value.length || (params && params.includeEmpty) || (!!settings.validatorTypes[validatorType].blockSubmit && params && !!params.submitting)) { + $.each(validatorTypeArray, function (i, validator) { + if (settings.validatorTypes[validatorType].validate($this, value, validator)) { + errorsFound.push(validator.message); + } + }); + } + }); + + return errorsFound; + } + ); + + $this.bind( + "getValidators.validation", + function () { + return validators; + } + ); + + // ============================================================= + // WATCH FOR CHANGES + // ============================================================= + $this.bind( + "submit.validation", + function () { + return $this.triggerHandler("change.validation", {submitting: true}); + } + ); + $this.bind( + [ + "keyup", + "focus", + "blur", + "click", + "keydown", + "keypress", + "change" + ].join(".validation ") + ".validation", + function (e, params) { + + var value = getValue($this); + + var errorsFound = []; + + $controlGroup.find("input,textarea,select").each(function (i, el) { + var oldCount = errorsFound.length; + $.each($(el).triggerHandler("validation.validation", params), function (j, message) { + errorsFound.push(message); + }); + if (errorsFound.length > oldCount) { + $(el).attr("aria-invalid", "true"); + } else { + var original = $this.data("original-aria-invalid"); + $(el).attr("aria-invalid", (original !== undefined ? original : false)); + } + }); + + $form.find("input,select,textarea").not($this).not("[name=\"" + $this.attr("name") + "\"]").trigger("validationLostFocus.validation"); + + errorsFound = $.unique(errorsFound.sort()); + + // Were there any errors? + if (errorsFound.length) { + // Better flag it up as a warning. + $controlGroup.removeClass("success error").addClass("warning"); + + // How many errors did we find? + if (settings.options.semanticallyStrict && errorsFound.length === 1) { + // Only one? Being strict? Just output it. + $helpBlock.html(errorsFound[0] + + ( settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : "" )); + } else { + // Multiple? Being sloppy? Glue them together into an UL. + $helpBlock.html("
    • " + errorsFound.join("
    • ") + "
    " + + ( settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : "" )); + } + } else { + $controlGroup.removeClass("warning error success"); + if (value.length > 0) { + $controlGroup.addClass("success"); + } + $helpBlock.html($helpBlock.data("original-contents")); + } + + if (e.type === "blur") { + $controlGroup.removeClass("success"); + } + } + ); + $this.bind("validationLostFocus.validation", function () { + $controlGroup.removeClass("success"); + }); + }); + }, + destroy : function( ) { + + return this.each( + function() { + + var + $this = $(this), + $controlGroup = $this.parents(".control-group").first(), + $helpBlock = $controlGroup.find(".help-block").first(); + + // remove our events + $this.unbind('.validation'); // events are namespaced. + // reset help text + $helpBlock.html($helpBlock.data("original-contents")); + // reset classes + $controlGroup.attr("class", $controlGroup.data("original-classes")); + // reset aria + $this.attr("aria-invalid", $this.data("original-aria-invalid")); + // reset role + $helpBlock.attr("role", $this.data("original-role")); + // remove all elements we created + if (createdElements.indexOf($helpBlock[0]) > -1) { + $helpBlock.remove(); + } + + } + ); + + }, + collectErrors : function(includeEmpty) { + + var errorMessages = {}; + this.each(function (i, el) { + var $el = $(el); + var name = $el.attr("name"); + var errors = $el.triggerHandler("validation.validation", {includeEmpty: true}); + errorMessages[name] = $.extend(true, errors, errorMessages[name]); + }); + + $.each(errorMessages, function (i, el) { + if (el.length === 0) { + delete errorMessages[i]; + } + }); + + return errorMessages; + + }, + hasErrors: function() { + + var errorMessages = []; + + this.each(function (i, el) { + errorMessages = errorMessages.concat( + $(el).triggerHandler("getValidators.validation") ? $(el).triggerHandler("validation.validation", {submitting: true}) : [] + ); + }); + + return (errorMessages.length > 0); + }, + override : function (newDefaults) { + defaults = $.extend(true, defaults, newDefaults); + } + }, + validatorTypes: { + callback: { + name: "callback", + init: function ($this, name) { + return { + validatorName: name, + callback: $this.data("validation" + name + "Callback"), + lastValue: $this.val(), + lastValid: true, + lastFinished: true + }; + }, + validate: function ($this, value, validator) { + if (validator.lastValue === value && validator.lastFinished) { + return !validator.lastValid; + } + + if (validator.lastFinished === true) + { + validator.lastValue = value; + validator.lastValid = true; + validator.lastFinished = false; + + var rrjqbvValidator = validator; + var rrjqbvThis = $this; + executeFunctionByName( + validator.callback, + window, + $this, + value, + function (data) { + if (rrjqbvValidator.lastValue === data.value) { + rrjqbvValidator.lastValid = data.valid; + if (data.message) { + rrjqbvValidator.message = data.message; + } + rrjqbvValidator.lastFinished = true; + rrjqbvThis.data("validation" + rrjqbvValidator.validatorName + "Message", rrjqbvValidator.message); + // Timeout is set to avoid problems with the events being considered 'already fired' + setTimeout(function () { + rrjqbvThis.trigger("change.validation"); + }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst + } + } + ); + } + + return false; + + } + }, + ajax: { + name: "ajax", + init: function ($this, name) { + return { + validatorName: name, + url: $this.data("validation" + name + "Ajax"), + lastValue: $this.val(), + lastValid: true, + lastFinished: true + }; + }, + validate: function ($this, value, validator) { + if (""+validator.lastValue === ""+value && validator.lastFinished === true) { + return validator.lastValid === false; + } + + if (validator.lastFinished === true) + { + validator.lastValue = value; + validator.lastValid = true; + validator.lastFinished = false; + $.ajax({ + url: validator.url, + data: "value=" + value + "&field=" + $this.attr("name"), + dataType: "json", + success: function (data) { + if (""+validator.lastValue === ""+data.value) { + validator.lastValid = !!(data.valid); + if (data.message) { + validator.message = data.message; + } + validator.lastFinished = true; + $this.data("validation" + validator.validatorName + "Message", validator.message); + // Timeout is set to avoid problems with the events being considered 'already fired' + setTimeout(function () { + $this.trigger("change.validation"); + }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst + } + }, + failure: function () { + validator.lastValid = true; + validator.message = "ajax call failed"; + validator.lastFinished = true; + $this.data("validation" + validator.validatorName + "Message", validator.message); + // Timeout is set to avoid problems with the events being considered 'already fired' + setTimeout(function () { + $this.trigger("change.validation"); + }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst + } + }); + } + + return false; + + } + }, + regex: { + name: "regex", + init: function ($this, name) { + return {regex: regexFromString($this.data("validation" + name + "Regex"))}; + }, + validate: function ($this, value, validator) { + return (!validator.regex.test(value) && ! validator.negative) + || (validator.regex.test(value) && validator.negative); + } + }, + required: { + name: "required", + init: function ($this, name) { + return {}; + }, + validate: function ($this, value, validator) { + return !!(value.length === 0 && ! validator.negative) + || !!(value.length > 0 && validator.negative); + }, + blockSubmit: true + }, + match: { + name: "match", + init: function ($this, name) { + var element = $this.parents("form").first().find("[name=\"" + $this.data("validation" + name + "Match") + "\"]").first(); + element.bind("validation.validation", function () { + $this.trigger("change.validation", {submitting: true}); + }); + return {"element": element}; + }, + validate: function ($this, value, validator) { + return (value !== validator.element.val() && ! validator.negative) + || (value === validator.element.val() && validator.negative); + }, + blockSubmit: true + }, + max: { + name: "max", + init: function ($this, name) { + return {max: $this.data("validation" + name + "Max")}; + }, + validate: function ($this, value, validator) { + return (parseFloat(value, 10) > parseFloat(validator.max, 10) && ! validator.negative) + || (parseFloat(value, 10) <= parseFloat(validator.max, 10) && validator.negative); + } + }, + min: { + name: "min", + init: function ($this, name) { + return {min: $this.data("validation" + name + "Min")}; + }, + validate: function ($this, value, validator) { + return (parseFloat(value) < parseFloat(validator.min) && ! validator.negative) + || (parseFloat(value) >= parseFloat(validator.min) && validator.negative); + } + }, + maxlength: { + name: "maxlength", + init: function ($this, name) { + return {maxlength: $this.data("validation" + name + "Maxlength")}; + }, + validate: function ($this, value, validator) { + return ((value.length > validator.maxlength) && ! validator.negative) + || ((value.length <= validator.maxlength) && validator.negative); + } + }, + minlength: { + name: "minlength", + init: function ($this, name) { + return {minlength: $this.data("validation" + name + "Minlength")}; + }, + validate: function ($this, value, validator) { + return ((value.length < validator.minlength) && ! validator.negative) + || ((value.length >= validator.minlength) && validator.negative); + } + }, + maxchecked: { + name: "maxchecked", + init: function ($this, name) { + var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]"); + elements.bind("click.validation", function () { + $this.trigger("change.validation", {includeEmpty: true}); + }); + return {maxchecked: $this.data("validation" + name + "Maxchecked"), elements: elements}; + }, + validate: function ($this, value, validator) { + return (validator.elements.filter(":checked").length > validator.maxchecked && ! validator.negative) + || (validator.elements.filter(":checked").length <= validator.maxchecked && validator.negative); + }, + blockSubmit: true + }, + minchecked: { + name: "minchecked", + init: function ($this, name) { + var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]"); + elements.bind("click.validation", function () { + $this.trigger("change.validation", {includeEmpty: true}); + }); + return {minchecked: $this.data("validation" + name + "Minchecked"), elements: elements}; + }, + validate: function ($this, value, validator) { + return (validator.elements.filter(":checked").length < validator.minchecked && ! validator.negative) + || (validator.elements.filter(":checked").length >= validator.minchecked && validator.negative); + }, + blockSubmit: true + } + }, + builtInValidators: { + email: { + name: "Email", + type: "shortcut", + shortcut: "validemail" + }, + validemail: { + name: "Validemail", + type: "regex", + regex: "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\.[A-Za-z]{2,4}", + message: "Not a valid email address" + }, + passwordagain: { + name: "Passwordagain", + type: "match", + match: "password", + message: "Does not match the given password" + }, + positive: { + name: "Positive", + type: "shortcut", + shortcut: "number,positivenumber" + }, + negative: { + name: "Negative", + type: "shortcut", + shortcut: "number,negativenumber" + }, + number: { + name: "Number", + type: "regex", + regex: "([+-]?\\\d+(\\\.\\\d*)?([eE][+-]?[0-9]+)?)?", + message: "Must be a number" + }, + integer: { + name: "Integer", + type: "regex", + regex: "[+-]?\\\d+", + message: "No decimal places allowed" + }, + positivenumber: { + name: "Positivenumber", + type: "min", + min: 0, + message: "Must be a positive number" + }, + negativenumber: { + name: "Negativenumber", + type: "max", + max: 0, + message: "Must be a negative number" + }, + required: { + name: "Required", + type: "required", + message: "This is required" + }, + checkone: { + name: "Checkone", + type: "minchecked", + minchecked: 1, + message: "Check at least one option" + } + } + }; + + var formatValidatorName = function (name) { + return name + .toLowerCase() + .replace( + /(^|\s)([a-z])/g , + function(m,p1,p2) { + return p1+p2.toUpperCase(); + } + ) + ; + }; + + var getValue = function ($this) { + // Extract the value we're talking about + var value = $this.val(); + var type = $this.attr("type"); + if (type === "checkbox") { + value = ($this.is(":checked") ? value : ""); + } + if (type === "radio") { + value = ($('input[name="' + $this.attr("name") + '"]:checked').length > 0 ? value : ""); + } + return value; + }; + + function regexFromString(inputstring) { + return new RegExp("^" + inputstring + "$"); + } + + /** + * Thanks to Jason Bunting via StackOverflow.com + * + * http://stackoverflow.com/questions/359788/how-to-execute-a-javascript-function-when-i-have-its-name-as-a-string#answer-359910 + * Short link: http://tinyurl.com/executeFunctionByName + **/ + function executeFunctionByName(functionName, context /*, args*/) { + var args = Array.prototype.slice.call(arguments).splice(2); + var namespaces = functionName.split("."); + var func = namespaces.pop(); + for(var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } + return context[func].apply(this, args); + } + + $.fn.jqBootstrapValidation = function( method ) { + + if ( defaults.methods[method] ) { + return defaults.methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return defaults.methods.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.jqBootstrapValidation' ); + return null; + } + + }; + + $.jqBootstrapValidation = function (options) { + $(":input").not("[type=image],[type=submit]").jqBootstrapValidation.apply(this,arguments); + }; + +})( jQuery ); diff --git a/system/sai/modules/autoload.inc b/system/sai/modules/autoload.inc new file mode 100644 index 0000000..9b78174 --- /dev/null +++ b/system/sai/modules/autoload.inc @@ -0,0 +1,16 @@ +span { + cursor:pointer +} +.tree>ul>li::before, .tree>ul>li::after { + border:0 +} +.tree li:last-child::before { + height:30px +} +.tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span { + background:#eee; + border:1px solid #94a0b4; + color:#000 +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_api/saimod_sys_api.js b/system/sai/modules/saimod_sys_api/saimod_sys_api.js new file mode 100644 index 0000000..c80b5a1 --- /dev/null +++ b/system/sai/modules/saimod_sys_api/saimod_sys_api.js @@ -0,0 +1,98 @@ +var currentID = ''; + +function init__SYSTEM_SAI_saimod_sys_api() { + saimod_sys_api_tree(); + saimod_sys_api_register_clickevents(); + +} + +function saimod_sys_api_loadcontent(){ + $('#api_wrapper').load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_api', function(){ + console.log('api module loaded'); + saimod_sys_api_register_clickevents(); + }); + +} + +function saimod_sys_api_register_clickevents(){ + $('tr.api_entries').click(function() { + console.log("ahsf"); + currentID = $(this).attr("id"); + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'deletedialog', + ID: currentID}, + type: 'GET', + success: function(data) { + console.log("works"); + $('#api_content').html(data); + $('#del_api_close').click(function() { + console.log("olenski"); + $('#del_api_description').hide(); + $('#del_api_del').show(); + saimod_sys_api_loadcontent(); + }); + $('#del_api_del').click(function() { + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'deletecall', + ID: currentID}, + type: 'GET', + success: function(data) { + console.log("api call deleted"); + $('#api_deletedialog').html('

    Api call deleted!

    '); + $('#del_api_del').hide(); + }});});}});}); + + $('#addcall').click(function() { + var id = $('#new_call_id').val(); + var group = $('#new_call_group').val(); + var type = $('#new_call_type').val(); + var parentid = $('#new_call_parentid').val(); + var parentvalue = $('#new_call_parentvalue').val(); + var name = $('#new_call_name').val(); + var verify = $('#new_call_verify').val(); + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'addcall', + ID: id, + group: group, + type: type, + parentID: parentid, + parentValue : parentvalue, + name: name, + verify: verify}, + type: 'GET', + success: function(data) { + console.log("new api call added"); + saimod_sys_api_loadcontent(); + } + }); + + }); + $('#del_api_close').click(function() { + console.log("olenski"); + $('#del_api_description').hide(); + $('#del_api_del').show(); + saimod_sys_api_loadcontent(); + }); + $('#localetab a').click(function (e) {e.preventDefault(); $(this).tab('show');}); +} + +function saimod_sys_api_tree(){ + $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch'); + $('.tree li.parent_li > span').on('click', function (e) { + var children = $(this).parent('li.parent_li').find(' > ul > li'); + if (children.is(":visible")) { + children.hide('fast'); + $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign'); + } else { + children.show('fast'); + $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign'); + } + e.stopPropagation(); + }); +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_api/saimod_sys_api.php b/system/sai/modules/saimod_sys_api/saimod_sys_api.php new file mode 100644 index 0000000..7af02aa --- /dev/null +++ b/system/sai/modules/saimod_sys_api/saimod_sys_api.php @@ -0,0 +1,104 @@ +query('SELECT "group", count(*) as "count" FROM system.api GROUP BY "group" ORDER BY "group" ASC;'); + } else { + $res = $con->query('SELECT `group`, count(*) as `count` FROM system_api GROUP BY `group` ORDER BY `group` ASC;'); + } + + $vars['tabopts'] = ''; + $first = true; + while($r = $res->next()){ + $vars2 = array( 'active' => ($first ? 'active' : ''), + 'tab_id' => $r['group']); + $first = false; + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabopt.tpl'), $vars2); + } + + if(\SYSTEM\system::isSystemDbInfoPG()){ + $res = $con->query('SELECT * FROM system.api ORDER BY "group", "ID" ASC;'); + } else { + $res = $con->query('SELECT * FROM system_api ORDER BY `group`, `ID` ASC;'); + } + + while($r = $res->next()){ + $tabs[$r['group']]['tab_id'] = $r['group']; + $tabs[$r['group']]['content'] = isset($tabs[$r['group']]['content']) ? $tabs[$r['group']]['content'] : ''; + $r['tr_class'] = self::tablerow_class($r['type']); + $r['type'] = self::type_names($r['type']); + $tabs[$r['group']]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/list_entry.tpl'), $r); + } + + $vars['tabs'] = ''; + $first = true; + foreach($tabs as $tab){ + $tab['active'] = ($first ? 'active' : ''); + $first = false; + $vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tab.tpl'), $tab);} + + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabs.tpl'), $vars); + +/* $result = ""; + $result .= ''.''.$r['ID'].''.''.$r['group'].''.''.$r['type'].''.''.$r['parentID'].''.''.$r['parentValue'].''.''.$r['name'].''.''.$r['verify'].''.''; + return $result;*/ + } + + public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID){ + $res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID)); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/delete_dialog.tpl'), $res); + } + + public static function sai_mod__system_sai_saimod_sys_api_action_addcall($ID,$group,$type,$parentID,$parentValue,$name,$verify){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + if($parentValue == ''){ $parentValue = NULL;} + if($verify == ''){ $verify = NULL;} + \SYSTEM\DBD\SYS_SAIMOD_API_ADD::QI(array($ID,$group,$type,$parentID,$parentValue,$name,$verify)); + return \SYSTEM\LOG\JsonResult::ok(); + } + + public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + \SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID)); + return \SYSTEM\LOG\JsonResult::ok(); + } + + private static function type_names($type){ + switch($type){ + case 0: return 'COMMAND'; + case 1: return 'COMMAND_FLAG'; + case 2: return 'PARAMETER'; + case 3: return 'PARAMETER_OPT'; + case 4: return 'STATIC'; + default: return 'Problem unknown type'; + } + } + + private static function tablerow_class($flag){ + switch($flag){ + case 0: return 'info'; + case 1: return ''; + case 4: return 'warning'; + default: return 'success'; + } + } + + public static function html_li_menu(){return '
  • API
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_api_flag_css(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/saimod_sys_api.css')));} + public static function sai_mod__SYSTEM_SAI_saimod_sys_api_flag_js(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/saimod_sys_api.js')));} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl b/system/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl new file mode 100644 index 0000000..54505c1 --- /dev/null +++ b/system/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl @@ -0,0 +1,26 @@ +
    +
    Api Call: ${ID}
    +
    + + + + + + + + + + + + + + + + + + + +
    IDGroupTypeParentIDParentValueNameVerify
    ${ID}${group}${type}${parentID}${parentValue}${name}${verify}
    +
    + + diff --git a/system/sai/modules/saimod_sys_api/tpl/list_entry.tpl b/system/sai/modules/saimod_sys_api/tpl/list_entry.tpl new file mode 100644 index 0000000..b7d9845 --- /dev/null +++ b/system/sai/modules/saimod_sys_api/tpl/list_entry.tpl @@ -0,0 +1,9 @@ + + ${ID} + ${group} + ${type} + ${parentID} + ${parentValue} + ${name} + ${verify} + \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_api/tpl/tab.tpl b/system/sai/modules/saimod_sys_api/tpl/tab.tpl new file mode 100644 index 0000000..7e43161 --- /dev/null +++ b/system/sai/modules/saimod_sys_api/tpl/tab.tpl @@ -0,0 +1,14 @@ +
    + + + + + + + + + + + ${content} +
    IDGroupTypeParentIDParentValueNameVerify
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_api/tpl/tabopt.tpl b/system/sai/modules/saimod_sys_api/tpl/tabopt.tpl new file mode 100644 index 0000000..cf223b0 --- /dev/null +++ b/system/sai/modules/saimod_sys_api/tpl/tabopt.tpl @@ -0,0 +1 @@ +
  • Group ${tab_id}
  • \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_api/tpl/tabs.tpl b/system/sai/modules/saimod_sys_api/tpl/tabs.tpl new file mode 100644 index 0000000..aa9102c --- /dev/null +++ b/system/sai/modules/saimod_sys_api/tpl/tabs.tpl @@ -0,0 +1,36 @@ +
    +

    System API

    +
    +
    +
    + +
    + ${tabs} +
    +
    + + + + + + + + + + + + + + + + + + + + +
    IDGroupTypeParentIDParentValueNameVerify
    + +
    +
    diff --git a/system/sai/modules/saimod_sys_cache/autoload.inc b/system/sai/modules/saimod_sys_cache/autoload.inc new file mode 100644 index 0000000..12c20b3 --- /dev/null +++ b/system/sai/modules/saimod_sys_cache/autoload.inc @@ -0,0 +1,5 @@ +query('SELECT COUNT(*)as "count" FROM system.cache'); + } else { + $res = $con->query('SELECT COUNT(*) as count FROM system_cache'); + } + + $r = $res->next(); + + $result = '

    Cache


    '. + 'Entries: '.$r['count'].' showing 100'. + ''. + ''.''.''.''.''.''; + + + if(\SYSTEM\system::isSystemDbInfoPG()){ + $res = $con->query('SELECT *, encode(data,\'base64\') FROM system.cache ORDER BY "ID" ASC LIMIT 100;'); + } else { + $res = $con->query('SELECT * FROM system_cache ORDER BY ID ASC LIMIT 100;'); + } + + while($r = $res->next()){ + $result .= ''.''.''.''.''.'';} + + $result .= '
    '.'ID'.''.'CacheID'.''.'Ident'.''.'Data'.'
    '.$r['ID'].''.$r['CacheID'].''.$r['Ident'].''.''.'
    '; + + return $result; + } + + private static function tablerow_class($cacheID){ + if($cacheID == 1){ + return 'info';} + + return 'success'; + } + + public static function html_li_menu(){return '
  • Cache
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_cache_flag_css(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_cache_flag_js(){} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_config/autoload.inc b/system/sai/modules/saimod_sys_config/autoload.inc new file mode 100644 index 0000000..0182131 --- /dev/null +++ b/system/sai/modules/saimod_sys_config/autoload.inc @@ -0,0 +1,5 @@ +System Config
    '. + ''. + ''.''.''.''.''; + + $result .= ''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + $result .= ''.''.''.''.''; + + $result .= '
    '.'Config ID'.''.'Config Name'.''.'Value'.'
    Basics
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS'. ''.implode(',',\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS)). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG). '
    Database
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD'. ''.'<hidden>'. '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME). '
    System Admin Interface
    '.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_BASEURL. ''.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_BASEURL'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_BASEURL). '
    '.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_NAVIMG. ''.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_NAVIMG'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_NAVIMG). '
    '.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT. ''.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT). '
    '.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE. ''.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE). '
    '; + + return $result; + } + public static function html_li_menu(){return '
  • Config
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_config_flag_css(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_config_flag_js(){} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_cron/autoload.inc b/system/sai/modules/saimod_sys_cron/autoload.inc new file mode 100644 index 0000000..01c1646 --- /dev/null +++ b/system/sai/modules/saimod_sys_cron/autoload.inc @@ -0,0 +1,5 @@ +span { + cursor:pointer +} +.tree>ul>li::before, .tree>ul>li::after { + border:0 +} +.tree li:last-child::before { + height:30px +} +.tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span { + background:#eee; + border:1px solid #94a0b4; + color:#000 +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_cron/js/saimod_sys_cron.js b/system/sai/modules/saimod_sys_cron/js/saimod_sys_cron.js new file mode 100644 index 0000000..48adf2f --- /dev/null +++ b/system/sai/modules/saimod_sys_cron/js/saimod_sys_cron.js @@ -0,0 +1,83 @@ +function init__SYSTEM_SAI_saimod_sys_cron() { + register_cron_add(); + register_cron_del(); + register_cron_edit(); + register_cron_change(); +} + +function register_cron_change(){ + $('.btn_cron_status').click(function(){ + $.ajax({ type :'GET', + url : SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_cron&action=change'+ + '&cls='+$(this).attr('_class')+ + '&status='+$('#select_status_'+$(this).attr('_i')).val(), + success : function(data) { + if(data.status){ + $('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=.SYSTEM.SAI.saimod_sys_cron',function(){ + init__SYSTEM_SAI_saimod_sys_cron(); + }); + }else{ + alert('Problem: '+data);} + } + }); + }); +} + +function register_cron_del(){ + $('.btn_cron_del').click(function(){ + $.ajax({ type :'GET', + url : SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_cron&action=del'+ + '&cls='+$(this).attr('_class'), + success : function(data) { + if(data.status){ + $('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=.SYSTEM.SAI.saimod_sys_cron',function(){ + init__SYSTEM_SAI_saimod_sys_cron(); + }); + }else{ + alert('Problem: '+data);} + } + }); + }); +} + +function register_cron_edit(){ + $('.btn_cron_edit').click(function(){ + $('#input_cron_class').val($(this).attr('_class')); + $('#input_cron_min').val($(this).attr('_min')); + $('#input_cron_hour').val($(this).attr('_hour')); + $('#input_cron_day').val($(this).attr('_day')); + $('#input_cron_day_week').val($(this).attr('_day_week')); + $('#input_cron_month').val($(this).attr('_month')); + $("#btn_cron_add").focus(); + }); +} + +function register_cron_add(){ + $('#btn_cron_add').click(function() { + var cls = $('#input_cron_class').val(); + var min = $('#input_cron_min').val(); + var hour = $('#input_cron_hour').val(); + var day = $('#input_cron_day').val(); + var day_week = $('#input_cron_day_week').val(); + var month = $('#input_cron_month').val(); + $.ajax({url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_cron', + action: 'add', + cls: cls, + min: min, + hour: hour, + day: day, + day_week: day_week, + month: month}, + type: 'GET', + success: function(data) { + if(data.status){ + $('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=.SYSTEM.SAI.saimod_sys_cron',function(){ + init__SYSTEM_SAI_saimod_sys_cron(); + }); + }else{ + alert('Problem: '+data);} + } + }); + }); +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php b/system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php new file mode 100644 index 0000000..5fa8721 --- /dev/null +++ b/system/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php @@ -0,0 +1,11 @@ +next()){ + $r['selected_0'] = $r['selected_1'] = $r['selected_2'] = $r['selected_3'] = ''; + $r['next'] = date('Y-m-d H:i:s',\SYSTEM\CRON\cron::next($r['class'])); + $r['selected_'.$r['status']] = 'selected'; + $r['i'] = $i++; + $vars['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tpl/list_entry.tpl'), $r);} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tpl/tabs.tpl'), $vars); + } + + public static function sai_mod__system_sai_saimod_sys_cron_action_change($cls,$status){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + \SYSTEM\DBD\SYS_SAIMOD_CRON_CHANGE::QI(array($status,$cls)); + return \SYSTEM\LOG\JsonResult::ok(); + } + + public static function sai_mod__system_sai_saimod_sys_cron_action_add($cls,$min,$hour,$day,$day_week,$month){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + if(!\SYSTEM\CRON\cron::check($cls)){ + throw new \SYSTEM\LOG\ERROR("Given Class is not a CronJob");} + \SYSTEM\DBD\SYS_SAIMOD_CRON_ADD::QI(array($cls,$min,$hour,$day,$day_week,$month)); + return \SYSTEM\LOG\JsonResult::ok(); + } + + public static function sai_mod__system_sai_saimod_sys_cron_action_del($cls){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + \SYSTEM\DBD\SYS_SAIMOD_CRON_DEL::QI(array($cls)); + return \SYSTEM\LOG\JsonResult::ok();} + + public static function html_li_menu(){return '
  • Cron
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_cron_flag_css(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/css/saimod_sys_cron.css')));} + public static function sai_mod__SYSTEM_SAI_saimod_sys_cron_flag_js(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/js/saimod_sys_cron.js')));} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_cron/tpl/list_entry.tpl b/system/sai/modules/saimod_sys_cron/tpl/list_entry.tpl new file mode 100644 index 0000000..4b131e4 --- /dev/null +++ b/system/sai/modules/saimod_sys_cron/tpl/list_entry.tpl @@ -0,0 +1,23 @@ + + ${class} + ${min} + ${hour} + ${day} + ${day_week} + ${month} + ${last_run} + ${next} + + + + + + + + + \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_cron/tpl/tabs.tpl b/system/sai/modules/saimod_sys_cron/tpl/tabs.tpl new file mode 100644 index 0000000..e79d3fb --- /dev/null +++ b/system/sai/modules/saimod_sys_cron/tpl/tabs.tpl @@ -0,0 +1,35 @@ +
    +

    System Cron

    +
    + Last Visit: ${last_visit}
    + Start Cron +
    + + + + + + + + + + + + + + ${content} + + + + + + + + + + + + +
    classminhourdayday_weekmonthlast_runnext_runstatusaction
    +
    +
    diff --git a/system/sai/modules/saimod_sys_docu/autoload.inc b/system/sai/modules/saimod_sys_docu/autoload.inc new file mode 100644 index 0000000..9159a3d --- /dev/null +++ b/system/sai/modules/saimod_sys_docu/autoload.inc @@ -0,0 +1,5 @@ + $docs){ + $vars2 = array( 'active' => ($first ? 'active' : ''), + 'tab_id' => str_replace(' ', '_', $cat), + 'tab_id_pretty' => $cat); + $first = false; + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabopt.tpl'), $vars2); + + $first2 = true; + foreach($docs as $doc){ + $tabs[$cat]['tab_id'] = str_replace(' ', '_', $cat); + $tabs[$cat]['content'] = isset($tabs[$cat]['content']) ? $tabs[$cat]['content'] : ''; + $tabs[$cat]['menu'] = isset($tabs[$cat]['menu']) ? $tabs[$cat]['menu'] : ''; + //$tabs[$cat]['content'] .= \Michelf\MarkdownExtra::defaultTransform(file_get_contents($doc)); + $vars3 = array( 'active' => ($first2 ? 'active' : ''), + 'content' => \Michelf\MarkdownExtra::defaultTransform(file_get_contents($doc)), + 'tab_id' => str_replace(array('.',' ','\\','/'), '_', $doc)); + $tabs[$cat]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tab2.tpl'), $vars3); + $vars3 = array( 'active' => ($first2 ? 'active' : ''), + 'tab_id' => str_replace(array('.',' ','\\','/'), '_', $doc), + 'tab_id_pretty' => basename($doc)); + $tabs[$cat]['menu'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabopt.tpl'), $vars3); + $first2 = false; + } + + $vars['tabs'] = ''; + $first = true; + foreach($tabs as $tab){ + $tab['active'] = ($first ? 'active' : ''); + $first = false; + $vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tab.tpl'), $tab);} + } + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabs.tpl'), $vars); + } + + public static function html_li_menu(){return '
  • Docu
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_flag_css(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_flag_js(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSYSTEM(),'lib/EpicEditor/js/epiceditor.min.js'), + \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/saimod_sys_docu.js')));} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_docu/tpl/tab.tpl b/system/sai/modules/saimod_sys_docu/tpl/tab.tpl new file mode 100644 index 0000000..804cb3d --- /dev/null +++ b/system/sai/modules/saimod_sys_docu/tpl/tab.tpl @@ -0,0 +1,12 @@ +
    +
    + +
    + ${content} +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_docu/tpl/tab2.tpl b/system/sai/modules/saimod_sys_docu/tpl/tab2.tpl new file mode 100644 index 0000000..53a7e4c --- /dev/null +++ b/system/sai/modules/saimod_sys_docu/tpl/tab2.tpl @@ -0,0 +1,8 @@ +
    +
    +
    + ${content} + +
    +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_docu/tpl/tabopt.tpl b/system/sai/modules/saimod_sys_docu/tpl/tabopt.tpl new file mode 100644 index 0000000..de4373f --- /dev/null +++ b/system/sai/modules/saimod_sys_docu/tpl/tabopt.tpl @@ -0,0 +1 @@ +
  • ${tab_id_pretty}
  • \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_docu/tpl/tabs.tpl b/system/sai/modules/saimod_sys_docu/tpl/tabs.tpl new file mode 100644 index 0000000..8661ea0 --- /dev/null +++ b/system/sai/modules/saimod_sys_docu/tpl/tabs.tpl @@ -0,0 +1,10 @@ +

    System Documentation

    +
    +
    + +
    + ${tabs} +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_files/autoload.inc b/system/sai/modules/saimod_sys_files/autoload.inc new file mode 100644 index 0000000..f688fac --- /dev/null +++ b/system/sai/modules/saimod_sys_files/autoload.inc @@ -0,0 +1,5 @@ + '', 'tabs' => ''); + $file_folders = \SYSTEM\FILES\files::get(); + $first = true; + foreach($file_folders as $name=>$folder){ + $result['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl'),array('name' => $name, 'active' => $first ? 'active' : '')); + $result['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tab.tpl'),array('name' => $name, 'active' => $first ? 'active' : '', 'content' => $first ? self::sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name) : '')); + $first = false; + } + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files.tpl'),$result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name){ + $result = ''; + $cat = \SYSTEM\FILES\files::get($name); + $i = 0; + foreach($cat as $file){ + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tableentry.tpl'), array('i' => $i++, 'cat' => $name, 'name' => $file, 'extension' => substr($file,-3,3), 'url' => 'api.php?call=files&cat='.$name.'&id='.$file));} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tabfull.tpl'), array('cat' => $name, 'content' => $result));} + + public static function html_li_menu(){return '
  • Files
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_FILES);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_files_flag_css(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_files_flag_js(){return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files.js')));} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl new file mode 100644 index 0000000..9c8842f --- /dev/null +++ b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl @@ -0,0 +1,10 @@ +

    User Files

    +
    +
    + +
    + ${tabs} +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tab.tpl b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tab.tpl new file mode 100644 index 0000000..1731587 --- /dev/null +++ b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tab.tpl @@ -0,0 +1 @@ +
    ${content}
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabfull.tpl b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabfull.tpl new file mode 100644 index 0000000..a55e065 --- /dev/null +++ b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabfull.tpl @@ -0,0 +1,16 @@ + + + + + + + + ${content} + +
    + + + + + +
    NameExtensionURLAction
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tableentry.tpl b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tableentry.tpl new file mode 100644 index 0000000..b685806 --- /dev/null +++ b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tableentry.tpl @@ -0,0 +1,12 @@ + + ${name} + ${extension} + + ${url} + + + + + + + \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl new file mode 100644 index 0000000..42f88a7 --- /dev/null +++ b/system/sai/modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl @@ -0,0 +1 @@ +
  • ${name}
  • \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/autoload.inc b/system/sai/modules/saimod_sys_locale/autoload.inc new file mode 100644 index 0000000..36f61f5 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/autoload.inc @@ -0,0 +1,5 @@ +next()){ + $vars2 = array( 'active' => ($first ? 'active' : ''), + 'tab_id' => $r['category']); + $first = false; + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/tabopt.tpl'), $vars2); + } + $langtab_ = ''; + foreach (self::getLanguages() as $lang){ + $details['langs'] = $lang; + $langtab_ .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/langtabopt.tpl'), $details); + $languages[] = $lang; + } + $langtab['langs'] = $langtab_; + $langhead = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/langtabs.tpl'), $langtab); + $vars['tabs'] = $langhead; + $vars['langs'] = $langtab_; + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/tabs.tpl'), $vars); + //.\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/editmode.tpl'), $vars); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_load($lang, $group){ + $con = new \SYSTEM\DB\Connection(); + if(\SYSTEM\system::isSystemDbInfoPG()){ + $query = 'SELECT id, "'.$lang.'" FROM '.\SYSTEM\DBD\system_locale_string::NAME_PG.' WHERE category='.$group.' ORDER BY category ASC;'; + } else { + $query = 'SELECT id, '.$lang.' FROM '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' WHERE category='.$group.' ORDER BY category ASC;'; + } + $res = $con->query($query); + $entries = ''; + $temparr = array(); + while($r = $res->next()){ + $temparr['lang'] = $r[$lang]; + $temparr['id'] = $r['id']; + $entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/entry.tpl'), $temparr); + } + return $entries; + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_singleload($id, $lang){ + $con = new \SYSTEM\DB\Connection(); + $result = ""; + if(\SYSTEM\system::isSystemDbInfoPG()){ + $query = 'SELECT "'.$lang.'" FROM '.\SYSTEM\DBD\system_locale_string::NAME_PG.' WHERE id=\''.$id.'\' ORDER BY category ASC;'; + } else { + $query = 'SELECT '.$lang.' FROM `'.\SYSTEM\DBD\system_locale_string::NAME_MYS.'` WHERE id=\''.$id.'\' ORDER BY category ASC;'; + } + $res = $con->query($query); + $entries = ''; + $temparr = array(); + while($r = $res->next()){ + $entries .= $r[$lang];} + return $entries; + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_edit($id, $lang, $category, $newtext){ + //$charset = 'utf-8'; + $con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo()); + $res = null; + if(\SYSTEM\system::isSystemDbInfoPG()){ + $res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_PG.' SET "'.$lang.'"=$1 WHERE category = $1 AND id=$2;', array($newtext, $category, $id)); + } else { + $res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' SET '.$lang.'=? WHERE category = ? AND id=?;', array($newtext, $category, $id)); + } + return $res->affectedRows() == 0 ? \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no rows affected")) : \SYSTEM\LOG\JsonResult::ok(); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_add($id, $category){ + return \SYSTEM\DBD\SYS_SAIMOD_LOCALE_ADD::QI(array($id, $category)) ? \SYSTEM\LOG\JsonResult::ok() : \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no data added"));} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_delete($id){ + return \SYSTEM\DBD\SYS_SAIMOD_LOCALE_DEL::QI(array($id)) ? \SYSTEM\LOG\JsonResult::ok() : \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("could not delete the permitted data"));} + + public static function html_li_menu(){return '
  • Text
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_LOCALE);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_flag_css(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_flag_js(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/saimod_sys_locale.js')));} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/LICENSE.TXT b/system/sai/modules/saimod_sys_locale/tinymce/LICENSE.TXT new file mode 100644 index 0000000..1837b0a --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/LICENSE.TXT @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/system/sai/modules/saimod_sys_locale/tinymce/jquery.tinymce.min.js b/system/sai/modules/saimod_sys_locale/tinymce/jquery.tinymce.min.js new file mode 100644 index 0000000..3ddfede --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/jquery.tinymce.min.js @@ -0,0 +1 @@ +!function(t){function e(){function e(t){"remove"===t&&this.each(function(t,e){var n=r(e);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(t,e){var n=tinymce.get(e.id.replace(/_parent$/,""));n&&n.remove()})}function i(t){var n,i=this;if(null!=t)e.call(i),i.each(function(e,n){var i;(i=tinymce.get(n.id))&&i.setContent(t)});else if(i.length>0&&(n=tinymce.get(i[0].id)))return n.getContent()}function r(t){var e=null;return t&&t.id&&a.tinymce&&(e=tinymce.get(t.id)),e}function c(t){return!!(t&&t.length&&a.tinymce&&t.is(":tinymce"))}var u={};t.each(["text","html","val"],function(e,a){var o=u[a]=t.fn[a],s="text"===a;t.fn[a]=function(e){var a=this;if(!c(a))return o.apply(a,arguments);if(e!==n)return i.call(a.filter(":tinymce"),e),o.apply(a.not(":tinymce"),arguments),a;var u="",l=arguments;return(s?a:a.eq(0)).each(function(e,n){var i=r(n);u+=i?s?i.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):i.getContent({save:!0}):o.apply(t(n),l)}),u}}),t.each(["append","prepend"],function(e,i){var a=u[i]=t.fn[i],o="prepend"===i;t.fn[i]=function(t){var e=this;return c(e)?t!==n?(e.filter(":tinymce").each(function(e,n){var i=r(n);i&&i.setContent(o?t+i.getContent():i.getContent()+t)}),a.apply(e.not(":tinymce"),arguments),e):void 0:a.apply(e,arguments)}}),t.each(["remove","replaceWith","replaceAll","empty"],function(n,i){var r=u[i]=t.fn[i];t.fn[i]=function(){return e.call(this,i),r.apply(this,arguments)}}),u.attr=t.fn.attr,t.fn.attr=function(e,a){var o=this,s=arguments;if(!e||"value"!==e||!c(o))return a!==n?u.attr.apply(o,s):u.attr.apply(o,s);if(a!==n)return i.call(o.filter(":tinymce"),a),u.attr.apply(o.not(":tinymce"),s),o;var l=o[0],p=r(l);return p?p.getContent({save:!0}):u.attr.apply(t(l),s)}}var n,i,r=[],a=window;t.fn.tinymce=function(n){function c(){var i=[],r=0;e&&(e(),e=null),l.each(function(t,e){var a,c=e.id,u=n.oninit;c||(e.id=c=tinymce.DOM.uniqueId()),tinymce.get(c)||(a=new tinymce.Editor(c,n,tinymce.EditorManager),i.push(a),a.on("init",function(){var t,e=u;l.css("visibility",""),u&&++r==i.length&&("string"==typeof e&&(t=-1===e.indexOf(".")?null:tinymce.resolve(e.replace(/\.\w+$/,"")),e=tinymce.resolve(e)),e.apply(t||tinymce,i))}))}),t.each(i,function(t,e){e.render()})}var u,o,s,l=this,p="";if(!l.length)return l;if(!n)return tinymce.get(l[0].id);if(l.css("visibility","hidden"),a.tinymce||i||!(u=n.script_url))1===i?r.push(c):c();else{i=1,o=u.substring(0,u.lastIndexOf("/")),-1!=u.indexOf(".min")&&(p=".min"),a.tinymce=a.tinyMCEPreInit||{base:o,suffix:p},-1!=u.indexOf("gzip")&&(s=n.language||"en",u=u+(/\?/.test(u)?"&":"?")+"js=true&core=true&suffix="+escape(p)+"&themes="+escape(n.theme||"")+"&plugins="+escape(n.plugins||"")+"&languages="+(s||""),a.tinyMCE_GZ||(a.tinyMCE_GZ={start:function(){function e(t){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(t))}e("langs/"+s+".js"),e("themes/"+n.theme+"/theme"+p+".js"),e("themes/"+n.theme+"/langs/"+s+".js"),t.each(n.plugins.split(","),function(t,n){n&&(e("plugins/"+n+"/plugin"+p+".js"),e("plugins/"+n+"/langs/"+s+".js"))})},end:function(){}}));var f=document.createElement("script");f.type="text/javascript",f.onload=f.onreadystatechange=function(e){e=e||event,("load"==e.type||/complete|loaded/.test(f.readyState))&&(tinymce.dom.Event.domLoaded=1,i=2,n.script_loaded&&n.script_loaded(),c(),t.each(r,function(t,e){e()}))},f.src=u,document.body.appendChild(f)}return l},t.extend(t.expr[":"],{tinymce:function(t){return!!(t.id&&"tinymce"in window&&tinymce.get(t.id))}})}(jQuery); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/langs/readme.md b/system/sai/modules/saimod_sys_locale/tinymce/langs/readme.md new file mode 100644 index 0000000..a52bf03 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/langs/readme.md @@ -0,0 +1,3 @@ +This is where language files should be placed. + +Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/advlist/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/advlist/plugin.min.js new file mode 100644 index 0000000..da1cdb2 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/advlist/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("advlist",function(t){function e(t,e){var n=[];return tinymce.each(e.split(/[ ,]/),function(t){n.push({text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"==t?"":t})}),n}function n(e,n){var i,r=t.dom,a=t.selection;i=r.getParent(a.getNode(),"ol,ul"),i&&i.nodeName==e&&n!==!1||t.execCommand("UL"==e?"InsertUnorderedList":"InsertOrderedList"),n=n===!1?o[e]:n,o[e]=n,i=r.getParent(a.getNode(),"ol,ul"),i&&(r.setStyle(i,"listStyleType",n),i.removeAttribute("data-mce-style")),t.focus()}function i(e){var n=t.dom.getStyle(t.dom.getParent(t.selection.getNode(),"ol,ul"),"listStyleType")||"";e.control.items().each(function(t){t.active(t.settings.data===n)})}var r,a,o={};r=e("OL",t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),a=e("UL",t.getParam("advlist_bullet_styles","default,circle,disc,square")),t.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:r,onshow:i,onselect:function(t){n("OL",t.control.settings.data)},onclick:function(){n("OL",!1)}}),t.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:a,onshow:i,onselect:function(t){n("UL",t.control.settings.data)},onclick:function(){n("UL",!1)}})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/anchor/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/anchor/plugin.min.js new file mode 100644 index 0000000..6a3fd79 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/anchor/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("anchor",function(e){function t(){var t=e.selection.getNode();e.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:t.name||t.id},onsubmit:function(t){e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:t.data.name}))}})}e.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:t,stateSelector:"a:not([href])"}),e.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:t})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/autolink/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/autolink/plugin.min.js new file mode 100644 index 0000000..3d2f58e --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/autolink/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("autolink",function(t){function e(t){o(t,-1,"(",!0)}function n(t){o(t,0,"",!0)}function i(t){o(t,-1,"",!1)}function o(t,e,n){var i,o,r,a,s,l,c,u,d;if(i=t.selection.getRng(!0).cloneRange(),i.startOffset<5){if(u=i.endContainer.previousSibling,!u){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;u=i.endContainer.firstChild.nextSibling}if(d=u.length,i.setStart(u,d),i.setEnd(u,d),i.endOffset<5)return;o=i.endOffset,a=u}else{if(a=i.endContainer,3!=a.nodeType&&a.firstChild){for(;3!=a.nodeType&&a.firstChild;)a=a.firstChild;3==a.nodeType&&(i.setStart(a,0),i.setEnd(a,a.nodeValue.length))}o=1==i.endOffset?2:i.endOffset-1-e}r=o;do i.setStart(a,o>=2?o-2:0),i.setEnd(a,o>=1?o-1:0),o-=1;while(" "!=i.toString()&&""!==i.toString()&&160!=i.toString().charCodeAt(0)&&o-2>=0&&i.toString()!=n);if(i.toString()==n||160==i.toString().charCodeAt(0)?(i.setStart(a,o),i.setEnd(a,r),o+=1):0===i.startOffset?(i.setStart(a,0),i.setEnd(a,r)):(i.setStart(a,o),i.setEnd(a,r)),l=i.toString(),"."==l.charAt(l.length-1)&&i.setEnd(a,r-1),l=i.toString(),c=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),c&&("www."==c[1]?c[1]="http://www.":/@$/.test(c[1])&&!/^mailto:/.test(c[1])&&(c[1]="mailto:"+c[1]),s=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,c[1]+c[2]),t.selection.moveToBookmark(s),t.nodeChanged(),tinymce.Env.webkit)){t.selection.collapse(!1);var m=Math.min(a.length,r+1);i.setStart(a,m),i.setEnd(a,m),t.selection.setRng(i)}}t.on("keydown",function(e){return 13==e.keyCode?i(t):void 0}),tinymce.Env.ie||(t.on("keypress",function(n){return 41==n.which?e(t):void 0}),t.on("keyup",function(e){return 32==e.keyCode?n(t):void 0}))}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/autoresize/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/autoresize/plugin.min.js new file mode 100644 index 0000000..12355aa --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/autoresize/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("autoresize",function(e){function t(a){var r,o,c=e.getDoc(),s=c.body,u=c.documentElement,l=tinymce.DOM,m=n.autoresize_min_height;"setcontent"==a.type&&a.initial||e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()||(o=tinymce.Env.ie?s.scrollHeight:tinymce.Env.webkit&&0===s.clientHeight?0:s.offsetHeight,o>n.autoresize_min_height&&(m=o),n.autoresize_max_height&&o>n.autoresize_max_height?(m=n.autoresize_max_height,s.style.overflowY="auto",u.style.overflowY="auto"):(s.style.overflowY="hidden",u.style.overflowY="hidden",s.scrollTop=0),m!==i&&(r=m-i,l.setStyle(l.get(e.id+"_ifr"),"height",m+"px"),i=m,tinymce.isWebKit&&0>r&&t(a)))}var n=e.settings,i=0;e.settings.inline||(n.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),n.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){e.dom.setStyle(e.getBody(),"paddingBottom",e.getParam("autoresize_bottom_margin",50)+"px")}),e.on("change setcontent paste keyup",t),e.getParam("autoresize_on_init",!0)&&e.on("load",t),e.addCommand("mceAutoResize",t))}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/autosave/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/autosave/plugin.min.js new file mode 100644 index 0000000..93ee1df --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/autosave/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(f.getItem(h+"autosave.time"),10)||0;return(new Date).getTime()-e>d.autosave_retention?(i(!1),!1):!0}function i(t){f.removeItem(h+"autosave.draft"),f.removeItem(h+"autosave.time"),t!==!1&&e.fire("RemoveDraft")}function a(){c()||(f.setItem(h+"autosave.draft",e.getContent({format:"raw",no_events:!0})),f.setItem(h+"autosave.time",(new Date).getTime()),e.fire("StoreDraft"))}function r(){n()&&(e.setContent(f.getItem(h+"autosave.draft"),{format:"raw"}),e.fire("RestoreDraft"))}function o(){m||(setInterval(function(){e.removed||a()},d.autosave_interval),m=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft RemoveDraft",function(){t.disabled(!n())}),o()}function l(){e.undoManager.beforeChange(),r(),i(),e.undoManager.add()}function u(){var e;return tinymce.each(tinymce.editors,function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e}function c(t){var n=e.settings.forced_root_block;return t=tinymce.trim("undefined"==typeof t?e.getBody().innerHTML:t),""===t||new RegExp("^<"+n+">(( | |[ ]|]*>)+?|)|
    $","i").test(t)}var m,d=e.settings,f=tinymce.util.LocalStorage,h=e.id;d.autosave_interval=t(d.autosave_interval,"30s"),d.autosave_retention=t(d.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:l,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:l,onPostRender:s,context:"file"}),e.settings.autosave_restore_when_empty!==!1&&(e.on("init",function(){n()&&c()&&r()}),e.on("saveContent",function(){i()})),window.onbeforeunload=u,this.hasDraft=n,this.storeDraft=a,this.restoreDraft=r,this.removeDraft=i,this.isEmpty=c}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/bbcode/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/bbcode/plugin.min.js new file mode 100644 index 0000000..70a88a7 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/bbcode/plugin.min.js @@ -0,0 +1 @@ +!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(e){var t=this,n=e.getParam("bbcode_dialect","punbb").toLowerCase();e.on("beforeSetContent",function(e){e.content=t["_"+n+"_bbcode2html"](e.content)}),e.on("postProcess",function(e){e.set&&(e.content=t["_"+n+"_bbcode2html"](e.content)),e.get&&(e.content=t["_"+n+"_html2bbcode"](e.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),t(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),t(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),t(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),t(/(.*?)<\/font>/gi,"$1"),t(//gi,"[img]$1[/img]"),t(/(.*?)<\/span>/gi,"[code]$1[/code]"),t(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),t(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),t(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),t(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),t(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),t(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),t(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),t(/<\/(strong|b)>/gi,"[/b]"),t(/<(strong|b)>/gi,"[b]"),t(/<\/(em|i)>/gi,"[/i]"),t(/<(em|i)>/gi,"[i]"),t(/<\/u>/gi,"[/u]"),t(/(.*?)<\/span>/gi,"[u]$1[/u]"),t(//gi,"[u]"),t(/]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/
    /gi,"\n"),t(//gi,"\n"),t(/
    /gi,"\n"),t(/

    /gi,""),t(/<\/p>/gi,"\n"),t(/ |\u00a0/gi," "),t(/"/gi,'"'),t(/</gi,"<"),t(/>/gi,">"),t(/&/gi,"&"),e},_punbb_bbcode2html:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/\n/gi,"
    "),t(/\[b\]/gi,""),t(/\[\/b\]/gi,""),t(/\[i\]/gi,""),t(/\[\/i\]/gi,""),t(/\[u\]/gi,""),t(/\[\/u\]/gi,""),t(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),t(/\[url\](.*?)\[\/url\]/gi,'$1'),t(/\[img\](.*?)\[\/img\]/gi,''),t(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),t(/\[code\](.*?)\[\/code\]/gi,'$1 '),t(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),e}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}(); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/charmap/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/charmap/plugin.min.js new file mode 100644 index 0000000..dff18e6 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/charmap/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("charmap",function(e){function t(){function t(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var i,a,r,o;i='';var s=25;for(r=0;10>r;r++){for(i+="",a=0;s>a;a++){var l=n[r*s+a],c="g"+(r*s+a);i+='"}i+=""}i+="";var u={type:"container",html:i,onclick:function(t){var n=t.target;"DIV"==n.nodeName&&e.execCommand("mceInsertContent",!1,n.firstChild.nodeValue)},onmouseover:function(e){var n=t(e.target);n&&o.find("#preview").text(n.firstChild.firstChild.data)}};o=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[u,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){o.close()}}]})}var n=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:t}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:t,context:"insert"})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/code/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/code/plugin.min.js new file mode 100644 index 0000000..4f16d64 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/code/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("code",function(e){function o(){e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),value:e.getContent({source_view:!0}),spellcheck:!1},onSubmit:function(o){e.undoManager.transact(function(){e.setContent(o.data.code)}),e.nodeChanged()}})}e.addCommand("mceCodeEditor",o),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:o}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:o})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/contextmenu/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/contextmenu/plugin.min.js new file mode 100644 index 0000000..4aabc70 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/contextmenu/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("contextmenu",function(e){var t;e.on("contextmenu",function(n){var i;if(n.preventDefault(),i=e.settings.contextmenu||"link image inserttable | cell row column deletetable",t)t.show();else{var o=[];tinymce.each(i.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"==t&&(n={text:t}),n&&(n.shortcut="",o.push(n))});for(var a=0;aKx}s1_F$4FCWDA^8LW0018VEC2ui01^Na000Hw;3tYzX_jM3Qpv$_M?zI9i5=0S zX-{-uv=l3%&P0s%m9Ox_a(m_c|u z01g3U0`Wll5)poVdma=N8y<3f0Sf~hXmTC}2oxMW4FdxUj+z4<0}lrX2nP=qkDRIt z9Ge*(qzMrj3jrIOjvI{`5eWzt3`G_T8yChG8w(a19SkK12@M(+799Zr9n=~PzBCmA z5)BU-)YKUd4H5!D9|!^o9kWIe9SH(WDHRk92}DZ?3})2$P@$55g90f0N)ZA8JID5J Aw*UYD literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-cry.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-cry.gif new file mode 100644 index 0000000000000000000000000000000000000000..74d897a4f6d22e814e2b054e98b8a75fb464b4be GIT binary patch literal 329 zcmV-P0k-}}Nk%w1VG;lm0Mr-&E)xPSit@9T3%;vR+|V+?t0A(pllJjXrMl7n=_A_a za^B+Su$LjvyC3@TIQZNZa##w=!k(SO^P#bO*w(eU#;{U83XFCU_V)J5wrb+;g2vkN z#>U24qVoOvY5)KLA^8LW0018VEC2ui01^Na000HX;3tY$X_jM3QUfCh%s^o(nF++< zc?Th6v=oL>*by8K!mhvwelUXuuW&&U9iGO3hM@>Njw{l^#0q9mWpcefdI;O$;efnY zkd~@r-o$*74FCWI1%d((4+jDz0va0>69^fI6%`W{8w!gU1pyL>prH>E0R<%k6Aq%H z4ij+^9TEwM5P}eh2@)L<~6+>@EpxfA0YrcPNsSu literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-embarassed.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-embarassed.gif new file mode 100644 index 0000000000000000000000000000000000000000..963a96b8a7593b1d8bcbab073abe5ee4e539dbf6 GIT binary patch literal 331 zcmV-R0kr-{Nk%w1VG;lm0MrryDh>j~yq&6%75dW~z^P39(NxsGDE{UkxtkIEq(S-a zRKlwv+S=Lr?>hbYY~sQ?c3T&ZcN_Nh_EU3s(>Io6B&>WW`@bsw**)Ocy1bht z{*G6|uwwqUQ2+n{A^8LW0018VEC2ui01^Na000HZ;3tYwX_jM3YQ!c88=*-m*&&bO zILd=`w3KAC;8hxpif*w9ek6oqV-Z0L77fROK$BSR@5BAv-%C>6y>>#+D4e#&nz^qMDItlpp zTG728+|V&?R13PIEBW(C`uh6d*t-1sZ^XQv;oDD}iYLOV7uVO;{`xl4#4tJ{0;h@! z>)kdc3IhA?Hvj+tA^8La0018VEC2ui01^Na06+!P;3tYuX_ljS7!u|-O)I}TzP1q%xT4HOFwMJaO;2ml)!00$)141pU08x3594IX?4 o5YuAA8yXz~76K1c;3^jg77WP185Rf^u}23N0sR5^q(T4yJ1sVN5dZ)H literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-frown.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-frown.gif new file mode 100644 index 0000000000000000000000000000000000000000..716f55e161bfebb1c3d34f0b0f40c177fc82c30b GIT binary patch literal 340 zcmV-a0jvH;Nk%w1VG;lm0MroxK_>;q#>Sw62=mns-On=0wransPVevT^YK{Dy(0YY zH)vE6x0?;Wqb>gZas1^OT0si>`ugD5y87}*#H$s=yq(wA*8cf7{`y+(+9J7|9QfT7 z`ROHiU=Y&6FaQ7mA^8LW0018VEC2ui01^Na000Hi;3tYvX_jM3N`@u~nju9hSuh^r zIEcp-wA7(NL0~2d#RP+(G!CPPA>o*KJjv_CkucCA5=K?AfF#RG2V*8BU@jL304|4P z2;PGRF@bj$et;Jf2pR_mVsIA<85|n}kQ*Bq42Ovqj*yy>6P0=h3X&9Z01yyk~2N4w%7#RW^55W%`0vQ+-6(y_*2pqz~90*;x9}yM}%$UI(7t#$D mK_3Se1{4HKM+6iG7EmeH6$V631{L5n)#CyC0qx-*Apkoyg?w!Q literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-innocent.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-innocent.gif new file mode 100644 index 0000000000000000000000000000000000000000..334d49e0e60f2997c9ba24071764f95d9e08a5cc GIT binary patch literal 336 zcmV-W0k8f?Nk%w1VG;lm0MrryI4TI-%dP0m5~*+Y`T~ z7Rth){q{I_X%*S48uRZ|(b3V&wIKTX`u+WJzo<^$#wuY;3W|Cf{O29IkTAcaE&lpe z+P*^H)-tknA^-pYA^8LW0018VEC2ui01^Na000He;3tYwX_n)75QgVvNQ`6#5gcMm zEEG~blgXokptKAJgCU?%JT?yos!R6cPtcQWh2siHlNI2L}ifQhgX02^InZ2?-ktkqVRyZJY^Trk|lv zovp437?1~d46O)?2(1i+2NDYk8<+_Kil!K!3njA^!I#dL8x<729}*B65mC=m5gHH@ iDi9P3f*VjB3KS4HDb_qqRul{0DIT=Nk%w1VG;lm0Mrx!QauaC#>Vb6G=_5=^YB^9wrc376Sb5I-qJGf@9vZ# z5WlKU(!eVB+7tfnDXp0zyB`?BZ5IChalob*`uh6d*t+@dKGHcU+L|83yq*5~IoH?L zy`?Gp<{bX|SpWb4A^8LW0018VEC2ui01^Na000Hg;3tYyX_jM3R?Bl7&r(q;SsVx< zNd$5fv{ZsKA$SlL3&KN~a1tZRf*~1Ltkx9~2uL3&z-yb0WJDRY082|tP literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-laughing.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-laughing.gif new file mode 100644 index 0000000000000000000000000000000000000000..82c5b182e61d32bd394acae551eff180f1eebd26 GIT binary patch literal 343 zcmV-d0jT~*Nk%w1VG;lm0Q4UK!lp8=s;1-69HWK?p_PpF=Pd8~Ygtcnp*fHAL z**;z>w3iC}`fmL6IkKB1N;3zEa}&zKpsu1;_V)HocR5-{J~BcYvE`YXhBnc@CfU=! za(Ec zG>66zv=rqr;2j)}gKqE$ekcSD?}0=WLB?AWp85)qALd+P=4)6X4oXy{bw2>K^d$ z@6ERvva+(4ib~41YUkTEn1&#?rzrOHT>1I=Y*h`+%*@WtPUPg|!@EEI_d5LgZ>^Og z-qyBKJqy*wF8}}lA^8La0018VEC2ui01^Na06+!6;3tYxX_lj?7+U61R3gAaEg8x< zT>%mSfCwURnWQF&g=Q0ZxH1ulW`QtH0>O!5%iT_X0VBy_@EkOngU8?ye~=H!t21{= z9@Uj3a_UbE88~kh5Eq7rh!7QSBn1c?0|Off1&k^`5*QE<4-gmSR<4C>Dj%C>6W(lWoQPVevT^YB^Fy&h6M z4YZgH{O~qtR1(Ci8T;lQ`uh6d*t-7xar*K{#Jrulo-Wtd*44u?{`oh#n;gQXGXDEo z_}UUC3IeK%0ssI2A^8La0018VEC2ui01^Na06+!R;3tYuX_ljSEE482&%+G^XK%|f zLKbCc4u{4-u|QG~LqamSTo?@JM3OKZAr!|Z2IzP@fY`=CIg$vA3qm46TowfLCt29I z6pDKuvnf~)83+sm9yW#?9s>^(89F=~2?!W44-6Ox2^vNza}fp^9v&G65pp936%Gg+ z6HpTy2o4oGoh+>l3Q)KVQwybl2oo*<4a3D469|nfEii|MH4`}p1_cZp0ssj%2>=2d q41Na?)CpS;4gvxWVpZcR76uLludD?Q1{SnP2NnVU0rZ&)0RTIit8@_n literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-surprised.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-surprised.gif new file mode 100644 index 0000000000000000000000000000000000000000..0cc9bb71cca4cdeafbb248ce7e07c3708c1cbd64 GIT binary patch literal 338 zcmV-Y0j>T=Nk%w1VG;lm0Q4UK`{WwN#>SnDDC*4*{OcpiwransPVevTQacIr@mkQp zCf(06s)_=>r7UYx48o@u`uh6d*t-7rH~ji<`P&oj;5Wp)o!8ga`SV6TA_BIW5#ZWV z{`*)c32kA}f=futY?#YE7kxGD|7L}4&OEDw$hkm+~<00QS>F_H?J#bz?uEHnl42f5(9 z5O)`6Q9V2o5;YVLUK)Y`7!Nr+4GMq?85s%^2?`BGDRU798Vn2?1`%>22R{iO0u>bk z9tlA?nk*O<3zHJH6&Mp5qALj)E(mxM!Y&vII4dm@1Ov{`f*8pL3xPEVUI>D>1_uxa kNm?`6VH{N6Di;P13m6<67z+;u7qCYM7XkVK^`jvGJD~P?KL7v# literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-tongue-out.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-tongue-out.gif new file mode 100644 index 0000000000000000000000000000000000000000..2075dc16058f1f17912167675ce5cfb9986fc71d GIT binary patch literal 328 zcmV-O0k{4~Nk%w1VG;lm0Mrx!CJF+^#>SU@3-{U*rx+Q^wrc$ABfqLn@9*x?z8(4X zSW-O=@){bmmI~g|GQXoP);cvj3|f1M8e@{G*!tYaiCEujj1NGxRN#6#tiCETo+{x{Hkzt z5k-kPvcD=V2nbmjCgL6k{uF&2nP-t0s;w<385Nx2oxDb z9T5Pp7qJl?3Kkh9oe2sCr5F$p7zPSlsUH*@54w*83=9Or4;w)r2pcU95(FL|1Th;< aDaRQH4;Tal7#Y$v#?=Au0pHUfApkpvZg^t= literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-undecided.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-undecided.gif new file mode 100644 index 0000000000000000000000000000000000000000..bef7e257303f8243c89787e7a7f9955dd1f112e2 GIT binary patch literal 337 zcmV-X0j~Z>Nk%w1VG;lm0MroxDi#99#>R?y8~4}{%C>6#>?OadPVevTr-=vi@LATn z4rERY-qJF+n+?CCE&B3D{{3Shh?>WT0o%`b%*Voqm`dL;(4F35y zc485^n;g!+Bme*aA^8LW0018VEC2ui01^Na000Hf;3tYvX_jM3N=AnuogqakNi<9X zK?&0kwA8^tNn{?C$|IAYI1ZzT!2>}iuMddFK#NEkRl!7%6brJAnUs;)XcnA}TNBSP zxQ9;SvEfwYeSaGd2^|LqU~(QF1qBxr3Ii7x84ZVt8wCTKoSYAqc?p`G2onnpk`IOl z1`HLGj}riN2p1K12N4z&8IBDc6tEWs859;JtRB6>lf+xO9}yT19toMv8wnl`7(pKg j7zPv!OGgY81{hE&(iR3pP6ig;HPPS!_yOwPA0Yrc)=Yf3 literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-wink.gif b/system/sai/modules/saimod_sys_locale/tinymce/plugins/emoticons/img/smiley-wink.gif new file mode 100644 index 0000000000000000000000000000000000000000..0631c7616ec8624ddeee02b633326f697ee72f80 GIT binary patch literal 350 zcmV-k0ipg!Nk%w1VG;lm0Q4UK(ZVUl#>Sn03F^-g-qAA3wransPV?|t@9*x%vmQ`7 z4E*pcw3rOOq%3t@4*K#({N^40{c-yG`rz2Q!KfI-yq*61HrBop*VoqW<}&{JS@_x# zwwfF$4Fdh~IsgCwA^8La0018VEC2ui01^Na06+!X;3tYwX_ljiFp=e23$zWxW@`*G zN?2ty6iUNT!AMdPLn89IbS7WCB_mWF$+hzY-{PWkp(?(Xf;zbH~P z3jOdj?W+^YwrakfE8fyG&5jTBz!3WS`fgM_;MltQ+c}4GO8)(E`S3`@yq&d~5!ct& z)v79NObo)O7XSbNA^8LW0018VEC2ui01^Na000He;3tYwX_jM3QifI(nn6h_*=Wyk zUB{y}v=qYOIUF#R3dZPhAVv~H;(|a2yN_5FH&J0|$eJ3kw4gj1Y?v5d#>LMV12^6BYy$1)ZKA zga!|m2?POz0R)f>4+aPl8KD{gz`+G_9vLMFQU?RU!8uyH9}*i52|cC+7S0YEK_3Vk i1|APfM-Ltb8&4_H83sg61{vHn(cc000qNZzApkp'}),e+=""}),e+=""}var i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",popoverAlign:"bc-tl",panel:{autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent(''),this.hide())}},tooltip:"Emoticons"})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/example/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/example/plugin.min.js new file mode 100644 index 0000000..1ff20b4 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/example/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("example",function(t){t.addButton("example",{text:"My button",icon:!1,onclick:function(){t.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(e){t.insertContent("Title: "+e.data.title)}})}}),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:"http://www.tinymce.com",width:800,height:600,buttons:[{text:"Close",onclick:"close"}]})}})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/example_dependency/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/example_dependency/plugin.min.js new file mode 100644 index 0000000..e61bf47 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/example_dependency/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("example_dependency",function(){},["example"]); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/fullpage/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/fullpage/plugin.min.js new file mode 100644 index 0000000..0f15de4 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/fullpage/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("fullpage",function(e){function t(){var t=n();e.windowManager.open({title:"Document properties",data:t,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){i(tinymce.extend(t,e.data))}})}function n(){function t(e,t){var n=e.attr(t);return n||""}var n,i,r=a(),o={};return o.fontface=e.getParam("fullpage_default_fontface",""),o.fontsize=e.getParam("fullpage_default_fontsize",""),n=r.firstChild,7==n.type&&(o.xml_pi=!0,i=/encoding="([^"]+)"/.exec(n.value),i&&(o.docencoding=i[1])),n=r.getAll("#doctype")[0],n&&(o.doctype=""),n=r.getAll("title")[0],n&&n.firstChild&&(o.title=n.firstChild.value),u(r.getAll("meta"),function(e){var t,n=e.attr("name"),i=e.attr("http-equiv");n?o[n.toLowerCase()]=e.attr("content"):"Content-Type"==i&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")),t&&(o.docencoding=t[1]))}),n=r.getAll("html")[0],n&&(o.langcode=t(n,"lang")||t(n,"xml:lang")),n=r.getAll("link")[0],n&&"stylesheet"==n.attr("rel")&&(o.stylesheet=n.attr("href")),n=r.getAll("body")[0],n&&(o.langdir=t(n,"dir"),o.style=t(n,"style"),o.visited_color=t(n,"vlink"),o.link_color=t(n,"link"),o.active_color=t(n,"alink")),o}function i(t){function n(e,t,n){e.attr(t,n?n:void 0)}function i(e){o.firstChild?o.insert(e,o.firstChild):o.append(e)}var r,o,l,c,m,f=e.dom;r=a(),o=r.getAll("head")[0],o||(c=r.getAll("html")[0],o=new d("head",1),c.firstChild?c.insert(o,c.firstChild,!0):c.append(o)),c=r.firstChild,t.xml_pi?(m='version="1.0"',t.docencoding&&(m+=' encoding="'+t.docencoding+'"'),7!=c.type&&(c=new d("xml",7),r.insert(c,r.firstChild,!0)),c.value=m):c&&7==c.type&&c.remove(),c=r.getAll("#doctype")[0],t.doctype?(c||(c=new d("#doctype",10),t.xml_pi?r.insert(c,r.firstChild):i(c)),c.value=t.doctype.substring(9,t.doctype.length-1)):c&&c.remove(),t.docencoding&&(c=null,u(r.getAll("meta"),function(e){"Content-Type"==e.attr("http-equiv")&&(c=e)}),c||(c=new d("meta",1),c.attr("http-equiv","Content-Type"),c.shortEnded=!0,i(c)),c.attr("content","text/html; charset="+t.docencoding)),c=r.getAll("title")[0],t.title?c||(c=new d("title",1),c.append(new d("#text",3)).value=t.title,i(c)):c&&c.remove(),u("keywords,description,author,copyright,robots".split(","),function(e){var n,a,o=r.getAll("meta"),l=t[e];for(n=0;n"))}function a(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(s)}function r(t){function n(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}var i,r,l,d,m=t.content,f="",g=e.dom;t.selection||"raw"==t.format&&s||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(m=m.replace(/<(\/?)BODY/gi,"<$1body"),i=m.indexOf("",i),s=n(m.substring(0,i+1)),r=m.indexOf("\n"),l=a(),u(l.getAll("style"),function(e){e.firstChild&&(f+=e.firstChild.value)}),d=l.getAll("body")[0],d&&g.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),g.remove("fullpage_styles"),f&&(g.add(e.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},f),d=g.get("fullpage_styles"),d.styleSheet&&(d.styleSheet.cssText=f)))}function o(){var t,n="",i="";return e.getParam("fullpage_default_xml_pi")&&(n+='\n'),n+=e.getParam("fullpage_default_doctype",""),n+="\n\n\n",(t=e.getParam("fullpage_default_title"))&&(n+=""+t+"\n"),(t=e.getParam("fullpage_default_encoding"))&&(n+='\n'),(t=e.getParam("fullpage_default_font_family"))&&(i+="font-family: "+t+";"),(t=e.getParam("fullpage_default_font_size"))&&(i+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(i+="color: "+t+";"),n+="\n\n"}function l(t){t.selection||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(t.content=tinymce.trim(s)+"\n"+tinymce.trim(t.content)+"\n"+tinymce.trim(c))}var s,c,u=tinymce.each,d=tinymce.html.Node;e.addCommand("mceFullPageProperties",t),e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),e.on("BeforeSetContent",r),e.on("GetContent",l)}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/fullscreen/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/fullscreen/plugin.min.js new file mode 100644 index 0000000..92a3b70 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/fullscreen/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,a=i.body;return a.offsetWidth&&(e=a.offsetWidth,t=a.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){l.setStyle(c,"height",t().h-(s.clientHeight-c.clientHeight))}var s,c,u,d=document.body,m=document.documentElement;o=!o,s=e.getContainer().firstChild,c=e.getContentAreaContainer().firstChild,u=c.style,o?(i=u.width,a=u.height,u.width=u.height="100%",l.addClass(d,"mce-fullscreen"),l.addClass(m,"mce-fullscreen"),l.addClass(s,"mce-fullscreen"),l.bind(window,"resize",n),n(),r=n):(u.width=i,u.height=a,l.removeClass(d,"mce-fullscreen"),l.removeClass(m,"mce-fullscreen"),l.removeClass(s,"mce-fullscreen"),l.unbind(window,"resize",r)),e.fire("FullscreenStateChanged",{state:o})}var i,a,r,o=!1,l=tinymce.DOM;if(!e.settings.inline)return e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.on("remove",function(){r&&l.unbind(window,"resize",r)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return o}}}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/hr/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/hr/plugin.min.js new file mode 100644 index 0000000..ca36c92 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/hr/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"


    ")}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/image/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/image/plugin.min.js new file mode 100644 index 0000000..93de690 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/image/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("image",function(t){function e(t,e){function n(t,n){i.parentNode.removeChild(i),e({width:t,height:n})}var i=document.createElement("img");i.onload=function(){n(i.clientWidth,i.clientHeight)},i.onerror=function(){n()},i.src=t;var a=i.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(i)}function n(e){return function(){var n=t.settings.image_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(t){e(tinymce.util.JSON.parse(t))}}):e(n)}}function i(n){function i(){var t=[{text:"None",value:""}];return tinymce.each(n,function(e){t.push({text:e.text||e.title,value:e.value||e.url,menu:e.menu})}),t}function a(t){var e,n,i,a;e=s.find("#width")[0],n=s.find("#height")[0],i=e.value(),a=n.value(),s.find("#constrain")[0].checked()&&h&&u&&i&&a&&(t.control==e?(a=Math.round(i/h*a),n.value(a)):(i=Math.round(a/u*i),e.value(i))),h=i,u=a}function o(){function e(e){function i(){e.onload=e.onerror=null,t.selection.select(e),t.nodeChanged()}e.onload=function(){n.width||n.height||m.setAttribs(e,{width:e.clientWidth,height:e.clientHeight}),i()},e.onerror=i}var n=s.toJSON();""===n.width&&(n.width=null),""===n.height&&(n.height=null),""===n.style&&(n.style=null),n={src:n.src,alt:n.alt,width:n.width,height:n.height,style:n.style},t.undoManager.transact(function(){return n.src?(p?m.setAttribs(p,n):(n.id="__mcenew",t.selection.setContent(m.createHTML("img",n)),p=m.get("__mcenew"),m.setAttrib(p,"id",null)),e(p),void 0):(p&&(m.remove(p),t.nodeChanged()),void 0)})}function l(t){return t&&(t=t.replace(/px$/,"")),t}function r(){e(this.value(),function(t){t.width&&t.height&&(h=t.width,u=t.height,s.find("#width").value(h),s.find("#height").value(u))})}function c(){function t(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t}var e=s.toJSON(),n=m.parseStyle(e.style);m.setAttrib(p,"style",""),delete n.margin,n["margin-top"]=n["margin-bottom"]=t(e.vspace),n["margin-left"]=n["margin-right"]=t(e.hspace),n["border-width"]=t(e.border),s.find("#style").value(m.serializeStyle(m.parseStyle(m.serializeStyle(n))))}var s,d,h,u,g,m=t.dom,p=t.selection.getNode();h=m.getAttrib(p,"width"),u=m.getAttrib(p,"height"),"IMG"!=p.nodeName||p.getAttribute("data-mce-object")?p=null:d={src:m.getAttrib(p,"src"),alt:m.getAttrib(p,"alt"),width:h,height:u},n&&(g={name:"target",type:"listbox",label:"Image list",values:i(),onselect:function(t){var e=s.find("#alt");(!e.value()||t.lastControl&&e.value()==t.lastControl.text())&&e.value(t.control.text()),s.find("#src").value(t.control.value())}});var y=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:r},g,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:a},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:a},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}];t.settings.image_advtab?(p&&(d.hspace=l(p.style.marginLeft||p.style.marginRight),d.vspace=l(p.style.marginTop||p.style.marginBottom),d.border=l(p.style.borderWidth),d.style=t.dom.serializeStyle(t.dom.parseStyle(t.dom.getAttrib(p,"style")))),s=t.windowManager.open({title:"Insert/edit image",data:d,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:c},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:o})):s=t.windowManager.open({title:"Insert/edit image",data:d,body:y,onSubmit:o})}t.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:n(i),stateSelector:"img:not([data-mce-object])"}),t.addMenuItem("image",{icon:"image",text:"Insert image",onclick:n(i),context:"insert",prependToContext:!0})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/importcss/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/importcss/plugin.min.js new file mode 100644 index 0000000..69dd877 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/importcss/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("importcss",function(t){function e(e,s){function i(t,e){var o=t.href;if(e||c[o]){if(s){if(s instanceof RegExp&&!s.test(o))return;if("string"==typeof s&&-1===o.indexOf(s))return}n(t.imports,function(t){i(t,!0)}),n(t.cssRules||t.rules,function(t){t.styleSheet?i(t.styleSheet,!0):t.selectorText&&n(t.selectorText.split(","),function(t){r.push(tinymce.trim(t))})})}}var r=[],c={};n(t.contentCSS,function(t){c[t]=!0});try{n(e.styleSheets,i)}catch(o){}return r}function s(e){var s,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var i=n[1],r=n[2].substr(1).split(".").join(" ");return n[1]?(s={title:e},t.schema.getTextBlockElements()[i]?s.block=i:t.schema.getBlockElements()[i]?s.selector=i:s.inline=i):n[2]&&(s={inline:"span",title:e.substr(1),classes:r}),t.settings.importcss_merge_classes!==!1?s.classes=r:s.attributes={"class":r},s}}var n=tinymce.each;t.settings.style_formats||t.on("renderFormatsMenu",function(i){var r=t.settings.importcss_selector_converter||s,c={},o=t.settings.importcss_file_filter;t.settings.importcss_append||i.control.items().remove(),n(e(t.getDoc(),o),function(e){if(-1===e.indexOf(".mce-")&&!c[e]){var s=r(e);if(s){var n=s.name||tinymce.DOM.uniqueId();t.formatter.register(n,s),i.control.add(tinymce.extend({},i.control.settings.itemDefaults,{text:s.title,format:n}))}c[e]=!0}}),i.control.renderNew()})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/insertdatetime/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/insertdatetime/plugin.min.js new file mode 100644 index 0000000..08e2833 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/insertdatetime/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("insertdatetime",function(e){function t(t,n){function i(e,t){if(e=""+e,e.length'+i+"";var r=e.dom.getParent(e.selection.getStart(),"time");if(r)return e.dom.setOuterHTML(r,i),void 0}e.insertContent(i)}var i,a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),s="January February March April May June July August September October November December".split(" "),l=[];e.addCommand("mceInsertDate",function(){n(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){n(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("inserttime",{type:"splitbutton",title:"Insert time",onclick:function(){n(i||"%H:%M:%S")},menu:l}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){l.push({text:t(e),onclick:function(){i=e,n(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:l,context:"insert"})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/layer/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/layer/plugin.min.js new file mode 100644 index 0000000..eb1ad4b --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/layer/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function n(t){var n=e.dom;tinymce.each(n.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?n.addClass(e,"mceItemVisualAid"):n.removeClass(e,"mceItemVisualAid"),n.addClass(e,"mceItemLayer"))})}function i(n){var i,o,a=[],r=t(e.selection.getNode()),l=-1,s=-1;for(o=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&o.push(e)},"childNodes"),i=0;il&&o[i]==r&&(l=i);if(0>n){for(i=0;i-1?(o[l].style.zIndex=a[s],o[s].style.zIndex=a[l]):a[l]>0&&(o[l].style.zIndex=a[l]-1)}else{for(i=0;ia[l]){s=i;break}s>-1?(o[l].style.zIndex=a[s],o[s].style.zIndex=a[l]):o[l].style.zIndex=a[l]+1}e.execCommand("mceRepaint")}function o(){var t=e.dom,n=t.getPos(t.getParent(e.selection.getNode(),"*")),i=e.getBody();e.dom.add(i,"div",{style:{position:"absolute",left:n.x,top:n.y>20?n.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(i,i.innerHTML)}function a(){var n=t(e.selection.getNode());n||(n=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),n&&("absolute"==n.style.position.toLowerCase()?(e.dom.setStyles(n,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(n,"mceItemVisualAid"),e.dom.removeClass(n,"mceItemLayer")):(n.style.left||(n.style.left="20px"),n.style.top||(n.style.top="20px"),n.style.width||(n.style.width=n.width?n.width+"px":"100px"),n.style.height||(n.style.height=n.height?n.height+"px":"100px"),n.style.position="absolute",e.dom.setAttrib(n,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",o),e.addCommand("mceMoveForward",function(){i(1)}),e.addCommand("mceMoveBackward",function(){i(-1)}),e.addCommand("mceMakeAbsolute",function(){a()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(n){var i=t(n.target);i&&e.dom.setAttrib(i,"data-mce-style","")}),e.on("mousedown",function(n){var i,o=n.target,a=e.getDoc();tinymce.Env.gecko&&(t(o)?"on"!==a.designMode&&(a.designMode="on",o=a.body,i=o.parentNode,i.removeChild(o),i.appendChild(o)):"on"==a.designMode&&(a.designMode="off"))}),e.on("NodeChange",n)}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/legacyoutput/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/legacyoutput/plugin.min.js new file mode 100644 index 0000000..4f6f7c1 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/legacyoutput/plugin.min.js @@ -0,0 +1 @@ +!function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t){t.on("init",function(){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",i=e.explode(t.settings.font_size_style_values),o=t.schema;t.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(i,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){o.addValidElements(e+"[*]")}),o.getElementRule("font")||o.addValidElements("font[face|size|color|style]"),e.each(n.split(","),function(e){var t=o.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}(tinymce); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/link/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/link/plugin.min.js new file mode 100644 index 0000000..9cd7616 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/link/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function n(t){function n(e){var t=d.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),d.find("#href").value(e.control.value())}function i(){var e=[{text:"None",value:""}];return tinymce.each(t,function(t){e.push({text:t.text||t.title,value:t.value||t.url,menu:t.menu})}),e}function a(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function o(t){var n=[{text:"None",value:""}];return e.settings.target_list||n.push({text:"New window",value:"_blank"}),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var i=[];return tinymce.each(e.dom.select("a:not([href])"),function(e){var n=e.name||e.id;n&&i.push({text:n,value:"#"+n,selected:-1!=t.indexOf("#"+n)})}),i.length?(i.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:i,onselect:n}):void 0}function s(){c||0!==g.text.length||this.parent().parent().find("#text")[0].value(this.value())}var l,u,c,d,m,f,h,g={},p=e.selection,v=e.dom;l=p.getNode(),u=v.getParent(l,"a[href]"),g.text=c=u?u.innerText||u.textContent:p.getContent({format:"text"}),g.href=u?v.getAttrib(u,"href"):"",g.target=u?v.getAttrib(u,"target"):"",g.rel=u?v.getAttrib(u,"rel"):"","IMG"==l.nodeName&&(g.text=c=" "),t&&(m={type:"listbox",label:"Link list",values:i(),onselect:n}),e.settings.target_list!==!1&&(h={name:"target",type:"listbox",label:"Target",values:o(g.target)}),e.settings.rel_list&&(f={name:"rel",type:"listbox",label:"Rel",values:a(g.rel)}),d=e.windowManager.open({title:"Insert link",data:g,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:s,onkeyup:s},{name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){g.text=this.value()}},r(g.href),m,f,h],onSubmit:function(t){function n(t,n){window.setTimeout(function(){e.windowManager.confirm(t,n)},0)}function i(){a.text!=c?u?(e.focus(),u.innerHTML=a.text,v.setAttribs(u,{href:o,target:a.target?a.target:null,rel:a.rel?a.rel:null}),p.select(u)):e.insertContent(v.createHTML("a",{href:o,target:a.target?a.target:null,rel:a.rel?a.rel:null},a.text)):e.execCommand("mceInsertLink",!1,{href:o,target:a.target,rel:a.rel?a.rel:null})}var a=t.data,o=a.href;return o?o.indexOf("@")>0&&-1==o.indexOf("//")&&-1==o.indexOf("mailto:")?(n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(o="mailto:"+o),i()}),void 0):/^\s*www\./i.test(o)?(n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(o="http://"+o),i()}),void 0):(i(),void 0):(e.execCommand("unlink"),void 0)}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t(n)),this.showDialog=n,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/lists/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/lists/plugin.min.js new file mode 100644 index 0000000..2f7c884 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/lists/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("lists",function(e){var n=this;e.on("init",function(){function t(e){function n(n){var r,i,o;i=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],1==i.nodeType&&(r=L.create("span",{"data-mce-type":"bookmark"}),i.hasChildNodes()?(o=Math.min(o,i.childNodes.length-1),n?i.insertBefore(r,i.childNodes[o]):L.insertAfter(r,i.childNodes[o])):i.appendChild(r),i=r,o=0),t[n?"startContainer":"endContainer"]=i,t[n?"startOffset":"endOffset"]=o}var t={};return n(!0),e.collapsed||n(),t}function r(e){function n(n){function t(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n==e)return t;(1!=n.nodeType||"bookmark"!=n.getAttribute("data-mce-type"))&&t++,n=n.nextSibling}return-1}var r,i,o;r=o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"],r&&(1==r.nodeType&&(i=t(r),r=r.parentNode,L.remove(o)),e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=i)}n(!0),n();var t=L.createRng();t.setStart(e.startContainer,e.startOffset),e.endContainer&&t.setEnd(e.endContainer,e.endOffset),b.setRng(t)}function i(e){return e&&/^(OL|UL)$/.test(e.nodeName)}function o(e){return e.parentNode.firstChild==e}function a(e){return e.parentNode.lastChild==e}function d(n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]}function f(e){return e&&"SPAN"===e.nodeName&&"bookmark"===e.getAttribute("data-mce-type")}function s(n,t){var r,i,o;if(e.settings.forced_root_block&&(t=t||e.settings.forced_root_block),i=t?L.create(t):L.createFragment(),n)for(;r=n.firstChild;)o||"SPAN"==r.nodeName&&"bookmark"==r.getAttribute("data-mce-type")||(o=!0),i.appendChild(r);return e.settings.forced_root_block?o||tinymce.Env.ie&&!(tinymce.Env.ie>10)||i.appendChild(L.create("br",{"data-mce-bogus":"1"})):i.appendChild(L.create("br")),i}function c(){return tinymce.grep(b.getSelectedBlocks(),function(e){return"LI"==e.nodeName})}function l(e,n,t){var r,i,o=L.select('span[data-mce-type="bookmark"]',e);t=t||s(n),r=L.createRng(),r.setStartAfter(n),r.setEndAfter(e),i=r.extractContents(),L.isEmpty(i)||L.insertAfter(i,e),L.insertAfter(t,e),L.isEmpty(n.parentNode)&&(tinymce.each(o,function(e){n.parentNode.parentNode.insertBefore(e,n.parentNode)}),L.remove(n.parentNode)),L.remove(n)}function u(e){var n,t;if(n=e.nextSibling,n&&i(n)&&n.nodeName==e.nodeName){for(;t=n.firstChild;)e.appendChild(t);L.remove(n)}if(n=e.previousSibling,n&&i(n)&&n.nodeName==e.nodeName){for(;t=n.firstChild;)e.insertBefore(t,e.firstChild);L.remove(n)}}function p(e){tinymce.each(tinymce.grep(L.select("ol,ul",e)),function(e){var n,t=e.parentNode;"LI"==t.nodeName&&t.firstChild==e&&(n=t.previousSibling,n&&"LI"==n.nodeName&&(n.appendChild(e),L.isEmpty(t)&&L.remove(t))),i(t)&&(n=t.previousSibling,n&&"LI"==n.nodeName&&n.appendChild(e))})}function m(e){function n(e){L.isEmpty(e)&&L.remove(e)}var t,r=e.parentNode,d=r.parentNode;if(o(e)&&a(e))if("LI"==d.nodeName)L.insertAfter(e,d),n(d),L.remove(r);else{if(!i(d))return d.insertBefore(s(e),r),L.remove(r),void 0;L.remove(r,!0)}else if(o(e))if("LI"==d.nodeName)L.insertAfter(e,d),t=L.create("LI"),t.appendChild(r),L.insertAfter(t,e),n(d);else{if(!i(d))return d.insertBefore(s(e),r),L.remove(e),void 0;d.insertBefore(e,r)}else if(a(e))if("LI"==d.nodeName)L.insertAfter(e,d);else{if(!i(d))return L.insertAfter(s(e),r),L.remove(e),void 0;L.insertAfter(e,r)}else"LI"==d.nodeName?(r=d,t=s(e,"LI")):t=i(d)?s(e,"LI"):s(e),l(r,e,t),p(r.parentNode);return!0}function v(e){var n,t;return n=e.previousSibling,n&&"UL"==n.nodeName?(n.appendChild(e),void 0):n&&"LI"==n.nodeName&&i(n.lastChild)?(n.lastChild.appendChild(e),void 0):(n=e.nextSibling,n&&"UL"==n.nodeName?(n.insertBefore(e,n.firstChild),void 0):n&&"LI"==n.nodeName&&i(e.lastChild)?void 0:(n=e.previousSibling,n&&"LI"==n.nodeName&&(t=L.create(e.parentNode.nodeName),n.appendChild(t),t.appendChild(e)),!0))}function N(){var e,n=t(b.getRng(!0));return tinymce.each(c(),function(n){v(n)&&(e=!0)}),r(n),e}function h(){var e,n=t(b.getRng(!0));return tinymce.each(c(),function(n){m(n)&&(e=!0)}),r(n),e}function C(n){function o(){function n(e){var n,t;for(n=a[e?"startContainer":"endContainer"],t=a[e?"startOffset":"endOffset"],1==n.nodeType&&(n=n.childNodes[Math.min(t,n.childNodes.length-1)]||n);n.parentNode!=i;){if(d(n))return n;if(/^(TD|TH)$/.test(n.parentNode.nodeName))return n;n=n.parentNode}return n}for(var t,r=[],i=e.getBody(),o=n(!0),s=n(),c=[],l=o;l&&(c.push(l),l!=s);l=l.nextSibling);return tinymce.each(c,function(e){if(d(e))return r.push(e),t=null,void 0;if(L.isBlock(e)||"BR"==e.nodeName)return"BR"==e.nodeName&&L.remove(e),t=null,void 0;var n=e.nextSibling;return f(e)&&(d(n)||!n&&e.parentNode==i)?(t=null,void 0):(t||(t=L.create("p"),e.parentNode.insertBefore(t,e),r.push(t)),t.appendChild(e),void 0)}),r}var a=b.getRng(!0),s=t(a),c=o();tinymce.each(c,function(e){var t,r;r=e.previousSibling,r&&i(r)&&r.nodeName==n?(t=r,e=L.rename(e,"LI"),r.appendChild(e)):(t=L.create(n),e.parentNode.insertBefore(t,e),t.appendChild(e),e=L.rename(e,"LI")),u(t)}),r(s)}function g(){var e=t(b.getRng(!0));tinymce.each(c(),function(e){var n,t;if(L.isEmpty(e))return m(e),void 0;for(n=e;n;n=n.parentNode)i(n)&&(t=n);l(t,e)}),r(e)}function y(e){var n=L.getParent(b.getStart(),"OL,UL");if(n)if(n.nodeName==e)g(e);else{var i=t(b.getRng(!0));u(L.rename(n,e)),r(i)}else C(e)}var L=e.dom,b=e.selection;n.backspaceDelete=function(e){function n(e,n){var t=e.startContainer,r=e.startOffset;if(3==t.nodeType&&(n?r0))return t;for(var i=new tinymce.dom.TreeWalker(e.startContainer);t=i[n?"next":"prev"]();)if(3==t.nodeType&&t.data.length>0)return t}function o(e,n){var t,r,o=e.parentNode;for(i(n.lastChild)&&(r=n.lastChild),t=n.lastChild,t&&"BR"==t.nodeName&&e.hasChildNodes()&&L.remove(t);t=e.firstChild;)n.appendChild(t);r&&n.appendChild(r),L.remove(e),L.isEmpty(o)&&L.remove(o)}if(b.isCollapsed()){var a=L.getParent(b.getStart(),"LI");if(a){var d=b.getRng(!0),f=L.getParent(n(d,e),"LI");if(f&&f!=a){var s=t(d);return e?o(f,a):o(a,f),r(s),!0}if(!f&&!e&&g(a.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return N()?void 0:!0}),e.addCommand("Outdent",function(){return h()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){y("UL")}),e.addCommand("InsertOrderedList",function(){y("OL")})}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?n.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&n.backspaceDelete(!0)&&e.preventDefault()})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/media/moxieplayer.swf b/system/sai/modules/saimod_sys_locale/tinymce/plugins/media/moxieplayer.swf new file mode 100644 index 0000000000000000000000000000000000000000..19c771bea50c6665fe0ee5f46515e9686427dbc7 GIT binary patch literal 20017 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':"application/x-shockwave-flash"==i.source1mime?(r+='',i.poster&&(r+=''),r+=""):-1!=i.source1mime.indexOf("audio")?e.settings.audio_template_callback?r=e.settings.audio_template_callback(i):r+='":r=e.settings.video_template_callback?e.settings.video_template_callback(i):'"),r):""}function o(e){var t={};return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",start:function(e,n){t.source1||"param"!=e||(t.source1=n.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t=tinymce.extend(n.map,t)),"source"==e&&(t.source1?t.source2||(t.source2=n.map.src):t.source1=n.map.src),"img"!=e||t.poster||(t.poster=n.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?o(e.serializer.serialize(t,{selection:!0})):{}}function c(e,t,n){function i(e,t){var n,i,r,a;for(n in t)if(r=""+t[n],e.map[n])for(i=e.length;i--;)a=e[i],a.name==n&&(r?(e.map[n]=r,a.value=r):(delete e.map[n],e.splice(i,1)));else r&&(e.push({name:n,value:r}),e.map[n]=r)}var r,a=new tinymce.html.Writer,o=0;return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,s,c){switch(e){case"video":case"object":case"img":case"iframe":i(s,{width:t.width,height:t.height})}if(n)switch(e){case"video":i(s,{poster:t.poster,src:""}),t.source2&&i(s,{src:""});break;case"iframe":i(s,{src:t.source1});break;case"source":if(o++,2>=o&&(i(s,{src:t["source"+o],type:t["source"+o+"mime"]}),!t["source"+o]))return;break;case"img":if(!t.poster)return;r=!0}a.start(e,s,c)},end:function(e){if("video"==e&&n)for(var s=1;2>=s;s++)if(t["source"+s]){var c=[];c.map={},s>o&&(i(c,{src:t["source"+s],type:t["source"+s+"mime"]}),a.start("source",c,!0))}if(t.poster&&"object"==e&&n&&!r){var l=[];l.map={},i(l,{src:t.poster,width:t.width,height:t.height}),a.start("img",l,!0)}a.end(e)}},new tinymce.html.Schema({})).parse(e),a.getContent()}var l=[{regex:/youtu\.be\/([a-z1-9.-_]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"http://player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'http://maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("]*>","gi")}),e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]");var n=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){n[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed",function(t,n){for(var i,r,a,o,s,c,l,d=t.length;d--;){for(r=t[d],a=new tinymce.html.Node("img",1),a.shortEnded=!0,c=r.attributes,i=c.length;i--;)o=c[i].name,s=c[i].value,"width"!==o&&"height"!==o&&"style"!==o&&(("data"==o||"src"==o)&&(s=e.convertURL(s,o)),a.attr("data-mce-p-"+o,s));l=r.firstChild&&r.firstChild.value,l&&(a.attr("data-mce-html",escape(l)),a.firstChild=null),a.attr({width:r.attr("width")||"300",height:r.attr("height")||("audio"==n?"30":"150"),style:r.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),r.replace(a)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var n,i,r,a,o,s,c=e.length;c--;){for(n=e[c],i=new tinymce.html.Node(n.attr(t),1),"audio"!=n.attr(t)&&i.attr({width:n.attr("width"),height:n.attr("height")}),i.attr({style:n.attr("style")}),a=n.attributes,r=a.length;r--;){var l=a[r].name;0===l.indexOf("data-mce-p-")&&i.attr(l.substr(11),a[r].value)}o=n.attr("data-mce-html"),o&&(s=new tinymce.html.Node("#text",3),s.raw=!0,s.value=unescape(o),i.append(s)),n.replace(i)}})}),e.on("ObjectSelected",function(e){"audio"==e.target.getAttribute("data-mce-object")&&e.preventDefault()}),e.on("objectResized",function(e){var t,n=e.target;n.getAttribute("data-mce-object")&&(t=n.getAttribute("data-mce-html"),t&&(t=unescape(t),n.setAttribute("data-mce-html",escape(c(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:i,stateSelector:"img[data-mce-object=video]"}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:i,context:"insert",prependToContext:!0})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/moxiemanager/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/moxiemanager/plugin.min.js new file mode 100644 index 0000000..5540ee2 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/moxiemanager/plugin.min.js @@ -0,0 +1 @@ +(function(exports,undefined){"use strict";var modules={};function require(ids,callback){var module,defs=[];for(var i=0;i0){style=doc.createElement("style");style.textContent='@import "'+url+'"';waitForGeckoLinkLoaded();appendToHead(style);return}else{waitForWebKitLinkLoaded()}}appendToHead(link)}};return Loader});define(__moxman_Env,[],function(){return{apiPageName:"api.php",ie7:document.all&&!window.opera&&!document.documentMode}});define(__moxman_util_I18n,[],function(){"use strict";function resolve(id){var target=window;var fragments=id.split(/\//);for(var fi=0;fi1048576){return Math.round(value/1048576,1)+" MB"}if(value>1024){return Math.round(value/1024,1)+" KB"}return value+" b"}})}var zIndex=editor.windowManager.zIndex;if(tinymce.ui.FloatPanel){zIndex=tinymce.ui.FloatPanel.currentZIndex}Loader.browse(tinymce.extend({zIndex:zIndex,document_base_url:editorSettings.document_base_url,oninsert:function(args){var html="";tinymce.each(args.files,function(file,i){var isImage=/\.(gif|jpe?g|png)$/i.test(file.name);selection.setRng(lastRng);if(!isImage&&!selection.isCollapsed()){editor.execCommand("mceInsertLink",file.meta.url);return false}if(i>0){html+=" "}if(isImage){html+=processTemplate(editor.getParam("moxiemanager_image_template",''),file)}else{html+=processTemplate(editor.getParam("moxiemanager_file_template",'{$name}'),file)}});selection.setRng(lastRng);editor.execCommand("mceInsertContent",false,html)}},getBrowseSettings()))});if(tinymce.Env){editor.addButton("insertfile",{icon:"browse",title:"Insert file",cmd:"mceInsertFile"})}else{editor.addButton("insertfile",{image:url+"/skins/lightgray/img/insertfile.gif",title:editor.getLang("moxiemanager_insert","Insert file"),cmd:"mceInsertFile"})}});var langCode=tinymce.settings?tinymce.settings.language:"auto";if(langCode&&langCode!="en"){tinymce.ScriptLoader.load((tinymce.PluginManager.urls.moxiemanager||tinymce.baseURL+"/plugins/moxiemanager")+"/"+Env.apiPageName+"?action=language&tinymce=true&code="+langCode)}});expose([__moxman_util_Loader,__moxman_Env,__moxman_util_I18n,__moxman_Loader,__moxman_interop_TinyMcePlugin])})(this); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/nonbreaking/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/nonbreaking/plugin.min.js new file mode 100644 index 0000000..866339c --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/nonbreaking/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("nonbreaking",function(e){var t=e.getParam("nonbreaking_force_tab");if(e.addCommand("mceNonBreaking",function(){e.insertContent(e.plugins.visualchars&&e.plugins.visualchars.state?' ':" ")}),e.addButton("nonbreaking",{title:"Insert nonbreaking space",cmd:"mceNonBreaking"}),e.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),t){var n=+t>1?+t:3;e.on("keydown",function(t){if(9==t.keyCode){if(t.shiftKey)return;t.preventDefault();for(var i=0;n>i;i++)e.execCommand("mceNonBreaking")}})}}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/noneditable/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/noneditable/plugin.min.js new file mode 100644 index 0000000..dd15d59 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/noneditable/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("noneditable",function(e){function t(){function t(e){var t;if(1===e.nodeType){if(t=e.getAttribute(s),t&&"inherit"!==t)return t;if(t=e.contentEditable,"inherit"!==t)return t}return null}function n(e){for(var n;e;){if(n=t(e))return"false"===n?e:null;e=e.parentNode}}function i(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function o(e){var t;if(e)for(t=new r(e,e),e=t.current();e;e=t.next())if(3===e.nodeType)return e}function a(n,i){var o,a;return"false"===t(n)&&m.isBlock(n)?(f.select(n),void 0):(a=m.createRng(),"true"===t(n)&&(n.firstChild||n.appendChild(e.getDoc().createTextNode(" ")),n=n.firstChild,i=!0),o=m.create("span",{id:g,"data-mce-bogus":!0},p),i?n.parentNode.insertBefore(o,n):m.insertAfter(o,n),a.setStart(o.firstChild,1),a.collapse(!0),f.setRng(a),o)}function l(e){var t,n,a,r;if(e)t=f.getRng(!0),t.setStartBefore(e),t.setEndBefore(e),n=o(e),n&&n.nodeValue.charAt(0)==p&&(n=n.deleteData(0,1)),m.remove(e,!0),f.setRng(t);else for(a=i(f.getStart());(e=m.get(g))&&e!==r;)a!==e&&(n=o(e),n&&n.nodeValue.charAt(0)==p&&(n=n.deleteData(0,1)),m.remove(e,!0)),r=e}function d(){function e(e,n){var i,o,a,l,s;if(i=c.startContainer,o=c.startOffset,3==i.nodeType){if(s=i.nodeValue.length,o>0&&s>o||(n?o==s:0===o))return}else{if(!(o0?o-1:o;i=i.childNodes[d],i.hasChildNodes()&&(i=i.firstChild)}for(a=new r(i,e);l=a[n?"prev":"next"]();){if(3===l.nodeType&&l.nodeValue.length>0)return;if("true"===t(l))return l}return e}var i,o,s,c,d;l(),s=f.isCollapsed(),i=n(f.getStart()),o=n(f.getEnd()),(i||o)&&(c=f.getRng(!0),s?(i=i||o,(d=e(i,!0))?a(d,!0):(d=e(i,!1))?a(d,!1):f.select(i)):(c=f.getRng(!0),i&&c.setStartBefore(i),o&&c.setEndAfter(o),f.setRng(c)))}function u(o){function a(e,t){for(;e=e[t?"previousSibling":"nextSibling"];)if(3!==e.nodeType||e.nodeValue.length>0)return e}function s(e,t){f.select(e),f.collapse(t)}function u(o){function a(e){for(var t=s;t;){if(t===e)return;t=t.parentNode}m.remove(e),d()}function r(){var i,r,l=e.schema.getNonEmptyElements();for(r=new tinymce.dom.TreeWalker(s,e.getBody());(i=o?r.prev():r.next())&&!l[i.nodeName.toLowerCase()]&&!(3===i.nodeType&&tinymce.trim(i.nodeValue).length>0);)if("false"===t(i))return a(i),!0;return n(i)?!0:!1}var l,s,c,u;if(f.isCollapsed()){if(l=f.getRng(!0),s=l.startContainer,c=l.startOffset,s=i(s)||s,u=n(s))return a(u),!1;if(3==s.nodeType&&(o?c>0:cv||v>124)&&v!=c.DELETE&&v!=c.BACKSPACE){if((tinymce.isMac?o.metaKey:o.ctrlKey)&&(67==v||88==v||86==v))return;if(o.preventDefault(),v==c.LEFT||v==c.RIGHT){var b=v==c.LEFT;if(e.dom.isBlock(g)){var x=b?g.previousSibling:g.nextSibling,w=new r(x,x),C=b?w.prev():w.next();s(C,!b)}else s(g,b)}}else if(v==c.LEFT||v==c.RIGHT||v==c.BACKSPACE||v==c.DELETE){if(p=i(h)){if(v==c.LEFT||v==c.BACKSPACE)if(g=a(p,!0),g&&"false"===t(g)){if(o.preventDefault(),v!=c.LEFT)return m.remove(g),void 0;s(g,!0)}else l(p);if(v==c.RIGHT||v==c.DELETE)if(g=a(p),g&&"false"===t(g)){if(o.preventDefault(),v!=c.RIGHT)return m.remove(g),void 0;s(g,!1)}else l(p)}if((v==c.BACKSPACE||v==c.DELETE)&&!u(v==c.BACKSPACE))return o.preventDefault(),!1}}var m=e.dom,f=e.selection,g="mce_noneditablecaret",p="";e.on("mousedown",function(n){var i=e.selection.getNode();"false"===t(i)&&i==n.target&&d()}),e.on("mouseup keyup",d),e.on("keydown",u)}function n(t){var n=a.length,i=t.content,r=tinymce.trim(o);if("raw"!=t.format){for(;n--;)i=i.replace(a[n],function(t){var n=arguments,o=n[n.length-2];return o>0&&'"'==i.charAt(o-1)?t:''+e.dom.encode("string"==typeof n[1]?n[1]:n[0])+""});t.content=i}}var i,o,a,r=tinymce.dom.TreeWalker,l="contenteditable",s="data-mce-"+l,c=tinymce.util.VK;i=" "+tinymce.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",o=" "+tinymce.trim(e.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",a=e.getParam("noneditable_regexp"),a&&!a.length&&(a=[a]),e.on("PreInit",function(){t(),a&&e.on("BeforeSetContent",n),e.parser.addAttributeFilter("class",function(e){for(var t,n,a=e.length;a--;)n=e[a],t=" "+n.attr("class")+" ",-1!==t.indexOf(i)?n.attr(s,"true"):-1!==t.indexOf(o)&&n.attr(s,"false")}),e.serializer.addAttributeFilter(s,function(e){for(var t,n=e.length;n--;)t=e[n],a&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):(t.attr(l,null),t.attr(s,null))}),e.parser.addAttributeFilter(l,function(e){for(var t,n=e.length;n--;)t=e[n],t.attr(s,t.attr(l)),t.attr(l,null)})})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/pagebreak/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/pagebreak/plugin.min.js new file mode 100644 index 0000000..8f535fa --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/pagebreak/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("pagebreak",function(e){var t,n="mce-pagebreak",i=e.getParam("pagebreak_separator",""),a='';t=new RegExp(i.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),e.addCommand("mcePageBreak",function(){e.execCommand("mceInsertContent",0,a)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(t){"IMG"==t.target.nodeName&&e.dom.hasClass(t.target,n)&&(t.name="pagebreak")}),e.on("click",function(t){t=t.target,"IMG"===t.nodeName&&e.dom.hasClass(t,n)&&e.selection.select(t)}),e.on("BeforeSetContent",function(e){e.content=e.content.replace(t,a)}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(e){for(var t,n,a=e.length;a--;)t=e[a],n=t.attr("class"),n&&-1!==n.indexOf("mce-pagebreak")&&(t.type=3,t.value=i,t.raw=!0)})})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/paste/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/paste/plugin.min.js new file mode 100644 index 0000000..e660199 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/paste/plugin.min.js @@ -0,0 +1 @@ +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i]+>/g,"")),(i.settings.paste_remove_styles||i.settings.paste_remove_styles_if_webkit!==!1&&e.webkit)&&(t=t.replace(/ style=\"[^\"]+\"/g,"")),n.isDefaultPrevented()||i.insertContent(t)}function d(e){e=i.dom.encode(e).replace(/\r\n/g,"\n");var t=i.dom.getParent(i.selection.getStart(),i.dom.isBlock);e=t&&/^(PRE|DIV)$/.test(t.nodeName)||!i.settings.forced_root_block?c(e,[[/\n/g,"
    "]]):c(e,[[/\n\n/g,"

    "],[/^(.*<\/p>)(

    )$/,"

    $1"],[/\n/g,"
    "]]);var n=i.fire("PastePreProcess",{content:e});n.isDefaultPrevented()||i.insertContent(n.content)}function f(){var e=i.dom.getViewPort().y,t=i.dom.add(i.getBody(),"div",{contentEditable:!1,"data-mce-bogus":"1",style:"position: absolute; top: "+e+"px; left: 0; width: 1px; height: 1px; overflow: hidden"},'

    X
    ');return i.dom.bind(t,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),t}function p(e){i.dom.unbind(e),i.dom.remove(e)}var m=this,h;if(i.on("keydown",function(e){n.metaKeyPressed(e)&&e.shiftKey&&86==e.keyCode&&(h=o())}),r())i.on("paste",function(e){function t(e,t){for(var r=0;r100){var n,r=f();t.preventDefault(),e.bind(r,"paste",function(e){e.stopPropagation(),n=!0});var a=i.selection.getRng(),c=e.doc.body.createTextRange();if(c.moveToElementText(r.firstChild),c.execCommand("Paste"),p(r),!n)return i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."),void 0;i.selection.setRng(a),l()?d(s(r.firstChild)):u(r.firstChild.innerHTML)}})})}else i.on("init",function(){i.dom.bind(i.getBody(),"paste",function(e){var t=i.getDoc();return e.preventDefault(),e.clipboardData||t.dataTransfer?(d((e.clipboardData||t.dataTransfer).getData("Text")),void 0):(e.preventDefault(),i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."),void 0)})}),i.on("keydown",function(t){if(a(t)&&!t.isDefaultPrevented()){t.stopImmediatePropagation();var n=f(),r=i.selection.getRng();e.webkit&&i.inline&&(n.contentEditable=!0),i.selection.select(n,!0),i.dom.bind(n,"paste",function(e){e.stopPropagation(),setTimeout(function(){p(n),i.lastRng=r,i.selection.setRng(r);var e=n.firstChild;e.lastChild&&"BR"==e.lastChild.nodeName&&e.removeChild(e.lastChild),l()?d(s(e)):u(e.innerHTML)},0)})}});i.settings.paste_data_images||i.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()})}i.paste_block_drop&&i.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),this.paste=u,this.pasteText=d}}),r(f,[u,p,m,h,g],function(e,t,n,r,i){return function(o){var a=e.each;o.on("PastePreProcess",function(s){function l(e){a(e,function(e){d=e.constructor==RegExp?d.replace(e,""):d.replace(e[0],e[1])})}function c(e){function t(e,t,a,s){var l=e._listLevel||o;l!=o&&(o>l?n&&(n=n.parent.parent):(r=n,n=null)),n&&n.name==a?n.append(e):(r=r||n,n=new i(a,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>o&&r&&r.lastChild.append(n),o=l}for(var n,r,o=1,a=e.getAll("p"),s=0;s/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var m=new n({valid_elements:"@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[!href],sub,sup,strike"}),h=new t({},m);h.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",u(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()});var g=h.parse(d);c(g),s.content=new r({},m).serialize(g)}})}}),r(v,[c,u],function(e,t){return function(n){function r(e){n.on("PastePreProcess",function(t){t.content=e(t.content)})}function i(e,n){return t.each(n,function(t){e=t.constructor==RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function o(e){return e=i(e,[/^[\s\S]*|[\s\S]*$/g,[/\u00a0<\/span>/g,"\xa0"],/
    $/])}function a(e){if(!s){var r=[];t.each(n.schema.getBlockElements(),function(e,t){r.push(t)}),s=new RegExp("(?:
     [\\s\\r\\n]+|
    )*(<\\/?("+r.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g")}return e=i(e,[[s,"$1"]]),e=i(e,[[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}var s;e.webkit&&r(o),e.ie&&r(a)}}),r(y,[b,l,f,v],function(e,t,n,r){var i;e.add("paste",function(e){function o(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),i||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),i=!0))}var a=this,s;a.clipboard=s=new t(e),a.quirks=new r(e),a.wordFilter=new n(e),e.settings.paste_as_text&&(a.clipboard.pasteFormat="text"),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&a.clipboard.paste(t.content),t.text&&a.clipboard.pasteText(t.text)}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:o,active:"text"==a.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:o})})}),a([l,f,v,y])}(this); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/preview/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/preview/plugin.min.js new file mode 100644 index 0000000..b8430c6 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/preview/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("preview",function(e){var t=e.settings;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'',buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var n,i=this.getEl("body").firstChild.contentWindow.document,a="";tinymce.each(e.contentCSS,function(t){a+=''});var r=t.body_id||"tinymce";-1!=r.indexOf("=")&&(r=e.getParam("body_id","","hash"),r=r[e.id]||r);var o=t.body_class||"";-1!=o.indexOf("=")&&(o=e.getParam("body_class","","hash"),o=o[e.id]||""),n=""+a+""+''+e.getContent()+""+"",i.open(),i.write(n),i.close()}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/print/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/print/plugin.min.js new file mode 100644 index 0000000..abc37b5 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/print/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("print",function(t){t.addCommand("mcePrint",function(){t.getWin().print()}),t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addShortcut("Ctrl+P","","mcePrint"),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/save/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/save/plugin.min.js new file mode 100644 index 0000000..bd50cec --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/save/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("save",function(e){function t(){var t,n;return t=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty()?(tinymce.triggerSave(),(n=e.getParam("save_onsavecallback"))?(e.execCallback("save_onsavecallback",e)&&(e.startContent=tinymce.trim(e.getContent({format:"raw"})),e.nodeChanged()),void 0):(t?(e.isNotDirty=!0,(!t.onsubmit||t.onsubmit())&&("function"==typeof t.submit?t.submit():e.windowManager.alert("Error: Form submit field collision.")),e.nodeChanged()):e.windowManager.alert("Error: No form element found."),void 0)):void 0}function n(){var t,n=tinymce.trim(e.startContent);return(t=e.getParam("save_oncancelcallback"))?(e.execCallback("save_oncancelcallback",e),void 0):(e.setContent(n),e.undoManager.clear(),e.nodeChanged(),void 0)}function i(){var t=this;e.on("nodeChange",function(){t.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",t),e.addCommand("mceCancel",n),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:i}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:i}),e.addShortcut("ctrl+s","","mceSave")}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/searchreplace/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/searchreplace/plugin.min.js new file mode 100644 index 0000000..b9c4fcc --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/searchreplace/plugin.min.js @@ -0,0 +1 @@ +!function(){function e(e,t,n,i,a){function r(e,t){if(t=t||0,!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var n=e.index;if(t>0){var i=e[t];if(!i)throw"Invalid capture group";n+=e[0].indexOf(i),e[0]=i}return[n,n+e[0].length,[e[0]]]}function o(e){var t;if(3===e.nodeType)return e.data;if(f[e.nodeName])return"";if(t="",(m[e.nodeName]||h[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=o(e);while(e=e.nextSibling);return t}function c(e,t,n){var i,a,r,o,c=[],s=0,d=e,l=t.shift(),u=0;e:for(;;){if((m[d.nodeName]||h[d.nodeName])&&s++,3===d.nodeType&&(!a&&d.length+s>=l[1]?(a=d,o=l[1]-s):i&&c.push(d),!i&&d.length+s>l[0]&&(i=d,r=l[0]-s),s+=d.length),i&&a){if(d=n({startNode:i,startNodeIndex:r,endNode:a,endNodeIndex:o,innerNodes:c,match:l[2],matchIndex:u}),s-=a.length-o,i=null,a=null,c=[],l=t.shift(),u++,!l)break}else{if(!f[d.nodeName]&&d.firstChild){d=d.firstChild;continue}if(d.nextSibling){d=d.nextSibling;continue}}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}function s(e){var t;if("function"!=typeof e){var n=e.nodeType?e:u.createElement(e);t=function(e,t){var i=n.cloneNode(!1);return i.setAttribute("data-mce-index",t),e&&i.appendChild(u.createTextNode(e)),i}}else t=e;return function(e){var n,i,a,r=e.startNode,o=e.endNode,c=e.matchIndex;if(r===o){var s=r;a=s.parentNode,e.startNodeIndex>0&&(n=u.createTextNode(s.data.substring(0,e.startNodeIndex)),a.insertBefore(n,s));var d=t(e.match[0],c);return a.insertBefore(d,s),e.endNodeIndexf;++f){var p=e.innerNodes[f],g=t(p.data,c);p.parentNode.replaceChild(g,p),m.push(g)}var v=t(o.data.substring(0,e.endNodeIndex),c);return a=r.parentNode,a.insertBefore(n,r),a.insertBefore(l,r),a.removeChild(r),a=o.parentNode,a.insertBefore(v,o),a.insertBefore(i,o),a.removeChild(o),v}}var d,l,u,m,f,h,p=[],g=0;if(u=t.ownerDocument,m=a.getBlockElements(),f=a.getWhiteSpaceElements(),h=a.getShortEndedElements(),l=o(t)){if(e.global)for(;d=e.exec(l);)p.push(r(d,i));else d=l.match(e),p.push(r(d,i));return p.length&&(g=p.length,c(t,p,s(n))),g}}function t(t){function n(){var e=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){t.focus(),o=!1,c.unmarkAllMatches()},buttons:[{text:"Find",onclick:function(){e.find("form")[0].submit()}},{text:"Replace",disabled:!0,onclick:function(){c.replace(e.find("#replace").value())||e.statusbar.items().slice(1).disabled(!0)}},{text:"Replace all",disabled:!0,onclick:function(){c.replaceAll(e.find("#replace").value()),e.statusbar.items().slice(1).disabled(!0)}},{type:"spacer",flex:1},{text:"Prev",disabled:!0,onclick:function(){c.prev()}},{text:"Next",disabled:!0,onclick:function(){c.next()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,onsubmit:function(t){var n,i,a,r,o;return t.preventDefault(),a=e.find("#case").checked(),o=e.find("#words").checked(),r=e.find("#find").value(),r.length?(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),r=o?"\\b"+r+"\\b":r,i=new RegExp(r,a?"g":"gi"),n=c.markAllMatches(i),n?c.first():tinymce.ui.MessageBox.alert("Could not find the specified string."),e.statusbar.items().slice(1).disabled(0===n),void 0):(c.unmarkAllMatches(),e.statusbar.items().slice(1).disabled(!0),void 0)},items:[{type:"textbox",name:"find",size:40,label:"Find",value:t.selection.getNode().src},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow();o=!0}function i(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function a(e,n){function i(){var i,o;for(i=n?t.getBody()[e?"firstChild":"lastChild"]:c[e?"endContainer":"startContainer"],o=new tinymce.dom.TreeWalker(i,t.getBody());i=o.current();){if(1==i.nodeType&&"SPAN"==i.nodeName&&null!==i.getAttribute("data-mce-index"))for(s=i.getAttribute("data-mce-index"),a=i.firstChild;i=o.current();){if(1==i.nodeType&&"SPAN"==i.nodeName&&null!==i.getAttribute("data-mce-index")){if(i.getAttribute("data-mce-index")!==s)return;r=i.firstChild}o[e?"next":"prev"]()}o[e?"next":"prev"]()}}var a,r,o=t.selection,c=o.getRng(!0),s=-1;return e=e!==!1,i(),a&&r&&(t.focus(),e?(c.setStart(a,0),c.setEnd(r,r.length)):(c.setStart(r,0),c.setEnd(a,a.length)),o.scrollIntoView(a.parentNode),o.setRng(c)),s}function r(e){e.parentNode.removeChild(e)}var o,c=this,s=-1;c.init=function(e){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Ctrl+F",onclick:n,separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Ctrl+F",onclick:n}),e.addCommand("SearchReplace",n),e.shortcuts.add("Ctrl+F","",n)},c.markAllMatches=function(n){var i,a;return a=t.dom.create("span",{"class":"mce-match-marker","data-mce-bogus":1}),i=t.getBody(),c.unmarkAllMatches(i),e(n,i,a,!1,t.schema)},c.first=function(){return s=a(!0,!0),-1!==s},c.next=function(){return s=a(!0),-1!==s},c.prev=function(){return s=a(!1),-1!==s},c.replace=function(e,n,o){var c,d,l,u,m,f;if(-1===s&&(s=a(n)),f=a(n),l=t.getBody(),d=tinymce.toArray(l.getElementsByTagName("span")),d.length)for(c=0;c=d[1]?(o=c,a=d[1]-l):r&&s.push(c),!r&&c.length+l>d[0]&&(r=c,i=d[0]-l),l+=c.length),r&&o){if(c=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:d[2],matchIndex:u}),l-=o.length-a,r=null,o=null,s=[],d=t.shift(),u++,!d)break}else{if(!g[c.nodeName]&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function a(e){var t;if("function"!=typeof e){var n=e.nodeType?e:m.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(m.createTextNode(e)),r}}else t=e;return function r(e){var n,r,o,i=e.startNode,a=e.endNode,s=e.matchIndex;if(i===a){var l=i;o=l.parentNode,e.startNodeIndex>0&&(n=m.createTextNode(l.data.substring(0,e.startNodeIndex)),o.insertBefore(n,l));var c=t(e.match[0],s);return o.insertBefore(c,l),e.endNodeIndexf;++f){var h=e.innerNodes[f],g=t(h.data,s);h.parentNode.replaceChild(g,h),u.push(g)}var v=t(a.data.substring(0,e.endNodeIndex),s);return o=i.parentNode,o.insertBefore(n,i),o.insertBefore(d,i),o.removeChild(i),o=a.parentNode,o.insertBefore(v,a),o.insertBefore(r,a),o.removeChild(a),v}}function s(e){var t=[];return l(function(n,r){e(n,r)&&t.push(n)}),u=t,this}function l(e){for(var t=0,n=u.length;n>t&&e(u[t],t)!==!1;t++);return this}function c(e){return u.length&&(p=u.length,i(t,u,a(e))),this}var d,u=[],f,p=0,m,h,g,v;if(m=t.ownerDocument,h=n.getBlockElements(),g=n.getWhiteSpaceElements(),v=n.getShortEndedElements(),f=o(t),f&&e.global)for(;d=e.exec(f);)u.push(r(d));return{text:f,count:p,matches:u,each:l,filter:s,mark:c}}}),r(c,[l,d,u,f,p,m,h],function(e,t,n,r,o,i,a){t.add("spellchecker",function(t,s){function l(e){for(var t in e)return!1;return!0}function c(e,i){var a=[],s=g[i];n.each(s,function(e){a.push({text:e,onclick:function(){t.insertContent(e),u()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){p(e,i)}},{text:"Ignore all",onclick:function(){p(e,i,!0)}},{text:"Finish",onclick:m}]),y=new r({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){y.remove(),y=null}}),y.renderTo(document.body);var l=o.DOM.getPos(t.getContentAreaContainer()),c=t.dom.getPos(e);l.x+=c.x,l.y+=c.y,y.moveTo(l.x,l.y+e.offsetHeight)}function d(){function n(e){return t.setProgressState(!1),l(e)?(t.windowManager.alert("No misspellings found"),v=!1,void 0):(g=e,o.filter(function(t){return!!e[t[2][0]]}).mark(t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})),o=null,t.fire("SpellcheckStart"),void 0)}function r(e,n,r){i.sendRPC({url:new a(s).toAbsolute(b.spellchecker_rpc_url),method:e,params:{lang:b.spellchecker_language||"en",words:n},success:function(e){r(e)},error:function(e,n){e="JSON Parse error."==e?"Non JSON response:"+n.responseText:"Error: "+e,t.windowManager.alert(e),t.setProgressState(!1),o=null,v=!1}})}var o,c=[],d={};if(v)return m(),void 0;v=!0;var u=t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e]+',"g");o=new e(u,t.getBody(),t.schema).each(function(e){var t=e[2][0];if(!d[t]){if(/^\d+$/.test(t)||1==t.length)return;c.push(t),d[t]=!0}}),t.setProgressState(!0);var f=b.spellchecker_callback||r;f("spellcheck",c,n)}function u(){t.dom.select("span.mce-spellchecker-word").length||m()}function f(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function p(e,r,o){o?n.each(t.dom.select("span.mce-spellchecker-word"),function(e){var t=e.innerText||e.textContent;t==r&&f(e)}):f(e),u()}function m(){var e,n,r;for(v=!1,r=t.getBody(),n=r.getElementsByTagName("span"),e=n.length;e--;)r=n[e],r.getAttribute("data-mce-index")&&f(r);t.fire("SpellcheckEnd")}function h(e){var n,r,o,i=-1,a,s;for(e=""+e,n=t.getBody().getElementsByTagName("span"),r=0;r0){for(c=u+1;c=0;c--)if(a(d[c]))return d[c];return null}var u,d,a,c;if(9===n.keyCode&&(a=r(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==a.length&&(a[1]=a[0],a[0]=":prev"),d=n.shiftKey?":prev"==a[0]?t(-1):i.get(a[0]):":next"==a[1]?t(1):i.get(a[1]))){var f=tinymce.get(d.id||d.name);d.id&&f?f.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),d.focus()},10),n.preventDefault()}}var i=tinymce.DOM,o=tinymce.each,r=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null)}),e.on("keyup",n),tinymce.Env.gecko?e.on("keypress keydown",t):e.on("keydown",t)}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/table/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/table/plugin.min.js new file mode 100644 index 0000000..cb082cc --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/table/plugin.min.js @@ -0,0 +1 @@ +!function(e,t){"use strict";function n(e,t){for(var n,o=[],i=0;i "+t+" tr",r);o(i,function(i,r){r+=e,o(_.select("> td, > th",i),function(e,o){var i,l,a,s;if(k[r])for(;k[r][o];)o++;for(a=n(e,"rowspan"),s=n(e,"colspan"),l=r;r+a>l;l++)for(k[l]||(k[l]=[]),i=o;o+s>i;i++)k[l][i]={part:t,real:l==r&&i==o,elm:e,rowspan:a,colspan:s}})}),e+=i.length})}function a(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function s(e,t){var n;return n=k[t],n?n[e]:void 0}function c(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function d(e){return e&&(_.hasClass(e.elm,"mce-item-selected")||e==I)}function u(){var e=[];return o(r.rows,function(t){o(t.cells,function(n){return _.hasClass(n,"mce-item-selected")||n==I.elm?(e.push(t),!1):void 0})}),e}function m(){var e=_.createRng();e.setStartAfter(r),e.setEndAfter(r),D.setRng(e),_.remove(r)}function f(n){var r,l={};return i.settings.table_clone_elements!==!1&&(l=e.makeMap((i.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(n,function(e){var i;return 3==e.nodeType?(o(_.getParents(e.parentNode,null,n).reverse(),function(e){l[e.nodeName]&&(e=a(e,!1),r?i&&i.appendChild(e):r=i=e,i=e)}),i&&(i.innerHTML=t.ie?" ":'
    '),!1):void 0},"childNodes"),n=a(n,!1),c(n,"rowSpan",1),c(n,"colSpan",1),r?n.appendChild(r):t.ie||(n.innerHTML='
    '),n}function h(){var e=_.createRng(),t;return o(_.select("tr",r),function(e){0===e.cells.length&&_.remove(e)}),0===_.select("tr",r).length?(e.setStartBefore(r),e.setEndBefore(r),D.setRng(e),_.remove(r),void 0):(o(_.select("thead,tbody,tfoot",r),function(e){0===e.rows.length&&_.remove(e)}),l(),t=k[Math.min(k.length-1,B.y)],t&&(D.select(t[Math.min(t.length-1,B.x)].elm,!0),D.collapse(!0)),void 0)}function p(e,t,n,o){var i,r,l,a,s;for(i=k[t][e].elm.parentNode,l=1;n>=l;l++)if(i=_.getNext(i,"tr")){for(r=e;r>=0;r--)if(s=k[t+l][r].elm,s.parentNode==i){for(a=1;o>=a;a++)_.insertAfter(f(s),s);break}if(-1==r)for(a=1;o>=a;a++)i.insertBefore(f(i.cells[0]),i.cells[0])}}function g(){o(k,function(e,t){o(e,function(e,o){var i,r,l;if(d(e)&&(e=e.elm,i=n(e,"colspan"),r=n(e,"rowspan"),i>1||r>1)){for(c(e,"rowSpan",1),c(e,"colSpan",1),l=0;i-1>l;l++)_.insertAfter(f(e),e);p(o,t,r-1,i)}})})}function b(t,n,i){var r,a,u,m,f,p,b,v,y,w,x;if(t?(r=T(t),a=r.x,u=r.y,m=a+(n-1),f=u+(i-1)):(B=M=null,o(k,function(e,t){o(e,function(e,n){d(e)&&(B||(B={x:n,y:t}),M={x:n,y:t})})}),a=B.x,u=B.y,m=M.x,f=M.y),v=s(a,u),y=s(m,f),v&&y&&v.part==y.part){for(g(),l(),v=s(a,u).elm,c(v,"colSpan",m-a+1),c(v,"rowSpan",f-u+1),b=u;f>=b;b++)for(p=a;m>=p;p++)k[b]&&k[b][p]&&(t=k[b][p].elm,t!=v&&(w=e.grep(t.childNodes),o(w,function(e){v.appendChild(e)}),w.length&&(w=e.grep(v.childNodes),x=0,o(w,function(e){"BR"==e.nodeName&&_.getAttrib(e,"data-mce-bogus")&&x++0&&k[t-1][l]&&(h=k[t-1][l].elm,p=n(h,"rowSpan"),p>1)){c(h,"rowSpan",p+1);continue}}else if(p=n(i,"rowspan"),p>1){c(i,"rowSpan",p+1);continue}m=f(i),c(m,"colSpan",i.colSpan),u.appendChild(m),r=i}u.hasChildNodes()&&(e?s.parentNode.insertBefore(u,s):_.insertAfter(u,s))}function y(e){var t,i;o(k,function(n){return o(n,function(n,o){return d(n)&&(t=o,e)?!1:void 0}),e?!t:void 0}),o(k,function(o,r){var l,a,s;o[t]&&(l=o[t].elm,l!=i&&(s=n(l,"colspan"),a=n(l,"rowspan"),1==s?e?(l.parentNode.insertBefore(f(l),l),p(t,r,a-1,s)):(_.insertAfter(f(l),l),p(t,r,a-1,s)):c(l,"colSpan",l.colSpan+1),i=l))})}function w(){var t=[];o(k,function(i){o(i,function(i,r){d(i)&&-1===e.inArray(t,r)&&(o(k,function(e){var t=e[r].elm,o;o=n(t,"colSpan"),o>1?c(t,"colSpan",o-1):_.remove(t)}),t.push(r))})}),h()}function x(){function e(e){var t,i,r;t=_.getNext(e,"tr"),o(e.cells,function(e){var t=n(e,"rowSpan");t>1&&(c(e,"rowSpan",t-1),i=T(e),p(i.x,i.y,1,1))}),i=T(e.cells[0]),o(k[i.y],function(e){var t;e=e.elm,e!=r&&(t=n(e,"rowSpan"),1>=t?_.remove(e):c(e,"rowSpan",t-1),r=e)})}var t;t=u(),o(t.reverse(),function(t){e(t)}),h()}function C(){var e=u();return _.remove(e),h(),e}function S(){var e=u();return o(e,function(t,n){e[n]=a(t,!0)}),e}function R(e,t){var n=u(),i=n[t?0:n.length-1],r=i.cells.length;e&&(o(k,function(e){var t;return r=0,o(e,function(e){e.real&&(r+=e.colspan),e.elm.parentNode==i&&(t=1)}),t?!1:void 0}),t||e.reverse(),o(e,function(e){var n,o=e.cells.length,l;for(n=0;o>n;n++)l=e.cells[n],c(l,"colSpan",1),c(l,"rowSpan",1);for(n=o;r>n;n++)e.appendChild(f(e.cells[o-1]));for(n=r;o>n;n++)_.remove(e.cells[n]);t?i.parentNode.insertBefore(e,i):_.insertAfter(e,i)}),_.removeClass(_.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function T(e){var t;return o(k,function(n,i){return o(n,function(n,o){return n.elm==e?(t={x:o,y:i},!1):void 0}),!t}),t}function N(e){B=T(e)}function P(){var e,t;return e=t=0,o(k,function(n,i){o(n,function(n,o){var r,l;d(n)&&(n=k[i][o],o>e&&(e=o),i>t&&(t=i),n.real&&(r=n.colspan-1,l=n.rowspan-1,r&&o+r>e&&(e=o+r),l&&i+l>t&&(t=i+l)))})}),{x:e,y:t}}function A(e){var t,n,o,i,r,l,a,s,c,d;if(M=T(e),B&&M){for(t=Math.min(B.x,M.x),n=Math.min(B.y,M.y),o=Math.max(B.x,M.x),i=Math.max(B.y,M.y),r=o,l=i,d=n;l>=d;d++)e=k[d][t],e.real||t-(e.colspan-1)=c;c++)e=k[n][c],e.real||n-(e.rowspan-1)=d;d++)for(c=t;o>=c;c++)e=k[d][c],e.real&&(a=e.colspan-1,s=e.rowspan-1,a&&c+a>r&&(r=c+a),s&&d+s>l&&(l=d+s));for(_.removeClass(_.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=n;l>=d;d++)for(c=t;r>=c;c++)k[d][c]&&_.addClass(k[d][c].elm,"mce-item-selected")}}var k,B,M,I,D=i.selection,_=D.dom;r=r||_.getParent(D.getStart(),"table"),l(),I=_.getParent(D.getStart(),"th,td"),I&&(B=T(I),M=P(),I=s(B.x,B.y)),e.extend(this,{deleteTable:m,split:g,merge:b,insertRow:v,insertCol:y,deleteCols:w,deleteRows:x,cutRows:C,copyRows:S,pasteRows:R,getPos:T,setStartCell:N,setEndCell:A})}}),o(u,[m,d,c],function(e,t,n){function o(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=n.each;return function(n){function r(){function t(t){function r(e,o){var i=e?"previousSibling":"nextSibling",r=n.dom.getParent(o,"tr"),a=r[i];if(a)return g(n,o,a,e),t.preventDefault(),!0;var d=n.dom.getParent(r,"table"),u=r.parentNode,m=u.nodeName.toLowerCase();if("tbody"===m||m===(e?"tfoot":"thead")){var f=l(e,d,u,"tbody");if(null!==f)return s(e,f,o)}return c(e,r,i,d)}function l(e,t,o,i){var r=n.dom.select(">"+i,t),l=r.indexOf(o);if(e&&0===l||!e&&l===r.length-1)return a(e,t);if(-1===l){var s="thead"===o.tagName.toLowerCase()?0:r.length-1;return r[s]}return r[l+(e?-1:1)]}function a(e,t){var o=e?"thead":"tfoot",i=n.dom.select(">"+o,t);return 0!==i.length?i[0]:null}function s(e,o,i){var r=d(o,e);return r&&g(n,i,r,e),t.preventDefault(),!0}function c(e,o,i,l){var a=l[i];if(a)return u(a),!0;var s=n.dom.getParent(l,"td,th");if(s)return r(e,s,t);var c=d(o,!e);return u(c),t.preventDefault(),!1}function d(e,t){var o=e&&e[t?"lastChild":"firstChild"];return o&&"BR"===o.nodeName?n.dom.getParent(o,"td,th"):o}function u(e){n.selection.setCursorLocation(e,0)}function m(){return y==e.UP||y==e.DOWN}function f(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function h(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=o(n,"colspan");return t}function p(e,t){var n=0,r=0;return i(e.children,function(e,i){return n+=o(e,"colspan"),r=i,n>t?!1:void 0}),r}function g(e,t,o,i){var r=h(n.dom.getParent(t,"td,th")),l=p(o,r),a=o.childNodes[l],s=d(a,i);u(s||a)}function b(e){var t=n.selection.getNode(),o=n.dom.getParent(t,"td,th"),i=n.dom.getParent(e,"td,th");return o&&o!==i&&v(o,i)}function v(e,t){return n.dom.getParent(e,"TABLE")===n.dom.getParent(t,"TABLE")}var y=t.keyCode;if(m()&&f(n)){var w=n.selection.getNode();setTimeout(function(){b(w)&&r(!t.shiftKey&&y===e.UP,w,t)},0)}}n.on("KeyDown",function(e){t(e)})}function l(){function e(e,t){var n=t.ownerDocument,o=n.createRange(),i;return o.setStartBefore(t),o.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(o.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}n.on("KeyDown",function(t){var o,i,r=n.dom;(37==t.keyCode||38==t.keyCode)&&(o=n.selection.getRng(),i=r.getParent(o.startContainer,"table"),i&&n.getBody().firstChild==i&&e(o,i)&&(o=r.createRng(),o.setStartBefore(i),o.setEndBefore(i),n.selection.setRng(o),t.preventDefault()))})}function a(){n.on("KeyDown SetContent VisualAid",function(){var e;for(e=n.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&!e.getAttribute("data-mce-bogus"))break;e&&"TABLE"==e.nodeName&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,null,t.ie?" ":'
    '):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function s(){function e(e,t,n,o){var i=3,r=e.dom.getParent(t.startContainer,"TABLE"),l,a,s;return r&&(l=r.parentNode),a=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&o&&("TR"==n.nodeName||n==l),s=("TD"==n.nodeName||"TH"==n.nodeName)&&!o,a||s}function t(){var t=n.selection.getRng(),o=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,o,i)){i||(i=o);for(var r=i.lastChild;r.lastChild;)r=r.lastChild;t.setEnd(r,r.nodeValue.length),n.selection.setRng(t)}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}t.webkit&&(r(),s()),t.gecko&&(l(),a())}}),o(f,[s,h,c],function(e,t,n){return function(o){function i(){o.getBody().style.webkitUserSelect="",d&&(o.dom.removeClass(o.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}function r(t){var n,i,r=t.target;if(s&&(a||r!=s)&&("TD"==r.nodeName||"TH"==r.nodeName)){i=l.getParent(r,"table"),i==c&&(a||(a=new e(o,i),a.setStartCell(s),o.getBody().style.webkitUserSelect="none"),a.setEndCell(r),d=!0),n=o.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}var l=o.dom,a,s,c,d=!0;return o.on("MouseDown",function(e){2!=e.button&&(i(),s=l.getParent(e.target,"td,th"),c=l.getParent(s,"table"))}),l.bind(o.getDoc(),"mouseover",r),o.on("remove",function(){l.unbind(o.getDoc(),"mouseover",r)}),o.on("MouseUp",function(){function e(e,o){var r=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return o?i.setStart(e,0):i.setEnd(e,e.nodeValue.length),void 0;if("BR"==e.nodeName)return o?i.setStartBefore(e):i.setEndBefore(e),void 0}while(e=o?r.next():r.prev())}var i,r=o.selection,d,u,m,f,h;if(s){if(a&&(o.getBody().style.webkitUserSelect=""),d=l.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){i=l.createRng(),m=d[0],h=d[d.length-1],i.setStartBefore(m),i.setEndAfter(m),e(m,1),u=new t(m,l.getParent(d[0],"table"));do if("TD"==m.nodeName||"TH"==m.nodeName){if(!l.hasClass(m,"mce-item-selected"))break;f=m}while(m=u.next());e(f),r.setRng(i)}o.nodeChanged(),s=a=c=null}}),o.on("KeyUp",function(){i()}),{clear:i}}}),o(p,[s,u,f,c,h,d,g],function(e,t,n,o,i,r,l){function a(o){function i(e){return e?e.replace(/px$/,""):""}function l(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function a(e){s("left center right".split(" "),function(t){o.formatter.remove("align"+t,{},e)})}function c(){var e=o.dom,t,n,c;t=o.dom.getParent(o.selection.getStart(),"table"),c=!1,n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),cellspacing:e.getAttrib(t,"cellspacing"),cellpadding:e.getAttrib(t,"cellpadding"),border:e.getAttrib(t,"border"),caption:!!e.select("caption",t)[0]},s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:n,defaults:{type:"textbox",maxWidth:50},items:[c?{label:"Cols",name:"cols",disabled:!0}:null,c?{label:"Rows",name:"rows",disabled:!0}:null,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"},{label:"Alignment",minWidth:90,name:"align",type:"listbox",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var n=this.toJSON(),i;o.undoManager.transact(function(){o.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),o.dom.setStyles(t,{width:l(n.width),height:l(n.height)}),i=e.select("caption",t)[0],i&&!n.caption&&e.remove(i),!i&&n.caption&&(i=e.create("caption"),r.ie||(i.innerHTML='
    '),t.insertBefore(i,t.firstChild)),a(t),n.align&&o.formatter.apply("align"+n.align,{},t),o.focus(),o.addVisual()})}})}function d(e,t){o.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",size:10},{label:"Rows",name:"rows",type:"textbox",size:10}],onsubmit:function(){var n=this.toJSON();o.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function u(){var e=o.dom,t,n,r=[];r=o.dom.select("td.mce-item-selected,th.mce-item-selected"),t=o.dom.getParent(o.selection.getStart(),"td,th"),!r.length&&t&&r.push(t),t=t||r[0],n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),scope:e.getAttrib(t,"scope")},n.type=t.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Cell properties",items:{type:"form",data:n,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,menu:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,menu:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var t=this.toJSON();o.undoManager.transact(function(){s(r,function(n){o.dom.setAttrib(n,"scope",t.scope),o.dom.setStyles(n,{width:l(t.width),height:l(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),a(n),t.align&&o.formatter.apply("align"+t.align,{},n)}),o.focus()})}})}function m(){var e=o.dom,t,n,r,c,d=[];t=o.dom.getParent(o.selection.getStart(),"table"),n=o.dom.getParent(o.selection.getStart(),"td,th"),s(t.rows,function(t){s(t.cells,function(o){return e.hasClass(o,"mce-item-selected")||o==n?(d.push(t),!1):void 0})}),r=d[0],c={height:i(e.getStyle(r,"height")||e.getAttrib(r,"height")),scope:e.getAttrib(r,"scope")},c.type=r.parentNode.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(r,"align"+e)&&(c.align=e)}),o.windowManager.open({title:"Row properties",items:{type:"form",data:c,columns:2,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,menu:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,menu:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"}]},onsubmit:function(){var t=this.toJSON(),n,i,r;o.undoManager.transact(function(){var c=t.type;s(d,function(s){o.dom.setAttrib(s,"scope",t.scope),o.dom.setStyles(s,{height:l(t.height)}),c!=s.parentNode.nodeName.toLowerCase()&&(n=e.getParent(s,"table"),i=s.parentNode,r=e.select(c,n)[0],r||(r=e.create(c),n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.appendChild(s),i.hasChildNodes()||e.remove(i)),a(s),t.align&&o.formatter.apply("align"+t.align,{},s)}),o.focus()})}})}function f(e){return function(){o.execCommand(e)}}function h(e,t){var n,i,l;for(l="",n=0;t>n;n++){for(l+="",i=0;e>i;i++)l+="";l+=""}l+="
    "+(r.ie?" ":"
    ")+"
    ",o.insertContent(l)}function p(e,t){function n(){e.disabled(!o.dom.getParent(o.selection.getStart(),t)),o.selection.selectorChanged(t,function(t){e.disabled(!t)})}o.initialized?n():o.on("init",n)}function g(){p(this,"table")}function b(){p(this,"td,th")}function v(){var e="";e='';for(var t=0;10>t;t++){e+="";for(var n=0;10>n;n++)e+='';e+=""}return e+="",e+='
    0 x 0
    '}var y,w,x=this;o.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onhide:function(){o.dom.removeClass(this.menu.items()[0].getEl().getElementsByTagName("a"),"mce-active")},menu:[{type:"container",html:v(),onmousemove:function(e){var t=e.target;if("A"==t.nodeName){var n=o.dom.getParent(t,"table"),i=t.getAttribute("data-mce-index");if(i!=this.lastPos){i=i.split(","),i[0]=parseInt(i[0],10),i[1]=parseInt(i[1],10);for(var r=0;10>r;r++)for(var l=0;10>l;l++)o.dom.toggleClass(n.rows[r].childNodes[l].firstChild,"mce-active",l<=i[0]&&r<=i[1]);n.nextSibling.innerHTML=i[0]+1+" x "+(i[1]+1),this.lastPos=i}}},onclick:function(e){"A"==e.target.nodeName&&this.lastPos&&(e.preventDefault(),h(this.lastPos[0]+1,this.lastPos[1]+1),this.parent().cancel())}}]}),o.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:g,onclick:c}),o.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:g,cmd:"mceTableDelete"}),o.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:b},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:b},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:b}]}),o.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:b},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:b},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:b},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:b},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:b},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:b},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:b},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:b}]}),o.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:b},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:b},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:b}]});var C=[];s("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"==e?C.push({text:"-"}):C.push(o.menuItems[e])}),o.addButton("table",{type:"menubutton",title:"Table",menu:C}),r.isIE||o.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(o.selection.select(e),o.nodeChanged())}),x.quirks=new t(o),o.on("Init",function(){y=o.windowManager,x.cellSelection=new n(o)}),s({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t,n,i;i=o.dom.getParent(o.selection.getStart(),"th,td"),i&&(t=i.rowSpan,n=i.colSpan),o.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():d(e,i)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){w=e.cutRows()},mceTableCopyRow:function(e){w=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(w,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(w)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){o.addCommand(n,function(){var n=new e(o);n&&(t(n),o.execCommand("mceRepaint"),x.cellSelection.clear())})}),s({mceInsertTable:function(){c()},mceTableRowProps:m,mceTableCellProps:u},function(e,t){o.addCommand(t,function(t,n){e(n)})})}var s=o.each;l.add("table",a)}),l([s,u,f,p])}(this); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/template/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/template/plugin.min.js new file mode 100644 index 0000000..47acf74 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/template/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("template",function(e){function t(){function t(t){function r(t){if(-1==t.indexOf("")){var n="";tinymce.each(e.contentCSS,function(t){n+=''}),t=""+n+""+""+t+""+""}t=l(t,"template_preview_replace_values");var r=a.find("iframe")[0].getEl().contentWindow.document;r.open(),r.write(t),r.close()}var c=t.control.value();c.url?tinymce.util.XHR.send({url:c.url,success:function(e){n=e,r(n)}}):(n=c.content,r(n)),a.find("#description")[0].text(t.control.value().description)}var a,n,c=[];return e.settings.templates?(tinymce.each(e.settings.templates,function(e){c.push({selected:!c.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),a=e.windowManager.open({title:"Insert template",body:[{type:"container",label:"Templates",items:{type:"listbox",name:"template",values:c,onselect:t}},{type:"label",name:"description",label:"Description",text:" "},{type:"iframe",minWidth:600,minHeight:400,border:1}],onsubmit:function(){r(!1,n)}}),a.find("listbox")[0].fire("select"),void 0):(e.windowManager.alert("No templates defined"),void 0)}function a(t,a){function n(e,t){if(e=""+e,e.length0&&(s=m.create("div",null),s.appendChild(i[0].cloneNode(!0))),c(m.select("*",s),function(t){o(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=a(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),o(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=a(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),o(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=p)}),n(s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()}var c=tinymce.each;e.addCommand("mceInsertTemplate",r),e.addButton("template",{title:"Insert template",onclick:t}),e.addMenuItem("template",{text:"Insert template",onclick:t,context:"insert"}),e.on("PreProcess",function(t){var l=e.dom;c(l.select("div",t.node),function(t){l.hasClass(t,"mceTmpl")&&(c(l.select("*",t),function(t){l.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=a(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),n(t))})})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/textcolor/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/textcolor/plugin.min.js new file mode 100644 index 0000000..9f2524f --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/textcolor/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("textcolor",function(e){function t(){var t,n,i=[];for(n=e.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],t=0;t',o=n.length-1,r=e.settings.textcolor_rows||5,l=e.settings.textcolor_cols||8,s=0;r>s;s++){for(a+="",c=0;l>c;c++)u=s*l+c,u>o?a+="":(i=n[u],a+='
    '+"
    "+"");a+=""}return a+=""}function i(t){var n,i=this.parent();(n=t.target.getAttribute("data-mce-color"))&&(i.hidePanel(),n="#"+n,i.color(n),e.execCommand(i.settings.selectcmd,!1,n))}function a(){var t=this;t._color&&e.execCommand(t.settings.selectcmd,!1,t._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",popoverAlign:"bc-tl",selectcmd:"ForeColor",panel:{html:n,onclick:i},onclick:a}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",popoverAlign:"bc-tl",selectcmd:"HiliteColor",panel:{html:n,onclick:i},onclick:a})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/css/visualblocks.css b/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/css/visualblocks.css new file mode 100644 index 0000000..fe6fa93 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/css/visualblocks.css @@ -0,0 +1,128 @@ +.mce-visualblocks p { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); +} + +.mce-visualblocks h1 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); +} + +.mce-visualblocks h2 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); +} + +.mce-visualblocks h3 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); +} + +.mce-visualblocks h4 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); +} + +.mce-visualblocks h5 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); +} + +.mce-visualblocks h6 { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); +} + +.mce-visualblocks div { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); +} + +.mce-visualblocks section { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); +} + +.mce-visualblocks article { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); +} + +.mce-visualblocks blockquote { + padding-top: 10px; + border: 1px dashed #BBB; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); +} + +.mce-visualblocks address { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); +} + +.mce-visualblocks pre { + padding-top: 10px; + border: 1px dashed #BBB; + margin-left: 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); +} + +.mce-visualblocks figure { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); +} + +.mce-visualblocks hgroup { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); +} + +.mce-visualblocks aside { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); +} + +.mce-visualblocks figcaption { + border: 1px dashed #BBB; +} + +.mce-visualblocks ul { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==) +} + +.mce-visualblocks ol { + padding-top: 10px; + border: 1px dashed #BBB; + margin: 0 0 1em 3px; + background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); +} diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/plugin.min.js new file mode 100644 index 0000000..cafa418 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualblocks/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("visualblocks",function(e,t){function n(){var t=this;t.active(r),e.on("VisualBlocks",function(){t.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))})}var i,a,r;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var n,o=e.dom;i||(i=o.uniqueId(),n=o.create("link",{id:i,rel:"stylesheet",href:t+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(n)),e.on("PreviewFormats AfterPreviewFormats",function(t){r&&o.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==t.type)}),o.toggleClass(e.getBody(),"mce-visualblocks"),r=e.dom.hasClass(e.getBody(),"mce-visualblocks"),a&&a.active(o.hasClass(e.getBody(),"mce-visualblocks")),e.fire("VisualBlocks")}),e.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n,selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")}))}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualchars/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualchars/plugin.min.js new file mode 100644 index 0000000..4474238 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/visualchars/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("visualchars",function(e){function t(t){var n,a,r,o,l,s,c=e.getBody(),d=e.selection;if(i=!i,e.fire("VisualChars",{state:i}),t&&(s=d.getBookmark()),i)for(a=[],tinymce.walk(c,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf(" ")&&a.push(e)},"childNodes"),r=0;r$1
    '),l=e.dom.create("div",null,o);n=l.lastChild;)e.dom.insertAfter(n,a[r]);e.dom.remove(a[r])}else for(a=e.dom.select("span.mce-nbsp",c),r=a.length-1;r>=0;r--)e.dom.remove(a[r],1);d.moveToBookmark(s)}function n(){var t=this;e.on("VisualChars",function(e){t.active(e.state)})}var i;e.addCommand("mceVisualChars",t),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n,selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){i&&"raw"!=e.format&&!e.draft&&(i=!0,t(!1))})}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/plugins/wordcount/plugin.min.js b/system/sai/modules/saimod_sys_locale/tinymce/plugins/wordcount/plugin.min.js new file mode 100644 index 0000000..8c41980 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/plugins/wordcount/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",a.getCount()])}var n,i,a=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-]+/g),i=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&window.setTimeout(function(){n.insert({type:"label",name:"wordcount",text:["Words: {0}",a.getCount()],classes:"wordcount"},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()})},0)}),a.getCount=function(){var t=e.getContent({format:"raw"}),a=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),t=t.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," "),t=t.replace(i,"");var o=t.match(n);o&&(a=o.length)}return a}}); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.inline.min.css b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.inline.min.css new file mode 100644 index 0000000..771b83e --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.inline.min.css @@ -0,0 +1 @@ +.mce-object{border:1px dotted #3a3a3a;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3a3a3a;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:green;color:#fff}.mce-spellchecker-word{background:url(img/wline.gif) repeat-x bottom left;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.min.css b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.min.css new file mode 100644 index 0000000..b9bbab1 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/content.min.css @@ -0,0 +1 @@ +body{background-color:#fff;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#f0f0ee;scrollbar-arrow-color:#676662;scrollbar-base-color:#f0f0ee;scrollbar-darkshadow-color:#ddd;scrollbar-face-color:#e0e0dd;scrollbar-highlight-color:#f0f0ee;scrollbar-shadow-color:#f0f0ee;scrollbar-track-color:#f5f5f5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3a3a3a;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3a3a3a;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:green;color:#fff}.mce-spellchecker-word{background:url(img/wline.gif) repeat-x bottom left;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.eot b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.eot new file mode 100644 index 0000000000000000000000000000000000000000..43a30f992596498938e08ba09fd157d744cfe413 GIT binary patch literal 8344 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 literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.svg b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.svg new file mode 100644 index 0000000..d338114 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.svg @@ -0,0 +1,175 @@ + + + + +This is a custom SVG font generated by IcoMoon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.ttf b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.ttf new file mode 100644 index 0000000000000000000000000000000000000000..841c79c182342d92dc995a5cc1349a9451edede6 GIT binary patch literal 8160 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 literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.woff b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon-small.woff new file mode 100644 index 0000000000000000000000000000000000000000..ad14a2406e7887c3ed22440d42d726f0ff176119 GIT binary patch literal 8336 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 literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.eot b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.eot new file mode 100644 index 0000000000000000000000000000000000000000..eed4f8149a44a99566fe9d3778dd21d0950a7ff8 GIT binary patch literal 8268 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 L6eV5%o%(+O+no0t literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.svg b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.svg new file mode 100644 index 0000000..727f61a --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.svg @@ -0,0 +1,153 @@ + + + + +This is a custom SVG font generated by IcoMoon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.ttf b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.ttf new file mode 100644 index 0000000000000000000000000000000000000000..dea6e458f9db36c0cc4ad7dcbe579aed13213126 GIT binary patch literal 8104 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 AmjD0& literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.woff b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/fonts/icomoon.woff new file mode 100644 index 0000000000000000000000000000000000000000..f17657986c6ab0ee65c0405db24b01ee22450025 GIT binary patch literal 8400 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 C+YCGa literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/loader.gif b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..c69e937232b24ea30f01c68bbd2ebc798dcecfcb GIT binary patch literal 2608 zcmdVcdr(tX9tZGC9yiG~=H_*Q-0%n(kWqP*D#hw{AQu8;1%gl-Hrf&{2?48KX;hHy z3Ze*zEz4t3XdUFyLbNPUYlA`|B}P=N1fqtL1*}S;87#|-W9v<#G;ul(e%d3)N(^9c$d2Dz{7}?ErjNd;{EMKkCsk21~b9Gvg zDo<7L=3Z5HNbVlZUcm1eg#o#CZCJU`3IYHwM->zCd?uYrF3vKFeM}v?f+%s?E>ly|3W25ry9#NNbTx-}0ON58dTrs^ix{_1O0Wh~SVSBlH)Ajn zPn^Gbjz}PCtN@#keR&hK&Dhl-b$kZ8^S)x#dh0{7X=X%CCJk7P1PSO>T&S8I4{#Lg zb5#)o=;!ZP*1nM{cI4@(x7o27*SA()NHmrn67aN@Pmi~(i_SnrjYnwh36aG%!@i0d zqbvfa44f|?OG4ntP|nbjhEl1)Yp6ZN@yjy zy4==QmLy%t;ps3R?~f2KfTTI|2?q8dFd6^z5GF+Xa&Y)sjG)hxit80pPcOP zJ z*LW{SyGHD%hUotV+W%I}fBLAIx!8|7#}$;clKQ+{&FjDqGQ2ZNx(lYM3*%~}ILnao zM`aui55~ZFJlu^!5rdA9Q_7H68H_;##u{x(Yn-vSfIRCb^Nqsg zGRS!Egm>h+o<}LeV4&CLReo9FrDjDvs}8?JwC)#Qs|ie=r?~xUh)&*d`Fx>FG}%X# zNdtDHBKhLPC0wpooFDAQKL%*6T|ULH$=wX!NhcasgD3d;-d$I6yRK3yN+E~C1335_iLOt+*9uvSZ`>*KA}vm}08wRq=>5l|t*Na&jR z-C1&C`nkEk#sB|@yyt-#fXngP04My zm7u$Q%EJbHp`>~`5W&L{W!6`y&}LMS;jfUpgO~7TLVMRZ9IC)IZp0A${`yp0{&wco z#1nx@XMkhqeK%7?RE7JdLr1^nwFfaJ0Q&Lv?WNJ%9}VSJsNY2+UYs2%EU0J~ayFXv zi*?7KCXQHkD)O6!0Q%4N+HTODHxJ{kQSuQX$l-rSwkwh(zMkdfzxyGwl@yHC)C4p< z&n2%8#M?)Q@mgHL1ot8`SFdSEj9ye|jHy+U8#@HoUExG=@AVkRAe_qYm4EpzK6L*& zh`)26?V#f4#_h^P9G^%>h2-H3)$QP zQovu6J9qDvsxqweDdNNa!Lb?L4_UF{tLX_nN7r0U_vF14YKcGR-*Gl} zx3oG)bzf|65dBxD-;2ZCp??K;+TuQ9onnK?==5hzbkb^r_g>z4#D8mcv8(+XdoszA zCx-qhdgxMNMotj}SiL_6V(tLcsK7(M(r(%u<}QrVfOvyK6_;~NOTlPGfX@M7S5YQF z&*$(ylJMHJt^_aQeu{C6NaTE$G3HNN@_SnN8YcaKn%`)F@~L1x+ah7-gEJPpc6w%3 zyX}r+Qk$4RHZzfH){e~F*qJ{d*L8a6n4;U?+{de0-t)mal#TVxe)3F}^UBh+zd T)6_**#cgp_+?JL9(ew3BlNF>u literal 0 HcmV?d00001 diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/object.gif b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/img/object.gif new file mode 100644 index 0000000000000000000000000000000000000000..cccd7f023fb80908cb33bb7d9604236cd21b7ae7 GIT binary patch literal 152 zcmV;J0B8S4Nk%w1VG#fg0J9GO<>lo+KR<78Z?v?uS65g4{r%Y3*xlXT%F4>`@9+2b z_ww@cot>Tk|Nk>HGXMYpA^8LW000jFEC2ui01*HU000C<(8)=wd#<&tyXIMjHBV`d zBSi|xsj3(;nD0kQ0aJq8eLH~x02P|t2!_J&Wqb%0io?#xD.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:whiteSmoke;border-top:1px solid #DDD;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:0;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:3px 5px;font-size:12px;line-height:15px}.mce-btn-small i{margin-top:0}.mce-btn .mce-caret{margin-top:8px;*margin-top:6px;margin-left:0}.mce-btn-small .mce-caret{margin-top:6px;*margin-top:4px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #c5c5c5;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid #59a5e1;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-17px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#c5c5c5;border-right-color:#c5c5c5}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox *:focus{border-color:#59a5e1;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.mce-fieldset{border:0 solid #9e9e9e;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.mce-menubtn span{margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px;line-height:15px;*line-height:16px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:white}.mce-menu-item.mce-disabled:hover{background:#CCC}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret{border-left-color:#FFF}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa;background-color:transparent;outline:0}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#FFF;border:1px solid #CCC;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#c5c5c5;border-right-color:#c5c5c5}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-textbox{background:#FFF;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);display:inline-block;-webkit-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'icomoon';src:url('fonts/icomoon.eot');src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon.svg#icomoon') format('svg'),url('fonts/icomoon.woff') format('woff'),url('fonts/icomoon.ttf') format('truetype');font-weight:normal;font-style:normal}@font-face{font-family:'icomoon-small';src:url('fonts/icomoon-small.eot');src:url('fonts/icomoon-small.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon-small.svg#icomoon') format('svg'),url('fonts/icomoon-small.woff') format('woff'),url('fonts/icomoon-small.ttf') format('truetype');font-weight:normal;font-style:normal}.mce-ico{font-family:'icomoon';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'icomoon-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = this.currentStyle['-ie7-icon'].substr(1,1)+' ')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-inserttime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/skin.min.css b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/skin.min.css new file mode 100644 index 0000000..86fd631 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/skins/lightgray/skin.min.css @@ -0,0 +1 @@ +.mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#000;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-container ::-webkit-scrollbar{width:8px;height:8px;-webkit-border-radius:4px}.mce-container ::-webkit-scrollbar-track,.mce-container ::-webkit-scrollbar-track-piece{background-color:transparent}.mce-container ::-webkit-scrollbar-thumb{background-color:rgba(53,57,71,0.3);width:6px;height:6px;-webkit-border-radius:4px}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible!important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #808080;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:hover{border-color:black}.mce-grid td div:focus{border-color:#59a5e1;outline:1px solid rgba(82,168,236,0.8);border-color:rgba(82,168,236,0.8)}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#c5c5c5}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#e8e8e8;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#c4daff;background:#deeafa}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:#ccc 5px 5px 5px;-moz-box-shadow:#ccc 5px 5px 5px;box-shadow:#ccc 5px 5px 5px}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{top:0;left:0;background:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:whiteSmoke;border-top:1px solid #DDD;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:0;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:3px 5px;font-size:12px;line-height:15px}.mce-btn-small i{margin-top:0}.mce-btn .mce-caret{margin-top:8px;*margin-top:6px;margin-left:0}.mce-btn-small .mce-caret{margin-top:6px;*margin-top:4px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #c5c5c5;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid #59a5e1;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-17px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#c5c5c5;border-right-color:#c5c5c5}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox *:focus{border-color:#59a5e1;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.mce-fieldset{border:0 solid #9e9e9e;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.mce-menubtn span{margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px;line-height:15px;*line-height:16px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:white}.mce-menu-item.mce-disabled:hover{background:#CCC}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret{border-left-color:#FFF}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa;background-color:transparent;outline:0}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#FFF;border:1px solid #CCC;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#c5c5c5;border-right-color:#c5c5c5}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-textbox{background:#FFF;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);display:inline-block;-webkit-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/icomoon.eot');src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon.svg#icomoon') format('svg'),url('fonts/icomoon.woff') format('woff'),url('fonts/icomoon.ttf') format('truetype');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/icomoon-small.eot');src:url('fonts/icomoon-small.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon-small.svg#icomoon') format('svg'),url('fonts/icomoon-small.woff') format('woff'),url('fonts/icomoon-small.ttf') format('truetype');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-inserttime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tinymce/themes/modern/theme.min.js b/system/sai/modules/saimod_sys_locale/tinymce/themes/modern/theme.min.js new file mode 100644 index 0000000..da7ab25 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tinymce/themes/modern/theme.min.js @@ -0,0 +1 @@ +tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var i,o=[];if(t)return d(t.split(/[ ,]/),function(t){function n(){var n=e.selection;"bullist"==r&&n.selectorChanged("ul > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"UL"==i)}),"numlist"==r&&n.selectorChanged("ol > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"OL"==i)}),t.settings.stateSelector&&n.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&n.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var r;"|"==t?i=null:c.has(t)?(t={type:t},u.toolbar_items_size&&(t.size=u.toolbar_items_size),o.push(t),i=null):(i||(i={type:"buttongroup",items:[]},o.push(i)),e.buttons[t]&&(r=t,t=e.buttons[r],"function"==typeof t&&(t=t()),t.type=t.type||"button",u.toolbar_items_size&&(t.size=u.toolbar_items_size),t=c.create(t),i.items.push(t),e.initialized?n():e.on("init",n)))}),n.push({type:"toolbar",layout:"flow",items:o}),!0}for(var n=[],i=1;10>i&&t(u["toolbar"+i]);i++);return n.length||t(u.toolbar||f),n}function n(){function t(t){var n;return"|"==t?{text:"|"}:n=e.menuItems[t]}function n(n){var i,o,r,a,s;if(s=tinymce.makeMap((u.removed_menuitems||"").split(/[ ,]/)),u.menu?(o=u.menu[n],a=!0):o=h[n],o){i={text:o.title},r=[],d((o.items||"").split(/[ ,]/),function(e){var n=t(e);n&&!s[e]&&r.push(t(e))}),a||d(e.menuItems,function(e){e.context==n&&("before"==e.separator&&r.push({text:"|"}),e.prependToContext?r.unshift(e):r.push(e),"after"==e.separator&&r.push({text:"|"}))});for(var l=0;l1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},d,u="\ufeff";for(e=e||{},d=("\\\" \\' \\; \\: ; : "+u).split(" "),l=0;l0&&("font-weight"===g&&"700"===v?v="bold":("color"===g||"background-color"===g)&&(v=v.toLowerCase()),v=v.replace(r,n),v=v.replace(i,p),m[g]=y?f(v,!0):v),o.lastIndex=h.index+h[0].length;s("border",""),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border}return m},serialize:function(e,n){function r(n){var r,o,a,l;if(r=t.styles[n])for(o=0,a=r.length;a>o;o++)n=r[o],l=e[n],l!==s&&l.length>0&&(i+=(i.length>0?" ":"")+n+": "+l+";")}var i="",o,a;if(n&&t&&t.styles)r("*"),r(n);else for(o in e)a=e[o],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(d,[],function(){function e(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function t(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function n(e,t){function n(){return!1}function r(){return!0}var i,o=t||{},l;for(i in e)s[i]||(o[i]=e[i]);if(o.target||(o.target=o.srcElement||document),e&&a.test(e.type)&&e.pageX===l&&e.clientX!==l){var c=o.target.ownerDocument||document,d=c.documentElement,u=c.body;o.pageX=e.clientX+(d&&d.scrollLeft||u&&u.scrollLeft||0)-(d&&d.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(d&&d.scrollTop||u&&u.scrollTop||0)-(d&&d.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=r,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=r,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=r,o.stopPropagation()},o.isDefaultPrevented||(o.isDefaultPrevented=n,o.isPropagationStopped=n,o.isImmediatePropagationStopped=n),o}function r(n,r,i){function o(){i.domLoaded||(i.domLoaded=!0,r(c))}function a(){"complete"===l.readyState&&(t(l,"readystatechange",a),o())}function s(){try{l.documentElement.doScroll("left")}catch(e){return setTimeout(s,0),void 0}o()}var l=n.document,c={type:"ready"};return i.domLoaded?(r(c),void 0):(l.addEventListener?e(n,"DOMContentLoaded",o):(e(l,"readystatechange",a),l.documentElement.doScroll&&n===n.top&&s()),e(n,"load",o),void 0)}function i(){function i(e,t){var n,r,i,o;if(n=s[t][e.type])for(r=0,i=n.length;i>r;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,d,u,f;c=o+(+new Date).toString(32),u="onmouseenter"in document.documentElement,d="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,m){function h(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),m=m||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=h,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(m,n({type:b})):(u||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),d||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:m}):(s[g][b]=v=[{func:p,scope:m}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,d,u,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(u=n[l],o=f[u]){if(r)for(d=o.length;d--;)if(o[d].func===r){var p=o.nativeHandler;o=o.slice(0,d).concat(o.slice(d+1)),o.nativeHandler=p,f[u]=o,o.splice(d,1)}r&&0!==o.length||(delete f[u],t(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in f)o=f[u],t(e,o.fakeName||u,o.nativeHandler,o.capture);f={}}for(u in f)return a;delete s[i];try{delete e[c]}catch(m){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(u,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(f,[],function(){function e(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function n(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function r(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function i(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function o(e,t){var n=[];return i(e,function(e){n.push(t(e))}),n}function a(e,t){var n=[];return i(e,function(e){(!t||t(e))&&n.push(e)}),n}function s(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,this.onCreate&&this.onCreate(e[2],e[3],o[a]),void 0;t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function l(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function c(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function d(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),i(e,function(e,i){return t.call(r,e,i,n)===!1?!1:(d(e,t,n,r),void 0)}))}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function p(t,n){return!t||e(t,"array")?t:o(t.split(n||","),h)}var m=/^\s*|\s*$/g,h=function(e){return null===e||e===t?"":(""+e).replace(m,"")},g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:h,isArray:g,is:e,toArray:n,makeMap:r,each:i,map:o,grep:a,inArray:l,extend:c,create:s,walk:d,createNS:u,resolve:f,explode:p}}),r(p,[f],function(e){function t(n){function r(){return L.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(W,e,t)}function a(e){i(e.parentNode,$(e))}function s(e){i(e.parentNode,$(e)+1)}function l(e){o(e.parentNode,$(e))}function c(e){o(e.parentNode,$(e)+1)}function d(e){e?(D[U]=D[V],D[q]=D[z]):(D[V]=D[U],D[z]=D[q]),D.collapsed=F}function u(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=D[V],r=D[z],i=D[U],o=D[q],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function m(){N(I)}function h(){return N(P)}function g(){return N(O)}function v(e){var t=this[V],r=this[z],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=D.extractContents();D.insertNode(e),e.appendChild(t),D.selectNode(e)}function b(){return j(new t(n),{startContainer:D[V],startOffset:D[z],endContainer:D[U],endOffset:D[q],collapsed:D.collapsed,commonAncestorContainer:D.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return D[V]==D[U]&&D[z]==D[q]}function w(e,t,r,i){var o,a,s,l,c,d;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),d=r;d&&d.parentNode!=l;)d=d.parentNode;if(d||(d=l),c==d)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==d)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(D[V]=t,D[z]=r):(D[U]=t,D[q]=r),i=D[U];i.parentNode;)i=i.parentNode;for(o=D[V];o.parentNode;)o=o.parentNode;o==i?w(D[V],D[z],D[U],D[q])>0&&D.collapse(e):D.collapse(e),D.collapsed=x(),D.commonAncestorContainer=n.findCommonAncestor(D[V],D[U])}function N(e){var t,n=0,r=0,i,o,a,s,l,c;if(D[V]==D[U])return E(e);for(t=D[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==D[V])return k(t,e);++n}for(t=D[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==D[U])return S(t,e);++r}for(o=r-n,a=D[V];o>0;)a=a.parentNode,o--;for(s=D[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function E(e){var t,n,i,o,a,s,l,c,d;if(e!=I&&(t=r()),D[z]==D[q])return t;if(3==D[V].nodeType){if(n=D[V].nodeValue,i=n.substring(D[z],D[q]),e!=O&&(o=D[V],c=D[z],d=D[q]-D[z],0===c&&d>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,d),D.collapse(F)),e==I)return;return i.length>0&&t.appendChild(L.createTextNode(i)),t}for(o=C(D[V],D[z]),a=D[q]-D[z];o&&a>0;)s=o.nextSibling,l=H(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&D.collapse(F),t}function k(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=$(e),a=o-D[z],0>=a)return t!=O&&(D.setEndBefore(e),D.collapse(W)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=H(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(D.setEndBefore(e),D.collapse(W)),n}function S(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=$(e),++i,a=D[q]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=H(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(D.setStartAfter(e),D.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,d,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=e.parentNode,s=$(e),l=$(t),++s,c=l-s,d=e.nextSibling;c>0;)u=d.nextSibling,i=H(d,n),o&&o.appendChild(i),d=u,--c;return i=R(t,n),o&&o.appendChild(i),n!=O&&(D.setStartAfter(e),D.collapse(F)),o}function R(e,t){var n=C(D[U],D[q]-1),r,i,o,a,s,l=n!=D[U];if(n==e)return B(n,l,W,t);for(r=n.parentNode,i=B(r,W,W,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,W,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,W,W,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(D[V],D[z]),r=n!=D[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,W,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,W,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return H(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=D[z],a=o.substring(l),s=o.substring(0,l)):(l=D[q],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,W),c.nodeValue=a,c}if(i!=I)return n.clone(e,W)}function H(e,t){return t!=I?t==O?n.clone(e,F):e:(e.parentNode.removeChild(e),void 0)}function M(){return n.create("body",null,g()).outerText}var D=this,L=n.doc,P=0,O=1,I=2,F=!0,W=!1,z="startOffset",V="startContainer",U="endContainer",q="endOffset",j=e.extend,$=n.nodeIndex;return j(D,{startContainer:L,startOffset:0,endContainer:L,endOffset:0,collapsed:F,commonAncestorContainer:L,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:d,selectNode:u,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:m,extractContents:h,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:M}),D}return t.prototype.toString=function(){return this.toStringIE()},t}),r(m,[f],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,d=/&(#x|#)?([\w]+);/g,u={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(d,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):u[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(h,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1!=t.indexOf("Trident")?11:!1,i=i||o,a=!r&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(g,[l,c,d,u,p,m,h,f],function(e,n,r,i,o,a,s,l){function c(e,t){var i=this,o;i.doc=e,i.win=window,i.files={},i.counter=0,i.stdMode=!g||e.documentMode>=8,i.boxModel=!g||"CSS1Compat"==e.compatMode||i.stdMode,i.hasOuterHTML="outerHTML"in e.createElement("a"),this.boundEvents=[],i.settings=t=m({keep_values:!1,hex_colors:1},t),i.schema=t.schema,i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),i.fixDoc(e),i.events=t.ownEvents?new r(t.proxy):r.Event,o=t.schema?t.schema.getBlockElements():{},i.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}}var d=l.each,u=l.is,f=l.grep,p=l.trim,m=l.extend,h=s.webkit,g=s.ie,v=/^([a-z0-9],?)+$/i,y=/^[ \t\r\n]*$/,b=l.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return c.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(g&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!g||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),u(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(v.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}return n.nodeType&&1!=n.nodeType?!1:e.matches(r,n.nodeType?[n]:n).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=u(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!g||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,o;if(t)if("string"==typeof t){i=e.style,t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof n||b[t]||(n+="px"),"opacity"===t&&e.runtimeStyle&&"undefined"==typeof e.runtimeStyle.opacity&&(i.filter=""===n?"":"alpha(opacity="+100*n+")"),"float"==t&&(t="cssFloat"in e.style?"cssFloat":"styleFloat");try{i[t]=n}catch(a){}r.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(o in t)r.setStyle(e,o,t[o])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=g?"styleFloat":"cssFloat"),e.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this;if(e&&t)return this.run(e,function(e){var i=r.settings,o=e.getAttribute(t);if(null!==n)switch(t){case"style":if(!u(n,"string"))return d(n,function(t,n){r.setStyle(e,n,t)}),void 0;i.keep_values&&(n?e.setAttribute("data-mce-style",n,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":i.keep_values&&(i.url_converter&&(n=i.url_converter.call(i.url_converter_scope||r,n,t,e)),r.setAttrib(e,"data-mce-"+t,n,2));break;case"shape":e.setAttribute("data-mce-style",n)}u(n)&&null!==n&&0!==n.length?e.setAttribute(t,""+n,2):e.removeAttribute(t,2),o!=n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){d(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(u(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(g&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),h&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),g)switch(t){case"rowspan":case"colspan":1===r&&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClientRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientTop,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientLeft,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==c.DOM&&n===document){var o=c.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,c.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==c.DOM&&n===document?(c.DOM.loadCSS(e),void 0):(e||(e=""),r=n.getElementsByTagName("head")[0],d(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),g&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}),void 0)},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0 +})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=p(" "!=i?i:""),e.className=i,i||(e.removeAttribute("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(g){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="
    "+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="
    "+t,d(f(i.childNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,g)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return u(t,"array")&&(e=e.cloneNode(!0)),n&&d(f(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(l.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],d(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(g){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,o,a,s,l,c=0;if(e=e.firstChild){s=new i(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(o=n.getAttribs(e),r=e.attributes.length;r--;)if(l=e.attributes[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!y.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new o(this)},nodeIndex:function(e,t){var n=0,r,i,o;if(e)for(r=e.nodeType,e=e.previousSibling,i=e;e;e=e.previousSibling)o=e.nodeType,(!t||3!=o||o!=r&&e.nodeValue.length)&&(n++,r=o);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=p(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(l.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(l.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return 1!=e.nodeType?null:(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null)},destroy:function(){var e=this;if(e.boundEvents){for(var t=e.boundEvents.length;t--;){var n=e.boundEvents[t];this.events.unbind(n[0],n[1],n[2])}e.boundEvents=null}e.win=e.doc=e.root=e.events=e.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},c.DOM=new c(document),c}),r(v,[g,f],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t()}function i(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},d=[],u=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var m;d.push({func:r,scope:l||this}),m=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?(p(t),void 0):(s[t]!=n&&(s[t]=n,u++,e(t,function(){s[t]=a,u--,p(t),m()})),void 0)}),u||(i(d,function(e){e.func.call(e.scope)}),d.length=0)},m()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(y,[v,f],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t){r.language&&r.languageLoad!==!1&&e.ScriptLoader.add(this.urls[t]+"/langs/"+r.language+".js")},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,d=o;c.urls[n]||("object"==typeof o&&(d=o.prefix+o.resource+o.suffix),0!==d.indexOf("/")&&-1==d.indexOf("://")&&(d=r.baseURL+"/"+d),c.urls[n]=d.substring(0,d.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(d,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(b,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(C,[f],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var o,l,c,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;lo;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},s,l,c,d,u,f,p;return r[e]?r[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange onwaiting"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),d=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),d.push.apply(d,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),p=t("acronym applet basefont big font strike tt"),d.push.apply(d,p),o(p,function(e){n(e,"",d)}),f=t("center dir isindex noframes"),c.push.apply(c,f),u=[].concat(c,d),o(f,function(e){n(e,"",u)})),u=u||[].concat(c,d),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",u),n("address dt dd div caption","",u),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",d),n("blockquote","cite",u),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",u),n("dl","","dt dd"),n("a","href target rel media hreflang type",d),n("q","cite",d),n("ins del","cite datetime",u),n("img","src alt usemap ismap width height"),n("iframe","src name width height",u),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",u,"param"),n("param","name value"),n("map","name",u,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",u),n("th","colspan rowspan headers scope abbr",u),n("form","accept-charset action autocomplete enctype method name novalidate target",u),n("fieldset","disabled form name",u,"legend"),n("label","form for",d),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?u:d),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",u,"li"),n("noscript","",u),"html4"!=e&&(n("wbr"),n("ruby","",d,"rt rp"),n("figcaption","",u),n("mark rt rp summary bdi","",d),n("canvas","width height",u),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height",u,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls",u,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",d,"option"),n("article section nav aside header footer","",u),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",u,"figcaption"),n("time","datetime",d),n("dialog","open",u),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",d),n("progress","value max",d),n("meter","value min max low high optimum",d),n("details","open",u,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid codebase codetype archive standby align border hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select","onchange"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!=e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("iframe","srcdoc sandbox seamless allowfullscreen")),o(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,r[e]=a,a)}var r={},i=e.makeMap,o=e.each,a=e.extend,s=e.explode,l=e.inArray;return function(e){function c(t,n,o){var s=e[t];return s?s=i(s,",",i(s.toUpperCase()," ")):(s=r[t],s||(s=i(n," ",i(n.toUpperCase()," ")),s=a(s,o),r[t]=s)),s}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function u(e){var n,r,o,a,s,c,u,f,p,m,h,g,y,C,x,w,_,N,E,k=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),v["@"]&&(w=v["@"].attributes,_=v["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=k.exec(e[n])){if(C=s[1],p=s[2],x=s[3],f=s[5],g={},y=[],c={attributes:g,attributesOrder:y},"#"===C&&(c.paddEmpty=!0),"-"===C&&(c.removeEmpty=!0),"!"===s[4]&&(c.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];y.push.apply(y,_)}if(f)for(f=t(f,"|"),o=0,a=f.length;a>o;o++)if(s=S.exec(f[o])){if(u={},h=s[1],m=s[2].replace(/::/g,":"),C=s[3],E=s[4],"!"===h&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(m),u.required=!0),"-"===h){delete g[m],y.splice(l(y,m),1);continue}C&&("="===C&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:m,value:E}),u.defaultValue=E),":"===C&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:m,value:E}),u.forcedValue=E),"<"===C&&(u.validValues=i(E,"?"))),T.test(m)?(c.attributePatterns=c.attributePatterns||[],u.pattern=d(m),c.attributePatterns.push(u)):(g[m]||y.push(m),g[m]=u)}w||"@"!=p||(w=g,_=y),x&&(c.outputName=p,v[x]=c),T.test(p)?(c.pattern=d(p),b.push(c)):v[p]=c}}function f(e){v={},b=[],u(e),o(x,function(e,t){y[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&o(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",s=t[2];if(y[s]=y[i],R[s]=i,r||(k[s.toUpperCase()]={},k[s]={}),!v[s]){var l=v[i];l=a({},l),delete l.removeEmptyAttrs,delete l.removeEmpty,v[s]=l}o(y,function(e){e[i]&&(e[s]=e[i])})})}function m(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&o(t(e,","),function(e){var r=n.exec(e),i,a;r&&(a=r[1],i=a?y[r[2]]:y[r[2]]={"#comment":{}},i=y[r[2]],o(t(r[3],"|"),function(e){"-"===a?delete i[e]:i[e]={}}))})}function h(e){var t=v[e],n;if(t)return t;for(n=b.length;n--;)if(t=b[n],t.pattern.test(e))return t}var g=this,v={},y={},b=[],C,x,w,_,N,E,k,S,T,R={},A={};e=e||{},x=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),e.valid_styles&&(C={},o(e.valid_styles,function(e,t){C[t]=s(e)})),w=c("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),N=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),E=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),S=c("non_empty_elements","td th iframe video audio object",N),T=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),k=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",T),o((e.special||"script noscript style textarea").split(" "),function(e){A[e]=new RegExp("]*>","gi")}),e.valid_elements?f(e.valid_elements):(o(x,function(e,t){v[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},y[t]=e.children}),"html5"!=e.schema&&o(t("strong/b em/i"),function(e){e=t(e,"/"),v[e[1]].outputName=e[0]}),v.img.attributesDefault=[{name:"alt",value:""}],o(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){v[e]&&(v[e].removeEmpty=!0)}),o(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){v[e].paddEmpty=!0}),o(t("span"),function(e){v[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),u(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&o(s(e.invalid_elements),function(e){v[e]&&delete v[e]}),h("span")||u("span[!data-mce-type|*]"),g.children=y,g.styles=C,g.getBoolAttrs=function(){return E},g.getBlockElements=function(){return k},g.getTextBlockElements=function(){return T},g.getShortEndedElements=function(){return N},g.getSelfClosingElements=function(){return _},g.getNonEmptyElements=function(){return S},g.getWhiteSpaceElements=function(){return w},g.getSpecialElements=function(){return A},g.isValidChild=function(e,t){var n=y[e];return!(!n||!n[t])},g.isValid=function(e,t){var n,r,i=h(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},g.getElementRule=h,g.getCustomElements=function(){return R},g.addValidElements=u,g.setValidElements=f,g.addCustomElements=p,g.addValidChildren=m,g.elements=v}}),r(x,[C,m,f],function(e,t,n){var r=n.each;return function(n,i){var o=this,a=function(){};n=n||{},o.schema=i=i||new e,n.fix_self_closing!==!1&&(n.fix_self_closing=!0),r("comment cdata text start end pi doctype".split(" "),function(e){e&&(o[e]=n[e]||a)}),o.parse=function(e){function r(e){var t,n;for(t=u.length;t--&&u[t].name!==e;);if(t>=0){for(n=u.length-1;n>=t;n--)e=u[n],e.valid&&a.end(e.name);u.length=t}}function o(e,t,n,r,i){var o,a;if(t=t.toLowerCase(),n=t in b?t:I(n||r||i||""),x&&!g&&0!==t.indexOf("data-")){if(o=k[t],!o&&S){for(a=S.length;a--&&(o=S[a],!o.pattern.test(t)););-1===a&&(o=null)}if(!o)return;if(o.validValues&&!(n in o.validValues))return}f.map[t]=n,f.push({name:t,value:n})}var a=this,s,l=0,c,d,u=[],f,p,m,h,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,H,M,D,L,P,O=0,I=t.decode,F;for(M=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,y=i.getShortEndedElements(),H=n.self_closing_elements||i.getSelfClosingElements(),b=i.getBoolAttrs(),x=n.validate,v=n.remove_internals,F=n.fix_self_closing,L=i.getSpecialElements();s=M.exec(e);){if(l0&&u[u.length-1].name===c&&r(c),!x||(w=i.getElementRule(c))){if(_=!0,x&&(k=w.attributes,S=w.attributePatterns),(E=s[8])?(g=-1!==E.indexOf("data-mce-type"),g&&v&&(_=!1),f=[],f.map={},E.replace(D,o)):(f=[],f.map={}),x&&!g){if(T=w.attributesRequired,R=w.attributesDefault,A=w.attributesForced,B=w.removeEmptyAttrs,B&&!f.length&&(_=!1),A)for(p=A.length;p--;)N=A[p],h=N.name,P=N.value,"{$uid}"===P&&(P="mce_"+O++),f.map[h]=P,f.push({name:h,value:P});if(R)for(p=R.length;p--;)N=R[p],h=N.name,h in f.map||(P=N.value,"{$uid}"===P&&(P="mce_"+O++),f.map[h]=P,f.push({name:h,value:P}));if(T){for(p=T.length;p--&&!(T[p]in f.map););-1===p&&(_=!1)}f.map["data-mce-bogus"]&&(_=!1)}_&&a.start(c,f,C)}else _=!1;if(d=L[c]){d.lastIndex=l=s.index+s[0].length,(s=d.exec(e))?(_&&(m=e.substr(l,s.index-l)),l=s.index+s[0].length):(m=e.substr(l),l=e.length),_&&(m.length>0&&a.text(m,!0),a.end(c)),M.lastIndex=l;continue}C||(E&&E.indexOf("/")==E.length-1?_&&a.end(c):u.push({name:c,valid:_}))}else(c=s[1])?a.comment(c):(c=s[2])?a.cdata(c):(c=s[3])?a.doctype(c):(c=s[4])&&a.pi(c,s[5]);l=s.index+s[0].length}for(l=0;p--)c=u[p],c.valid&&a.end(c.name)}}}),r(w,[b,C,x,f],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,u,f,p,m,h,g,v,y;for(h=i("tr,td,th,tbody,thead,tfoot,table"),m=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n1){for(a.reverse(),s=c=d.filterNode(a[0].clone()),p=0;p0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,N,E,k,S,T,R,A=[],B,H,M,D,L,P,O,I;if(o=o||{},p={},m={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,S=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,L=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,H=/[ \t\r\n]+$/,M=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/,v=new n({validate:S,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(d("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(M," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=d("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(d("#comment",8)).value=e},pi:function(e,t){b.append(d(e,7)).value=t,h(b)},doctype:function(e){var t;t=b.append(d("#doctype",10)),t.value=e,h(b)},start:function(e,t,n){var r,i,o,a,s;if(o=S?l.getElementRule(e):{}){for(r=d(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(E=m[a],E?E.push(r):m[a]=[r]);T[e]&&h(r),n||(b=r),!B&&L[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=S?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||D.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(H,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||D.test(i))&&(n.remove(),n=o),n=o}if(B&&L[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,b.empty().remove(),b=a,void 0;b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),S&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(k in p){for(E=u[k],C=p[k],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=E.length;w>x;x++)E[x](C,k,o)}for(x=0,w=f.length;w>x;x++)if(E=f[x],E.name in m){for(C=m[E.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,N=E.callbacks.length;N>_;_++)E.callbacks[_](C,E.name,o)}}return y},r.remove_trailing_brs&&d.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,d,u,f,p,m;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(u=i.prev;u;){if(f=u.name,"span"!==f||"bookmark"!==u.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}u=u.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(d=i;c&&c.firstChild===d&&c.lastChild===d&&(d=c,!o[c.name]);)c=c.parent;d===c&&(m=new e("#text",3),m.value="\xa0",i.replace(m))}}),r.allow_html_in_named_anchor||d.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}})}}),r(_,[m,f],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,d,u,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,d=t.length;d>c;c++)u=t[c],r.push(" ",u.name,'="',s(u.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n")) +},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(N,[_,C],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,d,u,f,p,m,h;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},h=r.getElementRule(e.name),p=0,m=h.attributesOrder.length;m>p;p++)d=h.attributesOrder[p],d in c.map&&(u=c.map[d],f.map[d]=u,f.push({name:d,value:u}));for(p=0,m=c.length;m>p;p++)d=c[p].name,d in f.map||(u=c.map[d],f.map[d]=u,f.push({name:d,value:u}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(E,[g,w,m,N,b,C,h,f],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,d=e.DOM;return function(e,i){var s,u,f;return i&&(s=i.dom,u=i.schema),s=s||d,u=u||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,u),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,d;r--;)i=t[r],o=i.attributes.map[a],o!==d?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null)}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addAttributeFilter("data-mce-expando",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o;r--;)if(i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t){var a=(i.attr("type")||"text/javascript").replace(/^mce\-/,"");i.attr("type","text/javascript"===a?null:a),o.length>0&&(i.firstChild.value="// ")}else o.length>0&&(i.firstChild.value="")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:u,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,d,p,m,h;return a.ie&&s.select("script,style,select,map").length>0?(h=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,h)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(d=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){d.body.appendChild(d.importNode(e,!0))}),t="BODY"!=t.nodeName?d.body.firstChild:d.body,p=s.doc,s.doc=d),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),m=new r(e,u),n.content=m.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){u.addValidElements(e)},setRules:function(e){u.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(k,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,d,u=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(d=Math.floor((i+o)/2),l=s[d],r.moveToElementText(l),u=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),u>0)o=d-1;else{if(!(0>u))return{node:l};i=d+1}if(0>u)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:u,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,d;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return a[e?"setStart":"setEnd"](r,0),void 0;if(i===c)return a[e?"setStartBefore":"setEndAfter"](r),void 0;if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return a[e?"setStartAfter":"setEndAfter"](r),void 0;if(!i)return 3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l),void 0;for(;l;){if(d=l.nodeValue,s+=d.length,s>=i){r=l,s-=i,s=d.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return 3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l),void 0;for(;l;){if(s+=l.nodeValue.length,s>=i){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,d,u;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;u=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),d=c.parentElement(),d.innerHTML=d.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(u),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,u,m;a=i.create("a"),t=e?s:c,n=e?l:d,u=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),u.moveToElementText(a),u.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",u)):(m=t.childNodes,m.length?(n>=m.length?i.insertAfter(a,m[m.length-1]):t.insertBefore(a,m[n]),u.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,u.moveToElementText(a),u.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",u),i.remove(a))}var r,a,s,l,c,d,u,f=e.dom.doc,p=f.body,m,h;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,d=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==d&&!s.hasChildNodes()){if(s.canHaveHTML)return u=s.previousSibling,u&&!u.hasChildNodes()&&i.isBlock(u)?u.innerHTML="":u=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",u&&(u.innerHTML=""),void 0;l=i.nodeIndex(s),s=s.parentNode}if(l==d-1)try{if(h=s.childNodes[l],a=p.createControlRange(),a.addElement(h),a.select(),m=e.getRng(),m.item&&h===m.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(S,[h],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return(e.mac?t.ctrlKey||t.metaKey:t.ctrlKey)&&!t.altKey}}}),r(T,[S,f,h],function(e,t,n){return function(r,i){function o(e){return i.settings.object_resizing===!1?!1:/TABLE|IMG|DIV/.test(e.nodeName)?"false"===e.getAttribute("data-mce-resize")?!1:!0:!1}function a(t){var n,r;n=t.screenX-k,r=t.screenY-S,D=n*N[2]+A,L=r*N[3]+B,D=5>D?5:D,L=5>L?5:L,(e.modifierPressed(t)||"IMG"==x.nodeName&&0!==N[2]*N[3])&&(D=Math.round(L/H),L=Math.round(D*H)),b.setStyles(w,{width:D,height:L}),N[2]<0&&w.clientWidth<=D&&b.setStyle(w,"left",T+(A-D)),N[3]<0&&w.clientHeight<=L&&b.setStyle(w,"top",R+(B-L)),M||(i.fire("ObjectResizeStart",{target:x,width:A,height:B}),M=!0)}function s(){function e(e,t){t&&(x.style[e]||!i.schema.isValid(x.nodeName.toLowerCase(),e)?b.setStyle(x,e,t):b.setAttrib(x,e,t))}M=!1,e("width",D),e("height",L),b.unbind(P,"mousemove",a),b.unbind(P,"mouseup",s),O!=P&&(b.unbind(O,"mousemove",a),b.unbind(O,"mouseup",s)),b.remove(w),I&&"TABLE"!=x.nodeName||l(x),i.fire("ObjectResized",{target:x,width:D,height:L}),i.nodeChanged()}function l(e,t,n){var r,l,d,u,f,p=i.getBody().offsetParent||i.getBody();r=b.getPos(e,p),T=r.x,R=r.y,f=e.getBoundingClientRect(),l=f.width||f.right-f.left,d=f.height||f.bottom-f.top,x!=e&&(h(),x=e,D=L=0),u=i.fire("ObjectSelected",{target:e}),o(e)&&!u.isDefaultPrevented()?C(_,function(e,r){function o(t){M=!0,k=t.screenX,S=t.screenY,A=x.clientWidth,B=x.clientHeight,H=B/A,N=e,w=x.cloneNode(!0),b.addClass(w,"mce-clonedresizable"),w.contentEditable=!1,w.unSelectabe=!0,b.setStyles(w,{left:T,top:R,margin:0}),w.removeAttribute("data-mce-selected"),i.getBody().appendChild(w),b.bind(P,"mousemove",a),b.bind(P,"mouseup",s),O!=P&&(b.bind(O,"mousemove",a),b.bind(O,"mouseup",s))}var c,u;return t?(r==t&&o(n),void 0):(c=b.get("mceResizeHandle"+r),c?b.show(c):(u=i.getBody(),c=b.add(u,"div",{id:"mceResizeHandle"+r,"data-mce-bogus":!0,"class":"mce-resizehandle",contentEditable:!1,unSelectabe:!0,style:"cursor:"+r+"-resize; margin:0; padding:0"}),b.bind(c,"mousedown",function(e){e.preventDefault(),o(e)})),b.setStyles(c,{left:l*e[0]+T-c.offsetWidth/2,top:d*e[1]+R-c.offsetHeight/2}),void 0)}):c(),x.setAttribute("data-mce-selected","1")}function c(){var e,t;x&&x.removeAttribute("data-mce-selected");for(e in _)t=b.get("mceResizeHandle"+e),t&&(b.unbind(t),b.remove(t))}function d(e){function t(e,t){do if(e===t)return!0;while(e=e.parentNode)}var n;return C(b.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),n="mousedown"==e.type?e.target:r.getNode(),n=b.getParent(n,I?"table":"table,img,hr"),n&&(g(),t(r.getStart(),n)&&t(r.getEnd(),n)&&(!I||n!=r.getStart()&&"IMG"!==r.getStart().nodeName))?(l(n),void 0):(c(),void 0)}function u(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,d;n=t.getBoundingClientRect(),c=E.clientX-n.left,d=E.clientY-n.top;for(r in _)if(o=_[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],Math.abs(a-c)<8&&Math.abs(s-d)<8){N=o;break}M=!0,i.getDoc().selection.empty(),l(t,r,E)}function m(e){var t=e.srcElement;if(t!=x){if(h(),0===t.id.indexOf("mceResizeHandle"))return e.returnValue=!1,void 0;("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),x=t,u(t,"resizestart",p))}}function h(){f(x,"resizestart",p)}function g(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function v(e){var t;if(I){t=P.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function y(){x=w=null,I&&(h(),f(i.getBody(),"controlselect",m))}var b=i.dom,C=t.each,x,w,_,N,E,k,S,T,R,A,B,H,M,D,L,P=i.getDoc(),O=document,I=n.ie&&n.ie<11;_={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var F=".mce-content-body";return i.contentStyles.push(F+" div.mce-resizehandle {"+"position: absolute;"+"border: 1px solid black;"+"background: #FFF;"+"width: 5px;"+"height: 5px;"+"z-index: 10000"+"}"+F+" .mce-resizehandle:hover {"+"background: #000"+"}"+F+" img[data-mce-selected], hr[data-mce-selected] {"+"outline: 1px solid black;"+"resize: none"+"}"+F+" .mce-clonedresizable {"+"position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;"+"filter: alpha(opacity=50);"+"z-index: 10000"+"}"),i.on("init",function(){I?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),v(e.target))}),u(i.getBody(),"controlselect",m),i.on("mousedown",function(e){E=e})):(g(),n.ie>=11&&i.on("mouseup mousedown",function(e){("IMG"==e.target.nodeName||"IMG"==i.selection.getNode().nodeName)&&(e.preventDefault(),i.selection.select(e.target))})),i.on("nodechange mousedown ResizeEditor",d),i.on("keydown keyup",function(e){x&&"TABLE"==x.nodeName&&d(e)})}),{controlSelect:v,destroy:y}}}),r(R,[u,k,T,h,f],function(e,n,r,i,o){function a(e,t,i,o){var a=this;a.dom=e,a.win=t,a.serializer=i,a.editor=o,a.controlSelection=new r(a,o),a.win.getSelection||(a.tridentSel=new n(a))}var s=o.each,l=o.grep,c=o.trim,d=i.ie,u=i.opera;return a.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){function n(e,t){var n=0;return s(a.select(e),function(e,r){e==t&&(n=r)}),n}function r(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function i(){function e(e,n){var i=e[n?"startContainer":"endContainer"],a=e[n?"startOffset":"endOffset"],s=[],l,c,d=0;if(3==i.nodeType){if(t)for(l=i.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=i.childNodes,a>=c.length&&c.length&&(d=1,a=Math.max(0,c.length-1)),s.push(o.dom.nodeIndex(c[a],t)+d);for(;i&&i!=r;i=i.parentNode)s.push(o.dom.nodeIndex(i,t));return s}var n=o.getRng(!0),r=a.getRoot(),i={};return i.start=e(n,!0),o.isCollapsed()||(i.end=e(n)),i}var o=this,a=o.dom,l,c,d,u,f,p,m="",h;if(2==e)return p=o.getNode(),f=p.nodeName,"IMG"==f?{name:f,index:n(f,p)}:o.tridentSel?o.tridentSel.getBookmark(e):i();if(e)return{rng:o.getRng()};if(l=o.getRng(),d=a.uniqueId(),u=o.isCollapsed(),h="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return p=l.item(0),f=p.nodeName,{name:f,index:n(f,p)};c=l.duplicate();try{l.collapse(),l.pasteHTML(''+m+""),u||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML(''+m+""))}catch(g){return null}}else{if(p=o.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:n(f,p)};c=r(l.cloneRange()),u||(c.collapse(!1),c.insertNode(a.create("span",{"data-mce-type":"bookmark",id:d+"_end",style:h},m))),l=r(l),l.collapse(!0),l.insertNode(a.create("span",{"data-mce-type":"bookmark",id:d+"_start",style:h},m))}return o.moveToBookmark({id:d,keep:1}),{id:d}},moveToBookmark:function(e){function t(t){var n=e[t?"start":"end"],r,i,o,s;if(n){for(o=n[0],i=c,r=n.length-1;r>=1;r--){if(s=i.childNodes,n[r]>s.length-1)return;i=s[n[r]]}3===i.nodeType&&(o=Math.min(n[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(n[0],i.childNodes.length)),t?a.setStart(i,o):a.setEnd(i,o)}return!0}function n(t){var n=o.get(e.id+"_"+t),r,i,a,c,d=e.keep;if(n&&(r=n.parentNode,"start"==t?(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),f=p=r,m=h=i):(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),p=r,h=i),!d)){for(c=n.previousSibling,a=n.nextSibling,s(l(n.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});n=o.get(e.id+"_"+t);)o.remove(n,1);c&&a&&c.nodeType==a.nodeType&&3==c.nodeType&&!u&&(i=c.nodeValue.length,c.appendData(a.nodeValue),o.remove(a),"start"==t?(f=p=c,m=h=i):(p=c,h=i))}}function r(e){return!o.isBlock(e)||e.innerHTML||d||(e.innerHTML='
    '),e}var i=this,o=i.dom,a,c,f,p,m,h;if(e)if(e.start){if(a=o.createRng(),c=o.getRoot(),i.tridentSel)return i.tridentSel.moveToBookmark(e);t(!0)&&t()&&i.setRng(a)}else e.id?(n("start"),n("end"),f&&(a=o.createRng(),a.setStart(r(f),m),a.setEnd(r(p),h),i.setRng(a))):e.name?i.select(o.select(e.name)[e.index]):e.rng&&i.setRng(e.rng)},select:function(t,n){function r(t,n){var r=t,i=new e(t,r);do{if(3==t.nodeType&&0!==c(t.nodeValue).length)return n?a.setStart(t,0):a.setEnd(t,t.nodeValue.length),void 0;if(l[t.nodeName])return n?a.setStartBefore(t):"BR"==t.nodeName?a.setEndBefore(t):a.setEndAfter(t),void 0}while(t=n?i.next():i.prev());"BODY"==r.nodeName&&(n?a.setStart(r,0):a.setEnd(r,r.childNodes.length))}var i=this,o=i.dom,a=o.createRng(),s,l;if(i.lastFocusBookmark=null,l=o.schema.getNonEmptyElements(),t){if(!n&&i.controlSelection.controlSelect(t))return;s=o.nodeIndex(t),a.setStart(t.parentNode,s),a.setEnd(t.parentNode,s+1),n&&(r(t,1),r(t)),i.setRng(a)}return t},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){var t=this,n,r,i,o=t.win.document,a;if(!e&&t.lastFocusBookmark){var s=t.lastFocusBookmark;return s.startContainer?(r=o.createRange(),r.setStart(s.startContainer,s.startOffset),r.setEnd(s.endContainer,s.endOffset)):r=s,r}if(e&&t.tridentSel)return t.tridentSel.getRangeAt(0);try{(n=t.getSel())&&(r=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():o.createRange())}catch(l){}if(d&&r&&r.setStart){try{a=o.selection.createRange()}catch(l){}a&&a.item&&(i=a.item(0),r=o.createRange(),r.setStartBefore(i),r.setEndAfter(i))}return r||(r=o.createRange?o.createRange():o.body.createTextRange()),r.setStart&&9===r.startContainer.nodeType&&r.collapsed&&(i=t.dom.getRoot(),r.setStart(i,0),r.setEnd(i,0)),t.selectedRange&&t.explicitRange&&(0===r.compareBoundaryPoints(r.START_TO_START,t.selectedRange)&&0===r.compareBoundaryPoints(r.END_TO_END,t.selectedRange)?r=t.explicitRange:(t.selectedRange=null,t.explicitRange=null)),r},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return n.tridentSel.addRange(e),void 0}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset;return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):n.item?n.item(0):n.parentElement():t.dom.getRoot()},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){function t(t){function a(t,n){for(var r=new e(t,f.getParent(t.parentNode,f.isBlock)||p);t=r[n?"prev":"next"]();)if("BR"===t.nodeName)return!0}function s(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function l(t,n){var r,a;for(n=n||c,r=new e(n,f.getParent(n.parentNode,f.isBlock)||p);m=r[t?"prev":"next"]();){if(3===m.nodeType&&m.nodeValue.length>0)return c=m,d=t?m.nodeValue.length:0,i=!0,void 0;if(f.isBlock(m)||h[m.nodeName.toLowerCase()])return;a=m}o&&a&&(c=a,i=!0,d=0)}var c,d,u,f=n.dom,p=f.getRoot(),m,h,g;if(c=r[(t?"start":"end")+"Container"],d=r[(t?"start":"end")+"Offset"],h=f.schema.getNonEmptyElements(),9===c.nodeType&&(c=f.getRoot(),d=0),c===p){if(t&&(m=c.childNodes[d>0?d-1:0],m&&(g=m.nodeName.toLowerCase(),h[m.nodeName]||"TABLE"==m.nodeName)))return;if(c.hasChildNodes()&&(d=Math.min(!t&&d>0?d-1:d,c.childNodes.length-1),c=c.childNodes[d],d=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){m=c,u=new e(c,p);do{if(3===m.nodeType&&m.nodeValue.length>0){d=t?0:m.nodeValue.length,c=m,i=!0;break}if(h[m.nodeName.toLowerCase()]){d=f.nodeIndex(m),c=m.parentNode,"IMG"!=m.nodeName||t||d++,i=!0;break}}while(m=t?u.next():u.prev())}}o&&(3===c.nodeType&&0===d&&l(!0),1===c.nodeType&&(m=c.childNodes[d],!m||"BR"!==m.nodeName||s(m,"A")||a(m)||a(m,!0)||l(!0,c.childNodes[d]))),t&&!o&&3===c.nodeType&&d===c.nodeValue.length&&l(!1),i&&r["set"+(t?"Start":"End")](c,d)}var n=this,r,i,o;d||(r=n.getRng(),o=r.collapsed,t(!0),o||t(),i&&(o&&r.collapse(!0),n.setRng(r,n.isForward())))},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};s(n.selectorChangedData,function(e,t){s(o,function(n){return i.is(n,t)?(r[t]||(s(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),s(r,function(e,n){a[n]||(delete r[n],s(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,(s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25),void 0}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(ns+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},destroy:function(){this.win=null,this.controlSelection.destroy()}},a}),r(A,[f],function(e){function t(e){this.walk=function(t,r){function i(e){var t;return t=e[0],3===t.nodeType&&t===l&&c>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===u&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function o(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,n){var a=n?"nextSibling":"previousSibling";for(h=e,g=h.parentNode;h&&h!=t;h=g)g=h.parentNode,v=o(h==e?h:h[a],a),v.length&&(n||v.reverse(),r(i(v)))}var l=t.startContainer,c=t.startOffset,d=t.endContainer,u=t.endOffset,f,p,m,h,g,v,y;if(y=e.select("td.mce-item-selected,th.mce-item-selected"),y.length>0)return n(y,function(e){r([e])}),void 0;if(1==l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[c]),1==d.nodeType&&d.hasChildNodes()&&(d=d.childNodes[Math.min(u-1,d.childNodes.length-1)]),l==d)return r(i([l]));for(f=e.findCommonAncestor(l,d),h=l;h;h=h.parentNode){if(h===d)return s(l,f,!0);if(h===f)break}for(h=d;h;h=h.parentNode){if(h===l)return s(d,f);if(h===f)break}p=a(l,f)||l,m=a(d,f)||d,s(l,p,!0),v=o(p==l?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),v.length&&r(i(v)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o=e;e++)r.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);r.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),r.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),r.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function c(e){return e?O[e]:O}function d(e,t){e&&("string"!=typeof e?et(e,function(e,t){d(t,e)}):(t=t.length?t:[t],et(t,function(e){e.deep===X&&(e.deep=!e.selector),e.split===X&&(e.split=!e.selector||e.inline),e.remove===X&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),O[e]=t))}function u(e){var t; +return r.dom.getParent(e,function(e){return t=r.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function f(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=u(e.parentNode),r.dom.getStyle(e,"color")&&t?r.dom.setStyle(e,"text-decoration",t):r.dom.getStyle(e,"textdecoration")===t&&r.dom.setStyle(e,"text-decoration",null))}function p(t,n,o){function s(e,t){t=t||h,e&&(t.onformat&&t.onformat(e,t,n,o),et(t.styles,function(t,r){I.setStyle(e,r,E(t,n))}),et(t.attributes,function(t,r){I.setAttrib(e,r,E(t,n))}),et(t.classes,function(t){t=E(t,n),I.hasClass(e,t)||I.addClass(e,t)}))}function l(){function t(t,n){var r=new e(n);for(o=r.current();o;o=r.prev())if(o.childNodes.length>1||o==t||"BR"==o.tagName)return o}var n=r.selection.getRng(),i=n.startContainer,a=n.endContainer;if(i!=a&&0===n.endOffset){var s=t(i,a),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function d(e,t,n,r,i){var o=[],a=-1,s,l=-1,c=-1,d;return et(e.childNodes,function(e,t){return"UL"===e.nodeName||"OL"===e.nodeName?(a=t,s=e,!1):void 0}),et(e.childNodes,function(e,n){"SPAN"===e.nodeName&&"bookmark"==I.getAttrib(e,"data-mce-type")&&(e.id==t.id+"_start"?l=n:e.id==t.id+"_end"&&(c=n))}),0>=a||a>l&&c>a?(et(tt(e.childNodes),i),0):(d=I.clone(n,K),et(tt(e.childNodes),function(e,t){(a>l&&a>t||l>a&&t>a)&&(o.push(e),e.parentNode.removeChild(e))}),a>l?e.insertBefore(d,s):l>a&&e.insertBefore(d,s.nextSibling),r.push(d),et(o,function(e){d.appendChild(e)}),d)}function u(e,r,o){var l=[],c,u,f=!0;c=h.inline||h.block,u=I.create(c),s(u),W.walk(e,function(e){function p(e){var y,C,x,_,N;return N=f,y=e.nodeName.toLowerCase(),C=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&J(e)&&(N=f,f="true"===J(e),_=!0),w(y,"br")?(v=0,h.block&&I.remove(e),void 0):h.wrapper&&g(e,t,n)?(v=0,void 0):f&&!_&&h.block&&!h.wrapper&&i(y)&&z(C,c)?(e=I.rename(e,c),s(e),l.push(e),v=0,void 0):h.selector&&(et(m,function(t){"collapsed"in t&&t.collapsed!==b||I.is(e,t.selector)&&!a(e)&&(s(e,t),x=!0)}),!h.inline||x)?(v=0,void 0):(!f||_||!z(c,y)||!z(C,c)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||a(e)||h.inline&&V(e)?"li"==y&&r?v=d(e,r,u,l,p):(v=0,et(tt(e.childNodes),p),_&&(f=N),v=0):(v||(v=I.clone(u,K),e.parentNode.insertBefore(v,e),l.push(v)),v.appendChild(e)),void 0)}var v;et(e,p)}),h.wrap_links===!1&&et(l,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=I.clone(u,K),l.push(r),i=tt(e.childNodes),n=0;n1||!V(e))&&0===o)return I.remove(e,1),void 0;if(h.inline||h.wrapper){if(h.exact||1!==o||(e=i(e)),et(m,function(t){et(I.select(t.inline,e),function(e){var r;if(t.wrap_links===!1){r=e.parentNode;do if("A"===r.nodeName)return;while(r=r.parentNode)}R(t,n,e,t.exact?e:null)})}),g(e.parentNode,t,n))return I.remove(e,1),e=0,Y;h.merge_with_parents&&I.getParent(e.parentNode,function(r){return g(r,t,n)?(I.remove(e,1),e=0,Y):void 0}),e&&h.merge_siblings!==!1&&(e=M(B(e),e),e=M(e,B(e,Y)))}})}var m=c(t),h=m[0],v,y,b=!o&&F.isCollapsed();if(h)if(o)o.nodeType?(y=I.createRng(),y.setStartBefore(o),y.setEndAfter(o),u(T(y,m),null,!0)):u(o,null,!0);else if(b&&h.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length)L("apply",t,n);else{var C=r.selection.getNode();U||!m[0].defaultBlock||I.getParent(C,I.isBlock)||p(m[0].defaultBlock),r.selection.setRng(l()),v=F.getBookmark(),u(T(F.getRng(Y),m),v),h.styles&&(h.styles.color||h.styles.textDecoration)&&(nt(C,f,"childNodes"),f(C)),F.moveToBookmark(v),P(F.getRng(Y)),r.nodeChanged()}}function m(e,t,n){function i(e){var n,r,o,a,s;if(1===e.nodeType&&J(e)&&(a=b,b="true"===J(e),s=!0),n=tt(e.childNodes),b&&!s)for(r=0,o=p.length;o>r&&!R(p[r],t,e,e);r++);if(m.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function a(n){var r;return et(o(n.parentNode).reverse(),function(n){var i;r||"_start"==n.id||"_end"==n.id||(i=g(n,e,t),i&&i.split!==!1&&(r=n))}),r}function s(e,n,r,i){var o,a,s,l,c,d;if(e){for(d=e.parentNode,o=n.parentNode;o&&o!=d;o=o.parentNode){for(a=I.clone(o,K),c=0;c=0;a--){if(s=t[a].selector,!s||t[a].defaultBlock)return Y;for(i=r.length-1;i>=0;i--)if(I.is(r[i],s))return Y}return K}function C(e,t,n){var i;return G||(G={},i={},r.on("NodeChange",function(e){var t=o(e.element),n={};et(G,function(e,r){et(t,function(o){return g(o,r,{},e.similar)?(i[r]||(et(e,function(e){e(!0,{node:o,format:r,parents:t})}),i[r]=e),n[r]=e,!1):void 0})}),et(i,function(r,o){n[o]||(delete i[o],et(r,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),et(e.split(","),function(e){G[e]||(G[e]=[],G[e].similar=n),G[e].push(t)}),this}function x(e,t){return w(e,t.inline)?Y:w(e,t.block)?Y:t.selector?1==e.nodeType&&I.is(e,t.selector):void 0}function w(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function _(e,t){return N(I.getStyle(e,t),t)}function N(e,t){return("color"==t||"backgroundColor"==t)&&(e=I.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function E(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function k(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function S(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(t,n,a){function s(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==r.nodeType&&!k(r)&&(e?v>0:br?n:r,-1===n||a||n++):(n=o.indexOf(" ",t),r=o.indexOf("\xa0",t),n=-1!==n&&(-1===r||r>n)?n:r),n}var s,l,c,d;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};d=t}for(s=new e(t,I.getParent(t,V)||r.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(d=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(V(l))break;return d?(n=i?0:d.length,{container:d,offset:n}):void 0}function u(e,r){var i,a,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=o(e),a=0;ap?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(H(g.parentNode)||H(g))&&(g=H(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(H(y.parentNode)||H(y))&&(y=H(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(h=d(g,v,!0),h&&(g=h.container,v=h.offset),h=d(y,b),h&&(y=h.container,b=h.offset)),m=l(y,b),m.node)){for(;m.node&&0===m.offset&&m.node.previousSibling;)m=l(m.node.previousSibling);m.node&&m.offset>0&&3===m.node.nodeType&&" "===m.node.nodeValue.charAt(m.offset-1)&&m.offset>1&&(y=m.node,y.splitText(m.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=s(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=s())),n[0].selector&&n[0].expand!==K&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(V(g)||(g=s(!0)),V(y)||(y=s()))),1==g.nodeType&&(v=q(g),g=g.parentNode),1==y.nodeType&&(b=q(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function R(e,t,n,r){var i,o,a;if(!x(n,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,i){e=N(E(e,t),i),"number"==typeof i&&(i=e,r=0),(!r||w(_(r,i),e))&&I.setStyle(n,i,""),a=1}),a&&""===I.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),et(e.attributes,function(e,i){var o;if(e=E(e,t),"number"==typeof i&&(i=e,r=0),!r||w(I.getAttrib(r,i),e)){if("class"==i&&(e=I.getAttrib(n,i),e&&(o="",et(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return I.setAttrib(n,i,o),void 0;"class"==i&&n.removeAttribute("className"),$.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),et(e.classes,function(e){e=E(e,t),(!r||I.hasClass(r,e))&&I.removeClass(n,e)}),o=I.getAttribs(n),i=0;ia?a:o]),3===i.nodeType&&n&&o>=i.nodeValue.length&&(i=new e(i,r.getBody()).next()||i),3!==i.nodeType||n||0!==o||(i=new e(i,r.getBody()).prev()||i),i}function L(t,n,o){function a(e){var t=I.create("span",{id:y,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(r.getDoc().createTextNode(j)),t}function s(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==j||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function l(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function d(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function u(e,t){var n,r;if(e)r=F.getRng(!0),s(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=d(e),n.nodeValue.charAt(0)===j&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=l(F.getStart()),!e)for(;e=I.get(y);)u(e,!1)}function f(){var e,t,r,i,s,u,f;e=F.getRng(!0),i=e.startOffset,u=e.startContainer,f=u.nodeValue,t=l(F.getStart()),t&&(r=d(t)),f&&i>0&&i=0;p--)d.appendChild(I.clone(f[p],!1)),d=d.firstChild;d.appendChild(I.doc.createTextNode(j)),d=d.firstChild;var v=I.getParent(u,i);v&&I.isEmpty(v)?u.parentNode.replaceChild(h,u):I.insertAfter(h,u),F.setCursorLocation(d,1),I.isEmpty(u)&&I.remove(u)}}function v(){var e;e=l(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===y||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",b=r.settings.caret_debug;r._hasCaretEvents||(Z=function(){var e=[],t;if(s(l(F.getStart()),e))for(t=e.length;t--;)I.setAttrib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;u(),(8==t||37==t||39==t)&&u(l(F.getStart())),v()},r.on("SetContent",function(e){e.selection&&v()}),r._hasCaretEvents=!0),"apply"==t?f():h()}function P(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=q(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,I.getParent(n,I.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!k(a))return l=I.create("a",null,j),a.parentNode.insertBefore(l,a),t.setStart(a,0),F.setRng(t),I.remove(l),void 0}var O={},I=r.dom,F=r.selection,W=new t(I),z=r.schema.isValidChild,V=I.isBlock,U=r.settings.forced_root_block,q=I.nodeIndex,j="\ufeff",$=/^(src|href|style)$/,K=!1,Y=!0,G,X,J=I.getContentEditable,Q,Z,et=n.each,tt=n.grep,nt=n.walk,rt=n.extend;rt(this,{get:c,register:d,apply:p,remove:m,toggle:h,match:v,matchAll:y,matchNode:g,canApply:b,formatChanged:C}),s(),l(),r.on("BeforeGetContent",function(){Z&&Z()}),r.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(H,[h,f],function(e,t){var n=t.trim,r;return r=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function i(){return n(t.getContent({format:"raw",no_events:1}).replace(r,""))}function o(){a.typing=!1,a.add()}var a,s=0,l=[],c,d,u;return t.on("init",function(){a.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a.add()}),t.on("ObjectResizeStart",function(){a.beforeChange()}),t.on("SaveContent ObjectResized",o),t.dom.bind(t.dom.getRoot(),"dragend",o),t.dom.bind(t.getBody(),"focusout",function(){!t.removed&&a.typing&&o()}),t.on("KeyUp",function(n){var r=n.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||n.ctrlKey)&&(o(),t.nodeChanged()),(46==r||8==r||e.mac&&(91==r||93==r))&&t.nodeChanged(),d&&a.typing&&(t.isDirty()||(t.isNotDirty=!l[0]||i()==l[0].content,t.isNotDirty||t.fire("change",{level:l[0],lastLevel:null})),t.fire("TypingUndo"),d=!1,t.nodeChanged())}),t.on("KeyDown",function(e){var t=e.keyCode;return t>=33&&36>=t||t>=37&&40>=t||45==t?(a.typing&&o(),void 0):((16>t||t>20)&&224!=t&&91!=t&&!a.typing&&(a.beforeChange(),a.typing=!0,a.add(),d=!0),void 0)}),t.on("MouseDown",function(){a.typing&&o()}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||t.nodeChanged()}),a={data:l,typing:!1,beforeChange:function(){u||(c=t.selection.getBookmark(2,!0))},add:function(e){var n,r=t.settings,o;if(e=e||{},e.content=i(),u||t.fire("BeforeAddUndo",{level:e}).isDefaultPrevented())return null;if(o=l[s],o&&o.content==e.content)return null;if(l[s]&&(l[s].beforeBookmark=c),r.custom_undo_redo_levels&&l.length>r.custom_undo_redo_levels){for(n=0;n0&&(t.fire("change",a),t.isNotDirty=!1),e},undo:function(){var e;return a.typing&&(a.add(),a.typing=!1),s>0&&(e=l[--s],0===s&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return s0||a.typing&&l[0]&&i()!=l[0].content},hasRedo:function(){return sR)&&(l=i.create("br"),t.parentNode.insertBefore(l,t)),a.setStartBefore(t),a.setEndBefore(t)):(a.setStartAfter(t),a.setEndAfter(t)):(a.setStart(t,0),a.setEnd(t,0));o.setRng(a),i.remove(l),o.scrollIntoView(t)}function m(e){var t=k,r,o,s;if(r=e||"TABLE"==D?i.create(e||P):T.cloneNode(!1),s=r,a.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;o=t.cloneNode(!1),i.setAttrib(o,"id",""),r.hasChildNodes()?(o.appendChild(r.firstChild),r.appendChild(o)):(s=o,r.appendChild(o))}while(t=t.parentNode);return n||(s.innerHTML='
    '),r}function h(t){var n,r,i;if(3==k.nodeType&&(t?S>0:S0)return!0}function b(){var e,t,r;k&&3==k.nodeType&&S>=k.nodeValue.length&&(n||y()||(e=i.create("br"),_.insertNode(e),_.setStartAfter(e),_.setEndAfter(e),t=!0)),e=i.create("br"),_.insertNode(e),n&&"PRE"==D&&(!R||8>R)&&e.parentNode.insertBefore(i.doc.createTextNode("\r"),e),r=i.create("span",{}," "),e.parentNode.insertBefore(r,e),o.scrollIntoView(r),i.remove(r),t?(_.setStartBefore(e),_.setEndBefore(e)):(_.setStartAfter(e),_.setEndAfter(e)),o.setRng(_),s.add()}function C(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function x(e){var t=i.getRoot(),n,r;for(n=e;n!==t&&"false"!==i.getContentEditable(n);)"true"===i.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function w(e){var t;n||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(i.getStyle(t,"float",!0)))&&i.add(e,"br"))}var _=o.getRng(!0),N,E,k,S,T,R,A,B,H,M,D,L,P,O;if(!_.collapsed)return t.execCommand("Delete"),void 0;if(!r.isDefaultPrevented()&&(k=_.startContainer,S=_.startOffset,P=(a.force_p_newlines?"p":"")||a.forced_root_block,P=P?P.toUpperCase():"",R=i.doc.documentMode,A=r.shiftKey,1==k.nodeType&&k.hasChildNodes()&&(O=S>k.childNodes.length-1,k=k.childNodes[Math.min(S,k.childNodes.length-1)]||k,S=O&&3==k.nodeType?k.nodeValue.length:0),E=x(k))){if(s.beforeChange(),!i.isBlock(E)&&E!=i.getRoot())return(!P||A)&&b(),void 0;if((P&&!A||!P&&A)&&(k=g(k,S)),T=i.getParent(k,i.isBlock),M=T?i.getParent(T.parentNode,i.isBlock):null,D=T?T.nodeName.toUpperCase():"",L=M?M.nodeName.toUpperCase():"","LI"!=L||r.ctrlKey||(T=M,D=L),"LI"==D){if(!P&&A)return b(),void 0;if(i.isEmpty(T))return v(),void 0}if("PRE"==D&&a.br_in_pre!==!1){if(!A)return b(),void 0}else if(!P&&!A&&"LI"!=D||P&&A)return b(),void 0;P&&T===t.getBody()||(P=P||"P",h()?(B=/^(H[1-6]|PRE|FIGURE)$/.test(D)&&"HGROUP"!=L?m(P):m(),a.end_container_on_empty_block&&d(M)&&i.isEmpty(T)?B=i.split(M,T):i.insertAfter(B,T),p(B)):h(!0)?(B=T.parentNode.insertBefore(m(),T),u(B),p(T)):(N=_.cloneRange(),N.setEndAfter(T),H=N.extractContents(),C(H),B=H.firstChild,i.insertAfter(H,T),f(B),w(T),p(B)),i.setAttrib(B,"id",""),s.add())}}var i=t.dom,o=t.selection,a=t.settings,s=t.undoManager,l=t.schema,c=l.getNonEmptyElements();t.on("keydown",function(e){13==e.keyCode&&r(e)!==!1&&e.preventDefault()})}}),r(D,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,d,u,f,p,m,h=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,d=l.startOffset,u=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),d=-1*y.move("character",h),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",h)-d);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){m=t,t=t.nextSibling,r.remove(m);continue}p||(p=r.create(C),t.parentNode.insertBefore(p,t),g=!0),m=t,t=t.nextSibling,p.appendChild(m)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,d),l.setEnd(u,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",d),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(L,[N,h,f],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,d=n.ie,u=!0,f=!1;return function(n){function r(e,t,n){var r;return e=e.toLowerCase(),(r=_.exec[e])?(r(e,t,n),u):f}function p(e){var t;return e=e.toLowerCase(),(t=_.state[e])?t(e):-1}function m(e){var t;return e=e.toLowerCase(),(t=_.value[e])?t(e):f}function h(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){_[t][n]=e})})}function g(e,r,i){return r===t&&(r=f),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function v(e){return E.match(e)}function y(e,r){E.toggle(e,r?{value:r}:t),n.nodeChanged()}function b(e){k=w.getBookmark(e)}function C(){w.moveToBookmark(k)}var x=n.dom,w=n.selection,_={state:{},exec:{},value:{}},N=n.settings,E=n.formatter,k;o(this,{execCommand:r,queryCommandState:p,queryCommandValue:m,addCommands:h}),h({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(e){var t=n.getDoc(),r;try{g(e)}catch(i){r=u}(r||!t.queryCommandSupported(e))&&n.windowManager.alert("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.")},unlink:function(e){w.isCollapsed()&&w.select(w.getNode()),g(e),w.collapse(f)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&E.remove("align"+e)}),y("align"+t),r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;g(e),t=x.getParent(w.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(b(),x.split(n,t),C()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){y(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){y(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(N.font_size_style_values),r=l(N.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),y(e,n)},RemoveFormat:function(e){E.remove(e)},mceBlockQuote:function(){y("blockquote")},FormatBlock:function(e,t,n){return y(n||"p")},mceCleanup:function(){var e=w.getBookmark();n.setContent(n.getContent({cleanup:u}),{cleanup:u}),w.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||w.getNode();i!=n.getBody()&&(b(),n.dom.remove(i,u),C())},mceSelectNodeDepth:function(e,t,r){var i=0;x.getParent(w.getNode(),function(e){return 1==e.nodeType&&i++==r?(w.select(e),f):void 0},n.getBody())},mceSelectNode:function(e,t,n){w.select(n)},mceInsertContent:function(t,r,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=w.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}var a,s,l,c,u,f,p,m,h,g,v,y,b,C;/^ | $/.test(i)&&(i=o(i)),a=n.parser,s=new e({},n.schema),b='',f={content:i,format:"html",selection:!0},n.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,b),w.isCollapsed()||n.getDoc().execCommand("Delete",!1,null),l=w.getNode();var _={context:l.nodeName.toLowerCase()};if(u=a.parse(i,_),v=u.lastChild,"mce_marker"==v.attr("id"))for(p=v,v=v.prev;v;v=v.walk(!0))if(3==v.type||!x.isBlock(v.name)){v.parent.insert(p,v,"br"===v.name);break}if(_.invalid){for(w.setContent(b),l=w.getNode(),c=n.getBody(),9==l.nodeType?l=v=c:v=l;v!==c;)l=v,v=v.parentNode;i=l==c?c.innerHTML:x.getOuterHTML(l),i=s.serialize(a.parse(i.replace(//i,function(){return s.serialize(u)}))),l==c?x.setHTML(c,i):x.setOuterHTML(l,i)}else i=s.serialize(u),v=l.firstChild,y=l.lastChild,!v||v===y&&"BR"===v.nodeName?x.setHTML(l,i):w.setContent(i);p=x.get("mce_marker"),m=x.getRect(p),h=x.getViewPort(n.getWin()),(m.y+m.h>h.y+h.h||m.yh.x+h.w||m.x") +},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,w.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=x.getParent(w.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||E.remove("link"),n.href&&E.apply("link",n,r)},selectAll:function(){var e=x.getRoot(),t=x.createRng();w.getRng().setStart?(t.setStart(e,0),t.setEnd(e,e.childNodes.length),w.setRng(t)):g("SelectAll")},mceNewDocument:function(){n.setContent("")}}),h({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=w.isCollapsed()?[x.getParent(w.getNode(),x.isBlock)]:w.getSelectedBlocks(),r=a(n,function(e){return!!E.matchNode(e,t)});return-1!==s(r,u)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return v(e)},mceBlockQuote:function(){return v("blockquote")},Outdent:function(){var e;if(N.inline_styles){if((e=x.getParent(w.getStart(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return u;if((e=x.getParent(w.getEnd(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return u}return p("InsertUnorderedList")||p("InsertOrderedList")||!N.inline_styles&&!!x.getParent(w.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=x.getParent(w.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),h({"FontSize,FontName":function(e){var t=0,n;return(n=x.getParent(w.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),h({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(P,[f],function(e){function t(e,i){var o=this,a,s;return e=r(e),i=o.settings=i||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?(o.source=e,void 0):(0===e.indexOf("/")&&0!==e.indexOf("//")&&(e=(i.base_uri?i.base_uri.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(s=i.base_uri?i.base_uri.path:new t(location.href).directory,e=(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+o.toAbsPath(s,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),a=i.base_uri,a&&(o.protocol||(o.protocol=a.protocol),o.userInfo||(o.userInfo=a.userInfo),o.port||"mce_host"!==o.host||(o.port=a.port),o.host&&"mce_host"!==o.host||(o.host=a.host),o.source=""),void 0)}var n=e.each,r=e.trim;return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?n:0)},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(n.protocol&&(t+=n.protocol+"://"),n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(O,[f],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r;if(!o&&(r=this,r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,d,u,f;o=!0,d=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(u in e)f=e[u],d[u]="function"==typeof f&&c[u]?s(u,f):f;return t.prototype=d,t.constructor=t,t.extend=i,t},t}),r(I,[O,f],function(e,t){function n(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var r=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,i=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,o=/^\s*|\s*$/g,a,s=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function n(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=d(e[1],[]),function(e){return!u(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?0===n%2:"odd"===e?1===n%2:t[e]?t[e]():!1})):void 0}function c(e,i,c){function d(e){e&&i.push(e)}var u;return u=r.exec(e.replace(o,"")),d(t(u[1])),d(n(u[2])),d(a(u[3])),d(s(u[4],u[5],u[6])),d(l(u[7])),i.psuedo=!!u[7],i.direct=c,i}function d(e,t){var n=[],r,o,a;do if(i.exec(""),o=i.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){r=o[3];break}while(o);for(r&&d(r,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var u=this.match;this._selectors=d(e,[])},match:function(e,n){var r,i,o,a,s,l,c,d,u,f,p,m,h;for(n=n||this._selectors,r=0,i=n.length;i>r;r++){for(s=n[r],a=s.length,h=e,m=0,o=a-1;o>=0;o--)for(d=s[o];h;){for(d.psuedo&&(p=h.parent().items(),u=t.inArray(h,p),f=p.length),l=0,c=d.length;c>l;l++)if(!d[l](h,u,f)){l=c+1;break}if(l===c){m++;break}if(o===a-1)break;h=h.parent()}if(m===a)return!0}return!1},find:function(e){function t(e,n,i){var o,a,s,l,c,d=n[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=d.length;l>s;s++)if(!d[s](c,o,a)){s=l+1;break}if(s===l)i==n.length-1?r.push(c):c.items&&t(c.items(),n,i+1);else if(d.direct)return;c.items&&t(c.items(),n,i)}}var r=[],i,o,l=this._selectors;if(e.items){for(i=0,o=l.length;o>i;i++)t(e.items(),l[i],0);o>1&&(r=n(r))}return a||(a=s.Collection),new a(r)}});return s}),r(F,[f,I,O],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(W,[f,g],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){return t.DOM.getSize(e)},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(z,[O,f,F,W],function(e,t,n,r){var i=t.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),o={},a="onmousewheel"in document,s=!1,l=e.extend({Statics:{controlIdLookup:{}},classPrefix:"mce-",init:function(e){var n=this,i,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=r.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},i=e.classes)for(i=i.split(" "),i.map={},o=i.length;o--;)i.map[i[o]]=!0;n._classes=i||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t;e&&!(t=l.controlIdLookup[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseInt(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,r,i=e.getEl(),o,a,s,l,c,d,u;n=e._borderBox=e._borderBox||e.measureBox(i,"border"),e._paddingBox=e._paddingBox||e.measureBox(i,"padding"),e._marginBox=e._marginBox||e.measureBox(i,"margin"),d=t.minWidth,u=t.minHeight,s=d||i.offsetWidth,l=u||i.offsetHeight,o=t.width,a=t.height,c=t.autoResize,c="undefined"!=typeof c?c:!o&&!a,o=o||s,a=a||l;var f=n.left+n.right,p=n.top+n.bottom,m=t.maxWidth||65535,h=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:o,h:a,deltaW:f,deltaH:p,contentW:o-f,contentH:a-p,innerW:o-f,innerH:a-p,startMinWidth:d||0,startMinHeight:u||0,minW:Math.min(s,m),minH:Math.min(l,h),maxW:m,maxH:h,autoResize:c,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,c;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=in.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(c=l.repaintControls,c&&c.map&&!c.map[t._id]&&(c.push(t),c.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s;t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=r.x+"px",s.x=r.x),r.y!==s.y&&(t.top=r.y+"px",s.y=r.y),r.w!==s.w&&(t.width=r.w-o+"px",s.w=r.w),r.h!==s.h&&(t.height=r.h-a+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=r.innerW+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=r.innerH+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return function(i){return t||r.parents().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this,o,a,s,l;if(t)for("string"==typeof t&&(t=n(t)),s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=r._bindings,o||(o=r._bindings={}),a=o[e],a||(a=o[e]=[]),a.push(t),i[e]&&(r._nativeEvents?r._nativeEvents[e]=!0:r._nativeEvents={name:!0},r._rendered&&r.bindPendingEvents());return r},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},parents:function(e){var t=this,r=new n;for(t=t.parent();t;t=t.parent())r.add(t);return e&&(r=r.filter(e)),r},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return r.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,i=e?this._id+"-"+e:this._id;return n=o[i]=(t===!0?null:o[i])||r.get(i)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl();return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&("label"==e&&r.setAttribute("aria-labeledby",n._id),r.setAttribute("role"==e?e:"aria-"+e,t)),n)},encode:function(e,t){return t!==!1&&l.translate&&(e=l.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,a;if(e.items){var s=e.items().toArray();for(a=s.length;a--;)s[a].remove()}if(n&&n.items&&(i=[],n.items().each(function(t){t!==e&&i.push(t)}),n.items().set(i),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&r.off(t),delete l.controlIdLookup[e._id],delete o[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(a=c.length;a--;)delete o[c[a].id];t.parentNode.removeChild(t)}return e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(r.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,i,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||r.css(e.getEl(),"display","none"),e.settings.border&&(i=e.borderBox(),r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.right,"border-bottom-width":i.bottom,"border-left-width":i.left})),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,d=t(n,r);return i=d.x,o=d.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=u._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),u._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=u._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(u._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;il;l++)u=d[l]._eventsRoot;for(u||(u=d[d.length-1]||o),o._eventsRoot=u,c=l,l=0;c>l;l++)d[l]._eventsRoot=u;for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?u._hasMouseEnter||(r.on(u.getEl(),"mouseleave",t),r.on(u.getEl(),"mouseover",n),u._hasMouseEnter=1):u[p]||(r.on(u.getEl(),p,e),u[p]=!0),f[p]=!1):a?r.on(o.getEl(),"mousewheel",i):r.on(o.getEl(),"DOMMouseScroll",i)}}},reflow:function(){return this.repaint(),this}});return window.elementIdCache=o,l}),r(V,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(U,[z,F,I,V,f,W],function(e,t,n,r,i,o){var a={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var n=this;n._super(e),e=n.settings,n._fixed=e.fixed,n._items=new t,n.addClass("container"),n.addClass("container-body","body"),e.containerCls&&n.addClass(e.containerCls),n._layout=r.create((e.layout||n.layout)+"layout"),n.settings.items&&n.add(n.settings.items),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=a[e]=a[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(){var e=this;return e.keyNav?e.keyNav.focusFirst():e._super(),e},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,o,a=[];return i.isArray(t)||(t=[t]),i.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),o=i.extend({},n.settings.defaults,t),t.type=o.type=o.type||t.type||n.settings.defaultType||(o.defaults?o.defaults.type:null),t=r.create(o)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=o.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t'+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&o.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),o.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t,n;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},n=this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(q,[W],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,d,u,f;r=r||{},l=function(n){var l=t(),p,m;n.preventDefault(),s=n.button,p=i(),u=n.screenX,f=n.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:m}),a.body.appendChild(o),e.on(a,"mousemove",d),e.on(a,"mouseup",c),r.start(n)},d=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-u,e.deltaY=e.screenY-f,e.preventDefault(),r.drag(e),void 0)},c=function(t){e.off(a,"mousemove",d),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(j,[W,q],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,d){var u,f,p,m,h,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return e.css(f,"display","none"),void 0;e.css(f,"display","block"),u=i.getEl("body"),p=i.getEl("scroll"+t+"t"),m=u["client"+s]-2*o,m-=n&&r?f["client"+d]:0,h=u["scroll"+s],g=m/h,v={},v[y]=u["offset"+a]+o,v[b]=m,e.css(f,v),v={},v[y]=u["scroll"+a]*g,v[b]=m*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,d=i._id+"-scroll"+n,u=i.classPrefix;i.getEl().appendChild(e.createFragment('
    '+'
    '+"
    ")),i.draghelper=new t(d+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(d),u+"active")},drag:function(e){var t,d,u,f,p=i.layoutRect();d=p.contentW>p.innerW,u=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=d&&u?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(d),u+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r($,[U,j],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(K,[W],function(e){function t(t,n,r){var i,o,a,s,l,c,d,u,f;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),l=i.offsetWidth,c=i.offsetHeight,d=n.offsetWidth,u=n.offsetHeight,r=(r||"").split(""),"b"===r[0]&&(s+=u),"r"===r[1]&&(a+=d),"c"===r[0]&&(s+=Math.round(u/2)),"c"===r[1]&&(a+=Math.round(d/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Y,[W],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(G,[$,K,Y,W],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1)}var o,a,s=[],l=[],c,d=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=d.zIndex||65535,n;if(l.length)for(e=0;en&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY'),n=n.firstChild,u.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(u.getEl(),i+"in")},0),c=!0),l.push(u),t()}}),u.on("close hide",function(e){if(e.control==u){for(var n=l.length;n--;)l[n]===u&&l.splice(n,1);t()}}),u.on("show",function(){u.parents().each(function(e){return e._fixed?(u.fixed(!0),!1):void 0})}),e.popover&&(u._preBodyHtml='
    ',u.addClass("popover").addClass("bottom").addClass("start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y +}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){d.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()}});return d.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t.settings.autohide&&(t.fire("cancel",{},!1),t.hide(),s.splice(e,1))}},d}),r(X,[W],function(e){return function(t){function n(){if(!m)if(m=[],u.find)u.find("*").each(function(e){e.canFocus&&m.push(e.getEl())});else for(var e=u.getEl().getElementsByTagName("*"),t=0;ti?i=l.length-1:i>=l.length&&(i=0),o=l[i],o.focus(),h=o.id,t.actOnFocus&&s()}function d(){var e,r;for(r=i(t.root.getEl()),n(),e=m.length;e--;)if("toolbar"==r&&m[e].id===h)return m[e].focus(),void 0;m[0].focus()}var u=t.root,f=t.enableUpDown!==!1,p=t.enableLeftRight!==!1,m=t.items,h;return u.on("keydown",function(e){var n=37,r=39,d=38,u=40,m=27,h=14,g=13,v=32,y=9,b;switch(e.keyCode){case n:p&&(t.leftAction?t.leftAction():c(-1),b=!0);break;case r:p&&("menuitem"==i()&&"menu"==o()?a("haspopup")&&s():c(1),b=!0);break;case d:f&&(c(-1),b=!0);break;case u:f&&("menuitem"==i()&&"menubar"==o()?s():"button"==i()&&a("haspopup")?s():c(1),b=!0);break;case y:b=!0,e.shiftKey?c(-1):c(1);break;case m:b=!0,l();break;case h:case g:case v:b=s()}b&&(e.stopPropagation(),e.preventDefault())}),u.on("focusin",function(e){n(),h=e.target.id}),{moveFocus:c,focusFirst:d,cancel:l}}}),r(J,[G,$,W,X,q],function(e,t,n,r,i){var o=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(e.layoutRect({w:i}),o=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(e.layoutRect({w:i}),o=!0)),o&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;e.settings.title&&!e._fullscreen&&(i=e.getEl("head"),t.headerW=i.offsetWidth,t.headerH=i.offsetHeight,r+=t.headerH),e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var o=n.getWindowSize();return t.x=Math.max(0,o.w/2-t.w/2),t.y=Math.max(0,o.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+'
    '+e.encode(i.title)+"
    "+''+'
    '+"
    "),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t=[],n,o,a;setTimeout(function(){e.addClass("in")},0),e.keyboardNavigation=new r({root:e,enableLeftRight:!1,enableUpDown:!1,items:t,onCancel:function(){e.close()}}),e.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,"filepicker"==e.type?(t.push(e.getEl("inp")),e.getEl("open")&&t.push(e.getEl("open").firstChild)):t.push(e.getEl()))}),e.statusbar&&e.statusbar.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,t.push(e.getEl()))}),e._super(),e.statusbar&&e.statusbar.postRender(),!o&&n&&n.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){a={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(t){e.moveTo(a.x+t.deltaX,a.y+t.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){var e=this.getParentCtrl(document.activeElement);return e&&e.blur(),this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove()}});return o}),r(Q,[J],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Z,[J,Q],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit(),i.close()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,n,r){t.alert(e,function(){n.call(r||this)})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(et,[S,A,b,m,h,f],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function d(){function t(e){function t(){if(3==l.nodeType){if(e&&c==l.length)return!0;if(!e&&0===c)return!0}}var n,r,i,s,l,c,d;n=z.getRng();var u=[n.startContainer,n.startOffset,n.endContainer,n.endOffset];if(n.collapsed||(e=!0),l=n[(e?"start":"end")+"Container"],c=n[(e?"start":"end")+"Offset"],3==l.nodeType&&(r=W.getParent(n.startContainer,W.isBlock),e&&(r=W.getNext(r,W.isBlock)),!r||!t()&&n.collapsed||(i=W.create("em",{id:"__mceDel"}),O(o.grep(r.childNodes),function(e){i.appendChild(e)}),r.appendChild(i))),n=W.createRng(),n.setStart(u[0],u[1]),n.setEnd(u[2],u[3]),z.setRng(n),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),i){for(s=z.getBookmark();d=W.get("__mceDel");)W.remove(d,!0);z.moveToBookmark(s)}}a.on("keydown",function(n){var r;r=n.keyCode==F,c(n)||!r&&n.keyCode!=I||e.modifierPressed(n)||(n.preventDefault(),t(r))}),a.addCommand("Delete",function(){t()})}function u(){function e(e){var t=W.create("body"),n=e.cloneContents();return t.appendChild(n),z.serializer.serialize(t,{format:"html"})}function t(t){var n=e(t),r=W.createRng();r.selectNode(a.getBody());var i=e(r);return n===i}a.on("keydown",function(e){var n=e.keyCode,r;if(!c(e)&&(n==F||n==I)){if(r=a.selection.isCollapsed(),r&&!W.isEmpty(a.getBody()))return;if($&&!r)return;if(!r&&!t(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),a.selection.setCursorLocation(a.getBody(),0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(W.bind(a.getDoc(),"focusin",function(){z.setRng(z.getRng())}),W.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getWin().focus(),z.setRng(z.getRng()))}))}function m(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&z.isCollapsed()&&0===z.getRng(!0).startOffset){var t=z.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return W.remove(t),e.preventDefault(),void 0;n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(W.remove(n),e.preventDefault())}})}function h(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&z.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&W.hasClass(e,"mce-item-anchor")&&z.select(e),a.nodeChanged()})}function v(){function e(){var e=W.getAttribs(z.getStart().cloneNode(!1));return function(){var t=z.getStart();t!==a.getBody()&&(W.setAttrib(t,"style",null),O(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!z.isCollapsed()&&W.getParent(z.getStart(),W.isBlock)!=W.getParent(z.getEnd(),W.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),W.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){var n=z.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&z.isCollapsed()&&0===z.getRng(!0).startOffset){var t=z.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),W.addClass(a.getBody(),"mceHideBrInPre"),U.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),q.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){W.bind(a.getBody(),"mouseup",function(){var e,t=z.getNode();"IMG"==t.nodeName&&((e=W.getStyle(t,"width"))&&(W.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),W.setStyle(t,"width","")),(e=W.getStyle(t,"height"))&&(W.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),W.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s,l,d,u;if(n=t.keyCode==F,!c(t)&&(n||t.keyCode==I)&&!e.modifierPressed(t)&&(r=z.getRng(),i=r.startContainer,o=r.startOffset,d=r.collapsed,3==i.nodeType&&i.nodeValue.length>0&&(0===o&&!d||d&&o===(n?0:1)))){if(l=i.previousSibling,l&&"IMG"==l.nodeName)return;u=a.schema.getNonEmptyElements(),t.preventDefault(),s=W.create("br",{id:"__tmp"}),i.parentNode.insertBefore(s,i),a.getDoc().execCommand(n?"ForwardDelete":"Delete",!1,null),i=z.getRng().startContainer,l=i.previousSibling,l&&1==l.nodeType&&!W.isBlock(l)&&W.isEmpty(l)&&!u[l.nodeName.toLowerCase()]&&W.remove(l),W.remove("__tmp")}})}function N(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=z.getRng(),r=n.startContainer,i=n.startOffset,o=W.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=W.createRng(),n.setStart(r,0),n.setEnd(r,0),z.setRng(n))}})}function E(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),V.object_resizing||s("enableObjectResizing",!1)}V.readonly||a.on("BeforeExecCommand MouseDown",e)}function k(){function e(){O(W.select("a"),function(e){var t=e.parentNode,n=W.getRoot();if(t.lastChild===e){for(;t&&!W.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}W.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function S(){V.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",V.forced_root_block)})}function T(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function R(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=I||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),W.remove(t.item(0)),a.undoManager.add()))})}function A(){var e;l()>=10&&(e="",O("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function B(){l()<9&&(U.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),q.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function H(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),W.unbind(r,"mouseup",n),W.unbind(r,"mousemove",t),a=o=0}var r=W.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,W.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(W.bind(r,"mouseup",n),W.bind(r,"mousemove",t),W.win.focus(),a.select())}})}function M(){a.on("keyup focusin",function(t){65==t.keyCode&&e.metaKeyPressed(t)||z.normalize()})}function D(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function L(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function P(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.execCommand("SelectAll"),a.selection.collapse(!0))}))}var O=o.each,I=e.BACKSPACE,F=e.DELETE,W=a.dom,z=a.selection,V=a.settings,U=a.parser,q=a.serializer,j=i.gecko,$=i.ie,K=i.webkit;C(),N(),u(),M(),K&&(_(),d(),p(),g(),S(),i.iOS?(y(),L()):f()),$&&i.ie<11&&(m(),b(),x(),w(),R(),A(),B(),H()),i.ie>=11&&P(),j&&(m(),h(),v(),E(),k(),T(),D())}}),r(tt,[f],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,d,u;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=d=s[l],!i.isImmediatePropagationStopped());l++)if(d.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(u=a.parent();u&&!i.isPropagationStopped();)u.fire(e,i,!1),u=u.parent();return i},on:function(e,t){var n=this,o,a,s,l;if(t===!1&&(t=function(){return!1}),t)for(s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=n[r],o||(o=n[r]={}),a=o[e],a||(a=o[e]=[],n.bindNative&&i[e]&&n.bindNative(e)),a.push(t);return n},off:function(e,t){var n=this,o,a=n[r],s,l,c,d;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(d=s.length;d--;)s[d]===t&&s.splice(d,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n}}}),r(nt,[f,h],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.ctrlKey||e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var d;return d=l,"string"==typeof l?l=function(){o.execCommand(d,!1,null)}:e.isArray(d)&&(l=function(){o.execCommand(d[0],d[1],d[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(rt,[g,y,b,E,N,R,B,H,M,D,L,P,v,d,Z,C,w,et,h,f,tt,nt],function(e,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t||"drop"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,i.execCallback("setup",i),r.fire("SetupEditor",i)}var E=e.DOM,k=n.ThemeManager,S=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,H=C.trim,M=C.resolve,D=m.Event,L=b.gecko,P=b.ie,O=b.opera;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!k.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",k.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){S.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=H(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!D.domLoaded)return E.bind(window,"ready",e),void 0;if(n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new h(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=H(n),r&&-1===B(m,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,d,u,f,p,m=[];if(t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),l=k.get(n.theme),t.theme=new l(t,k.urls[n.theme]),t.theme.init&&t.theme.init(t,k.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),t.fire("BeforeRenderUI"),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,f=/^[0-9\.]+(|px)$/i,f.test(""+i)&&(i=Math.max(parseInt(i,10)+(l.deltaWidth||0),100)),f.test(""+o)&&(o=Math.max(parseInt(o,10)+(l.deltaHeight||0),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(document.domain&&location.hostname!=document.domain&&(t.editorManager.relaxedDomain=document.domain),t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',p=0;p',t.loadedCSS[h]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),u=n.body_class||"",-1!=u.indexOf("=")&&(u=t.getParam("body_class","","hash"),u=u[t.id]||""),t.iframeHTML+='
    ",t.editorManager.relaxedDomain&&(P||O&&parseFloat(window.opera.version())<11)&&(c='javascript:(function(){document.open();document.domain="'+document.domain+'";'+'var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);'+"document.close();ed.initContentBody();})()"),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:c||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}}),t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),t.editorManager.relaxedDomain&&c||t.initContentBody(),r=s=l=null},initContentBody:function(){var t=this,n=t.settings,o=E.get(t.id),f=t.getDoc(),p,m;n.inline||(t.getElement().style.visibility=t.orgVisibility),P&&t.editorManager.relaxedDomain||n.content_editable||(f.open(),f.write(t.iframeHTML),f.close(),t.editorManager.relaxedDomain&&(f.domain=t.editorManager.relaxedDomain)),n.content_editable&&(t.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"tabIndex",null),E.setAttrib(e,"contentEditable",null)}),E.addClass(o,"mce-content-body"),o.tabIndex=-1,t.contentDocument=f=n.content_document||document,t.contentWindow=n.content_window||window,t.bodyElement=o,n.content_document=n.content_window=null,n.root_name=o.nodeName.toLowerCase()),p=t.getBody(),p.disabled=!0,n.readonly||(p.contentEditable=t.getParam("content_editable_state",!0)),p.disabled=!1,t.schema=new g(n),t.dom=new e(f,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,class_filter:n.class_filter,update_styles:!0,root_element:n.content_editable?t.id:null,collect:n.content_editable,schema:t.schema,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=new v(n,t.schema),t.parser.addAttributeFilter("src,href,style",function(e,n){for(var r=e.length,i,o=t.dom,a,s;r--;)i=e[r],a=i.attr(n),s="data-mce-"+n,i.attributes.map[s]||("style"===n?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,t.convertURL(a,n,i.name)))}),t.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),t.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),t.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var n=e.length,i,o=t.schema.getNonEmptyElements();n--;)i=e[n],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),t.serializer=new i(n,t),t.selection=new a(t.dom,t.getWin(),t.serializer,t),t.formatter=new s(t),t.undoManager=new l(t),t.forceBlocks=new d(t),t.enterKey=new c(t),t.editorCommands=new u(t),t.fire("PreInit"),n.browser_spellcheck||n.gecko_spellcheck||(f.body.spellcheck=!1,E.setAttrib(p,"spellcheck","false")),t.fire("PostRender"),t.quirks=y(t),n.directionality&&(p.dir=n.directionality),n.nowrap&&(p.style.whiteSpace="nowrap"),n.protect&&t.on("BeforeSetContent",function(e){R(n.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),n.padd_empty_editor&&t.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.initialized=!0,R(t._pendingNativeEvents,function(e){t.dom.bind(_(t,e),e,function(e){t.fire(e.type,e)})}),t.fire("init"),t.focus(!0),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),t.contentStyles.length>0&&(m="",R(t.contentStyles,function(e){m+=e+"\r\n"}),t.dom.addStyle(m)),R(t.contentCSS,function(e){t.loadedCSS[e]||(t.dom.loadCSS(e),t.loadedCSS[e]=!0)}),n.auto_focus&&setTimeout(function(){var e=t.editorManager.get(n.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),o=f=p=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(L||i)&&(l=n.getBody(),l.setActive?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?M(r):0,n=M(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1)) +},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),i[H(e[0])]=e.length>1?H(e[1]):H(e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;e.initialized&&!e.settings.disable_nodechange&&(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:(r.push(e),void 0)}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),i.fire("ExecCommand",{command:e,ui:t,value:n}),void 0))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(n.innerHTML=r,(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?e=P&&11>P?"<"+i+">":"<"+i+'>
    ":P||(e='
    '),r.innerHTML=e,n.fire("SetContent",t)):("raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=H(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.initial||(n.selection.select(r,!0),n.selection.collapse(!0)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?H(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)),void 0;case"A":return i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o="mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))),void 0}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this,t=e.getContainer(),n=e.getDoc();e.removed||(e.removed=1,P&&n&&n.execCommand("SelectAll"),e.save(),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(D.unbind(e.getWin()),D.unbind(e.getDoc())),D.unbind(e.getBody()),D.unbind(t),e.fire("remove"),e.editorManager.remove(e),E.remove(t),e.destroy())},bindNative:function(e){var t=this;t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e]},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;t.destroyed||(e&&L&&(D.unbind(t.getDoc()),D.unbind(t.getWin()),D.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1)},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return L?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(it,[],function(){var e={};return{add:function(t,n){for(var r in n)e[r]=n[r]},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(ot,[g,h],function(e,t){function n(r){function i(){try{return document.activeElement}catch(e){return document.body}}function o(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function a(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function s(s){function l(t){return!!e.DOM.getParent(t,n.isEditorUIElement)}var c=s.editor,d,u;c.on("init",function(){"onbeforedeactivate"in document&&t.ie<11?c.dom.bind(c.getBody(),"beforedeactivate",function(){var e=c.getDoc().selection;try{d=e&&e.createRange?e.createRange():c.selection.getRng()}catch(t){}}):(c.inline||t.ie>10)&&(c.on("nodechange keyup",function(){var e,t=document.activeElement;for(t&&t.id==c.id+"_ifr"&&(t=c.getBody());t;){if(t==c.getBody()){e=!0;break}t=t.parentNode}e&&(d=c.selection.getRng())}),t.webkit&&(u=function(){var e=c.selection.getRng();e.collapsed||(d=e)},e.DOM.bind(document,"selectionchange",u),c.on("remove",function(){e.DOM.unbind(document,"selectionchange",u)})))}),c.on("mousedown",function(){c.selection.lastFocusBookmark=null}),c.on("focusin",function(){var e=r.focusedEditor;c.selection.lastFocusBookmark&&(c.selection.setRng(a(c,c.selection.lastFocusBookmark)),c.selection.lastFocusBookmark=null),e!=c&&(e&&e.fire("blur",{focusedEditor:c}),r.activeEditor=c,c.fire("focus",{blurredEditor:e}),c.focus(!1),r.focusedEditor=c)}),c.on("focusout",function(){c.selection.lastFocusBookmark=o(d),window.setTimeout(function(){var e=r.focusedEditor;e!=c&&(c.selection.lastFocusBookmark=null),l(i())||e!=c||(c.fire("blur",{focusedEditor:null}),r.focusedEditor=null,c.selection.lastFocusBookmark=null)},0)})}r.on("AddEditor",s)}return n.isEditorUIElement=function(e){return-1!==e.className.indexOf("mce-")},n}),r(at,[rt,g,P,h,f,tt,it,ot],function(e,n,r,i,o,a,s,l){var c=n.DOM,d=o.explode,u=o.each,f=o.extend,p=0,m,h={majorVersion:"4",minorVersion:"0.6",releaseDate:"2013-09-12",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s0&&u(d(m),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):u(document.forms,function(r){u(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":u(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(m=h=0,u(s,function(e){h++,e.initialized?m++:e.on("init",function(){m++,m==h&&r(t,"oninit")}),m==h&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),m||(m=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",m)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,u(c.select(e),function(e){t.remove(r[e.id])}),void 0;if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){u(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(h,a),h.setup(),window.tinymce=window.tinyMCE=h,h}),r(st,[at,f],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(lt,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(ct,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(dt,[ct,lt,f],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ut,[g],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ft,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?d+e:i.indexOf(",",d),-1===r||r>i.length?null:(n=i.substring(d,r),d=r+1,n)}var r,i,s,d=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do r=n(parseInt(n(),32)||0),null!==r&&(s=n(parseInt(n(),32)||0),a[r]=s);while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n),o.save(l),e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(d){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(pt,[g,d,v,y,f,h],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(mt,[O,f],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(ht,[mt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(gt,[z,K],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(vt,[z,gt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&t.on("mouseenter mouseleave",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t&&"mouseenter"==n.type){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.aria("label",e.tooltip)},tooltip:function(){var e=this;return n||(n=new t({type:"tooltip"}),n.renderTo(e.getContainerElm())),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&setTimeout(function(){e.focus()},0)},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(yt,[vt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    '+'"+"
    "}})}),r(bt,[U],function(e){return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
    '+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "+"
    "}})}),r(Ct,[vt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+''+''+e.encode(e._text)+""+"
    "}})}),r(xt,[yt,G],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;n.panel.popover=!0,n.panel.autohide=!0,e.active(!0),e.panel?e.panel.show():(e.panel=new t(n.panel).on("hide",function(){e.active(!1)}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()),e.panel.moveRel(e.getEl(),n.popoverAlign||"bc-tc")},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():e.showPanel())}),e._super()}})}),r(wt,[xt,g],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '+'"+'"+"
    "},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(_t,[vt,W],function(e,t){return e.extend({init:function(e){var n=this;n._super(e),n.addClass("combobox"),n.on("click",function(e){for(var t=e.target;t;)t.id&&-1!=t.id.indexOf("-open")&&n.fire("action"),t=t.parentNode}),n.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&n.parents().reverse().each(function(t){return e.preventDefault(),n.fire("change"),t.submit?(t.submit(),!1):void 0})}),e.placeholder&&(n.addClass("placeholder"),n.on("focusin",function(){n._hasOnChange||(t.on(n.getEl("inp"),"change",function(){n.fire("change")}),n._hasOnChange=!0),n.hasClass("placeholder")&&(n.getEl("inp").value="",n.removeClass("placeholder"))}),n.on("focusout",function(){0===n.value().length&&(n.getEl("inp").value=e.placeholder,n.addClass("placeholder"))}))},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;t._super(e),t._rendered&&(t.getEl("inp").disabled=e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,n=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-r.offsetWidth-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),t.css(n.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return t.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){t.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="";return o=n.icon?r+"ico "+r+"i-"+n.icon:"",a=e._text,(o||a)&&(s='
    '+'"+"
    ",e.addClass("has-open")),'
    '+''+s+"
    "}})}),r(Nt,[z,X],function(e,t){return e.extend({Defaults:{delimiter:"\xbb"},init:function(e){var t=this;t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.keyNav=new t({root:e,enableLeftRight:!0}),e.keyNav.focusFirst(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
    '+e._getPathHtml()+"
    "},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
    '+t[n].name+"
    ";return i||(i='
     
    '),i}})}),r(Et,[Nt,at],function(e,t){return e.extend({postRender:function(){function e(e){return 1===e.nodeType&&("BR"==e.nodeName||!!e.getAttribute("data-mce-bogus"))}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(kt,[U],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "+"
    "}})}),r(St,[U,kt],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:i,flex:0,forId:n._id}]}),r.type="formitem","undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){var e=this.getParentCtrl(document.activeElement);return e&&e.blur(),this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Tt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "+"
    "}})}),r(Rt,[_t],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Bt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v=[],y,b,C,x,w,_,N,E,k,S,T,R,A,B,H,M,D,L,P,O,I,F,W,z,V=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=a.direction,s=a.align,l=a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",N="h",E="minH",S="maxH",R="innerH",T="top",A="bottom",B="deltaH",H="contentH",I="left",L="w",M="x",D="innerW",P="minW",O="maxW",F="right",W="deltaW",z="contentW"):(k="x",N="w",E="minW",S="maxW",R="innerW",T="left",A="right",B="deltaW",H="contentW",I="top",L="h",M="y",D="innerH",P="minH",O="maxH",F="bottom",W="deltaH",z="contentH"),u=i[R]-o[T]-o[T],_=d=0,t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),h=p.settings,g=h.flex,u-=n-1>t?c:0,g>0&&(d+=g,m[S]&&v.push(p),m.flex=g),u-=m[E],y=o[I]+m[P]+o[F],y>_&&(_=y);if(x={},x[E]=0>u?i[E]-u+i[B]:i[R]-u+i[B],x[P]=_+i[W],x[H]=i[R]-u,x[z]=_,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=V(x.minW,i.startMinWidth),x.minH=V(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=u/d,t=0,n=v.length;n>t;t++)p=v[t],m=p.layoutRect(),b=m[S],y=m[E]+Math.ceil(m.flex*C),y>b?(u-=m[S]-m[E],d-=m.flex,m.flex=0,m.maxFlexSize=b):m.maxFlexSize=0;for(C=u/d,w=o[T],x={},0===d&&("end"==l?w=u+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-u)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(u/(r.length-1)))),x[M]=o[I],t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),y=m.maxFlexSize||m[E],"center"===s?x[M]=Math.round(i[D]/2-m[L]/2):"stretch"===s?(x[L]=V(m[P]||0,i[D]-o[I]-o[F]),x[M]=o[I]):"end"===s&&(x[M]=i[D]-m[L]-o.top),m.flex>0&&(y+=Math.ceil(m.flex*C)),x[N]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c +}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var q=e.parent();q&&(q._lastRect=null,q.recalc())}}})}),r(Ht,[mt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Mt,[z,vt,G,f,at,h],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight text-decoration text-transform color background-color border border-radius"),(t=e.formatter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=n(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a}t.push(o)}),t}var r=0,i=[],o=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})});var a=n(e.settings.style_formats||o);return a={type:"menu",items:a,onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function d(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function u(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Toggle blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:d,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:d,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:u,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:{raw:o[0][0]},values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(e){a(e.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Dt,[ht],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v,y,b,C,x,w,_,N=[],E=[],k,S,T,R,A,B;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),u=0;r>u;u++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(u=0;r>u&&(d=i[f*r+u],d);u++)c=d.layoutRect(),k=c.minW,S=c.minH,N[u]=k>N[u]?k:N[u],E[f]=S>E[f]?S:E[f];for(A=o.innerW-g.left-g.right,w=0,u=0;r>u;u++)w+=N[u]+(u>0?y:0),A-=(u>0?y:0)+N[u];for(B=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),B-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var H;H="start"==t.packV?0:B>0?Math.floor(B/n):0;var M=0,D=t.flexWidths;if(D)for(u=0;uu;u++)N[u]+=D?Math.ceil(D[u]*L):L;for(m=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+H,u=0;r>u&&(d=i[f*r+u],d);u++)h=d.settings,c=d.layoutRect(),a=N[u],T=R=0,c.x=p,c.y=m,v=h.alignH||(C?C[u]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=h.alignV||(x?x[u]||x[0]:null),"center"==v?c.y=m+s/2-c.h/2:"bottom"==v?c.y=m+s-c.h:"stretch"==v&&(c.h=s),d.layoutRect(c),p+=a+y,d.recalc&&d.recalc();m+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(Lt,[vt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(Pt,[vt],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(e.getEl().offsetWidth>t.maxW&&(t.minW=t.maxW,e.addClass("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,e.getEl().offsetHeight)),t},disabled:function(e){var t=this,n;return e!==n&&(t.toggleClass("label-disabled",e),t._rendered&&(t.getEl()[0].className=t.classes())),t._super(e)},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(Ot,[U,X],function(e,t){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e.keyNav=new t({root:e,enableLeftRight:!0}),e._super()}})}),r(It,[Ot],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})}),r(Ft,[yt,V,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type)}).fire("show"),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),["bl-tl","tl-bl"]),void 0)},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1))},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '+'"+"
    "},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.keyboard&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n'+("-"!==i?' ":"")+("-"!==i?''+i+"":"")+(n.shortcut?'
    '+n.shortcut+"
    ":"")+(n.menu?'
    ':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Vt,[G,X,zt,f],function(e,t,n,r){var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var i=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var o=e.items,a=o.length;a--;)o[a]=r.extend({},e.itemDefaults,o[a]);i._super(e),i.addClass("menu"),i.keyNav=new t({root:i,enableUpDown:!0,enableLeftRight:!0,leftAction:function(){i.parent()instanceof n&&i.keyNav.cancel()},onCancel:function(){i.fire("cancel",{},!1),i.hide()}})},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("cancel"),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return i}),r(Ut,[Ct],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[vt,q],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '+''+"
    "},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},end:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[vt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r($t,[Ft,g],function(e,t){var n=t.DOM;return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repaint:function(){var e=this,t=e.getEl(),r=e.layoutRect(),i,o,a;return e._super(),i=t.firstChild,o=t.lastChild,n.css(i,{width:r.w-o.offsetWidth,height:r.h-2}),n.css(o,{height:r.h-2}),a=i.firstChild.style,a.width=a.height="100%",a=o.firstChild.style,a.width=a.height="100%",e},activeMenu:function(e){var t=this;n.toggleClass(t.getEl().lastChild,t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '+'"+'"+"
    "},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){e.control!=this||n.getParent(e.target,"."+this.classPrefix+"open")||(e.stopImmediatePropagation(),t.call(this,e))}),delete e.settings.onclick,e._super()}})}),r(Kt,[Ht],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Yt,[$,W],function(e,t){"use stict";return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){this.activeTabId&&t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active"),this.activeTabId="t"+e,t.addClass(this.getEl("t"+e),this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){n+='
    '+e.encode(t.settings.title)+"
    "}),'
    '+'
    '+n+"
    "+'
    '+t.renderHtml(e)+"
    "+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,n,r;n=r=0,e.items().each(function(t,i){n=Math.max(n,t.layoutRect().minW),r=Math.max(r,t.layoutRect().minH),e.settings.activeTab!=i&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=n,e.settings.h=r,e.layoutRect({x:0,y:0,w:n,h:r})});var i=e.getEl("head").offsetHeight;return e.settings.minWidth=n,e.settings.minHeight=r+i,t=e._super(),t.deltaH+=e.getEl("head").offsetHeight,t.innerH=t.h-t.deltaH,t}})}),r(Gt,[vt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.submit?(t.submit(),!1):void 0})})},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Xt,[W],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,d,u,f,p,m,h,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,H,M,D,L,P,O,I,F,W,z,V,U,q,j,$,K,Y,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,dt,ut,ft,pt,mt,ht,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Ht,Mt,Dt,Lt,Pt,Ot,It,Ft,Wt,zt,Vt,Ut,qt,jt,$t,Kt,Yt,Gt,Xt])}(this); \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tpl/entry.tpl b/system/sai/modules/saimod_sys_locale/tpl/entry.tpl new file mode 100644 index 0000000..8cc45f6 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tpl/entry.tpl @@ -0,0 +1,4 @@ + + ${id} + ${lang} + \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tpl/lang_tabs.tpl b/system/sai/modules/saimod_sys_locale/tpl/lang_tabs.tpl new file mode 100644 index 0000000..489279a --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tpl/lang_tabs.tpl @@ -0,0 +1,9 @@ +
    + +
    + ${tabs} +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tpl/langtabopt.tpl b/system/sai/modules/saimod_sys_locale/tpl/langtabopt.tpl new file mode 100644 index 0000000..df660f6 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tpl/langtabopt.tpl @@ -0,0 +1 @@ +
  • ${langs}
  • \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tpl/langtabs.tpl b/system/sai/modules/saimod_sys_locale/tpl/langtabs.tpl new file mode 100644 index 0000000..64f246d --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tpl/langtabs.tpl @@ -0,0 +1,7 @@ +
    + +
    +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tpl/tab.tpl b/system/sai/modules/saimod_sys_locale/tpl/tab.tpl new file mode 100644 index 0000000..c4ef8cc --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tpl/tab.tpl @@ -0,0 +1,8 @@ +
    + + + + + ${content} +
    IDCategory${lang}
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tpl/tabopt.tpl b/system/sai/modules/saimod_sys_locale/tpl/tabopt.tpl new file mode 100644 index 0000000..db32e5b --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tpl/tabopt.tpl @@ -0,0 +1 @@ +
  • Group ${tab_id}
  • \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_locale/tpl/tabs.tpl b/system/sai/modules/saimod_sys_locale/tpl/tabs.tpl new file mode 100644 index 0000000..00cd6b6 --- /dev/null +++ b/system/sai/modules/saimod_sys_locale/tpl/tabs.tpl @@ -0,0 +1,49 @@ +

    Texts

    +
    +
    + +
    + ${tabs} +
    +
    +
    + +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/autoload.inc b/system/sai/modules/saimod_sys_log/autoload.inc new file mode 100644 index 0000000..54ea0cb --- /dev/null +++ b/system/sai/modules/saimod_sys_log/autoload.inc @@ -0,0 +1,5 @@ +D!?H2$M zU}whwS0g!1d@9(>e!%W{WeX1(&Pu-QF>ukNt^Y z`<6!zCwTOV*InasT|3PQYA7SJ2`UMR608aHR%FVwPuzFl)}fVeE-mkU{$}s%-4Xg4 zb66X#1v@2}pc)xd`H%Jj`5(~0PMv(BhwkhJ7OW@=k9+#4WLS0X8 ziG5@h_jcNC# $file));} + } + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl'), $vars);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_system($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_CLASS_SYSTEM::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('class_system', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\COUNTER" then 1 else 0 end) class_SYSTEM_LOG_COUNTER,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\INFO" then 1 else 0 end) class_SYSTEM_LOG_INFO,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\DEPRECATED" then 1 else 0 end) class_SYSTEM_LOG_DEPRECATED,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\WARNING" then 1 else 0 end) class_SYSTEM_LOG_WARNING,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\ERROR" then 1 else 0 end) class_SYSTEM_LOG_ERROR,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\ERROR_EXCEPTION" then 1 else 0 end) class_SYSTEM_LOG_ERROR_EXCEPTION,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\SHUTDOWN_EXCEPTION" then 1 else 0 end) class_SYSTEM_LOG_SHUTDOWN_EXCEPTION' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_other($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_CLASS_OTHER::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('class_other', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'Exception\' then 1 else 0 end) class_Exception,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'RuntimeException\' then 1 else 0 end) class_RuntimeException,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'ErrorException\' then 1 else 0 end) class_ErrorException' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_basic($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_CLASS_BASIC::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('class_basic', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'ERROR\' then 1 else 0 end) class_ERROR,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WARNING\' then 1 else 0 end) class_WARNING,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'INFO\' then 1 else 0 end) class_INFO,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'DEPRECATED\' then 1 else 0 end) class_DEPRECATED,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'AppError\' then 1 else 0 end) class_AppError' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_basic($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_UNIQUE_BASIC::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('unique_basic', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_request($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_UNIQUE_REQUEST::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('unique_request', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_PORT.') as server_port_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_REQUEST_URI.') as request_uri_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_POST.') as post_unique' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_exception($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_UNIQUE_EXCEPTION::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('unique_exception', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_FILE.') as file_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_LINE.') as line_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_CLASS.') as class_unique' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_referer($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_UNIQUE_REFERER::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('unique_referer', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_visitor($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_BASIC_VISITOR::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('basic_visitor', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_sucess($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_BASIC_SUCCESS::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('basic_sucess', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'sum(case when not '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\COUNTER" and' + .' not '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\INFO" and' + .' not '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "INFO" and' + .' not '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\DEPRECATED" and' + .' not '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "DEPRECATED" and ' + .' not '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "PreprocessingLog" ' + .'then 1 else 0 end) class_fail,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\INFO" or ' + .\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\INFO" or ' + .\SYSTEM\DBD\system_log::FIELD_CLASS.' = "INFO" or ' + .\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\DEPRECATE" or ' + .\SYSTEM\DBD\system_log::FIELD_CLASS.' = "DEPRECATED" or ' + .\SYSTEM\DBD\system_log::FIELD_CLASS.' = "PreprocessingLog" ' + .'then 1 else 0 end) class_log,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = "SYSTEM\\LOG\\COUNTER" then 1 else 0 end) class_sucess' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_querytime($filter,$db){ + $result = array(); + if(!$db){ + $result = \SYSTEM\DBD\SYS_SAIMOD_LOG_BASIC_QUERYTIME::QA(array($filter)); + } else { + $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$db)); + $res = $con->prepare('basic_querytime', + 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' + .'count(*) as count,' + .'avg('.\SYSTEM\DBD\system_log::FIELD_QUERYTIME.') as querytime_avg,' + .'max('.\SYSTEM\DBD\system_log::FIELD_QUERYTIME.') as querytime_max,' + .'min('.\SYSTEM\DBD\system_log::FIELD_QUERYTIME.') as querytime_min' + .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS + .' GROUP BY day' + .' ORDER BY day DESC' + .' LIMIT 30;', + array(':filter' => $filter)); + while($row = $res->next()){ + $result[] = $row;} + } + return \SYSTEM\LOG\JsonResult::toString($result);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_error($error){ + $vars = \SYSTEM\DBD\SYS_SAIMOD_LOG_ERROR::QQ(array($error))->next(); + $vars['trace'] = implode('
    ', array_slice(explode('#', $vars['trace']), 1, -1)); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl'), $vars);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter($filter = "%"){ + $filter = str_replace('\\', '\\\\', $filter); + $count = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER_COUNT::Q1(array($filter)); + $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER::QQ(array($filter)); + $table=''; + while($r = $res->next()){ + //print_r($r); + $r['class_row'] = self::tablerow_class($r['class']); + $r['time'] = self::time_elapsed_string(strtotime($r['time'])); + $r['message'] = substr($r['message'],0,255); + $table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r); + } + $vars = array(); + $vars['count'] = $count['count']; + $vars['table'] = $table; + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl'), $vars); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_log(){ + $vars = array(); + $vars['table'] = self::sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter(); + $vars['error_filter'] = self::generate_error_filters(); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'), $vars); + } + + private static function time_elapsed_string($ptime){ + $etime = time() - $ptime; + if ($etime < 1){ + return '0 seconds';} + + $a = array( 12 * 30 * 24 * 60 * 60 => 'year', + 30 * 24 * 60 * 60 => 'month', + 24 * 60 * 60 => 'day', + 60 * 60 => 'hour', + 60 => 'minute', + 1 => 'second'); + + foreach ($a as $secs => $str){ + $d = $etime / $secs; + if ($d >= 1){ + $r = round($d); + return $r . ' ' . $str . ($r > 1 ? 's' : '') . ' ago';} + } + } + + private static function generate_error_filters(){ + $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTERS::QQ(); + $result = ''; + while($row = $res->next()){ + $result .= '
  • '.$row['class'].'
  • ';} + return $result; + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log(){ + $vars = array(); + $vars['PICPATH'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(), 'modules/saimod_sys_log/img/'); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log.tpl'), $vars); + } + + public static function tablerow_class($class){ + switch($class){ + case 'SYSTEM\LOG\INFO': case 'INFO': case 'SYSTEM\LOG\COUNTER': + return 'success'; + case 'SYSTEM\LOG\DEPRECATED': case 'DEPRECATED': + return 'info'; + case 'SYSTEM\LOG\ERROR': case 'ERROR': case 'Exception': case 'SYSTEM\LOG\ERROR_EXCEPTION': + case 'ErrorException': case 'SYSTEM\LOG\SHUTDOWN_EXCEPTION': + return 'error'; + case 'SYSTEM\LOG\WARNING': case 'WARNING': + return 'warning'; + default: + return ''; + } + } + + public static function html_li_menu(){return '
  • Log
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_flag_css(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_log_flag_js(){ + return \SYSTEM\LOG\JsonResult::toString( + array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/js/saimod_sys_log.js')));} +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl new file mode 100644 index 0000000..d7fce53 --- /dev/null +++ b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl @@ -0,0 +1,14 @@ +

    System Log

    +
    +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl new file mode 100644 index 0000000..c000c34 --- /dev/null +++ b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl @@ -0,0 +1,23 @@ +

    Error ${ID}

    + + + + + + + + + + + + + + + + + + + + + +
    PropertyValue
    ID${ID}
    class${class}
    code${code}
    file${file}
    line${line}
    trace${trace}
    ip${ip}
    querytime${querytime}
    time${time}
    server_name${server_name}
    server_port${server_port}
    request_uri${request_uri}
    url${server_name}:${server_port}${request_uri}
    post${post}
    http_referer${http_referer}
    http_user_agent${http_user_agent}
    user${username}
    thrown${thrown}
    message${message}
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl new file mode 100644 index 0000000..8a5f6ed --- /dev/null +++ b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl @@ -0,0 +1,5 @@ + +
    ${table}
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl new file mode 100644 index 0000000..a004b46 --- /dev/null +++ b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl @@ -0,0 +1,43 @@ +
    + +
    +
    + + +
    +
    +
    +
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats_menu.tpl b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats_menu.tpl new file mode 100644 index 0000000..2b2455a --- /dev/null +++ b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats_menu.tpl @@ -0,0 +1 @@ +
  • ${file}
  • \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl new file mode 100644 index 0000000..5c7a35e --- /dev/null +++ b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl @@ -0,0 +1,15 @@ +Rows: ${count} + + + + + + + + + + + + + ${table} +
    time agoclassmessagefilelineipurluserquerytime
    \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl new file mode 100644 index 0000000..97b6b72 --- /dev/null +++ b/system/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl @@ -0,0 +1,11 @@ + + ${time} + ${class} + ${message} + ${file} + ${line} + ${ip} + ${server_name}:${server_port}${request_uri} + ${username} + ${querytime} + \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_login/autoload.inc b/system/sai/modules/saimod_sys_login/autoload.inc new file mode 100644 index 0000000..30cf2ec --- /dev/null +++ b/system/sai/modules/saimod_sys_login/autoload.inc @@ -0,0 +1,5 @@ +"); + location.reload(true); + } else { + $('.help-block').html("Login not successfull.
    User & Password combination wrong.") + } + }); + event.preventDefault(); + } + }); + + $("#logout_form input").not("[type=submit]").jqBootstrapValidation({ + preventSubmit: true, + submitError: function($form, event, errors) {}, + submitSuccess: function($form, event){ + $.get(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=logout', function (data) { + if(data == 1){ + $('.help-block').html("Logout successfull.
    "); + location.reload(true); + } else { + $('.help-block').html("Logout not successfull.
    ") + } + }); + event.preventDefault(); + } + }); + + $.getJSON(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=userinfo', function(data){ + if(data){ + $('#user_email_input').attr('value', data.email); + $('span#user_username').text(data.username); + $('span#user_email').text(data.email); + $('span#user_joindate').text(data.joindate); + $('span#user_last_active').text(new Date(data.last_active * 1000).toString('yyyy-MM-dd h:mm:ss')); + $('span#user_locale').text(data.locale); + } + }); + + $("#register_link").click(function(){ + $('div#content-wrapper').load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=registerform',function(){ + init__SYSTEM_SAI_saimod_sys_login_register(); + }); + }); +}; + +function init__SYSTEM_SAI_saimod_sys_login_register(){ + $('#btn_user_registration_cancel').click(function(){ + loadModuleContent('.SYSTEM.SAI.saimod_sys_login'); + }); + + + //jqBootstrapValidation + $("#register_user_form input").not("[type=submit]").jqBootstrapValidation({ + preventSubmit: true, + submitError: function (form, event, errors) {}, + submitSuccess: function($form, event){ + var username = document.getElementById('register_username').value; + var email = document.getElementById('register_email').value; + var password = document.getElementById('user_register_password2').value; + + var select_locale = document.getElementById('register_locale_select'); + var locale = ""; + for (var i = 0; i < select_locale.options.length; i++) { + if(select_locale.options[i].selected ){ + locale = select_locale.options[i].value; + } + } + + $.ajax({ + dataType: "json", + url: SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=register&username='+username+'&password='+$.sha1(password)+'&email='+email+'&locale='+locale, + data: null, + success: function (dataCreate) { + if(dataCreate === 1){ // reload -> user will be loged in + window.location.href = location.href.replace(/#/g, ""); + }else{ // show errors + alert('Not successfull: '+dataCreate); + } + } + }); + + event.preventDefault(); + } + }); +} \ No newline at end of file diff --git a/system/sai/modules/saimod_sys_login/saimod_sys_login.php b/system/sai/modules/saimod_sys_login/saimod_sys_login.php new file mode 100644 index 0000000..ec3d72b --- /dev/null +++ b/system/sai/modules/saimod_sys_login/saimod_sys_login.php @@ -0,0 +1,61 @@ + $user->username, + 'email' => $user->email, + 'joindate' => $user->creationDate, + 'locale' => $user->locale, + 'last_active' => $user->lastLoginDate)); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_registerform(){ + $vars = \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI), + \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR), + \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_BASIC)); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/tpl/register.tpl'), $vars);} + + public static function html_li_menu(){return '