From 9ff50bd47da3bfc5d234267dc47b65d9a6204cb8 Mon Sep 17 00:00:00 2001 From: kjodle Date: Sun, 18 Oct 2015 12:03:50 -0400 Subject: [PATCH] LCARS GetSimple Template LCARS is a template for the GetSimple CMS that mimics the monitor appearance in the television series Star Trek: The Next Generation --- .htaccess | 61 + LICENSE.txt | 674 ++++++ admin/api.php | 58 + admin/apple-touch-icon.png | Bin 0 -> 1628 bytes admin/archive.php | 98 + admin/backup-edit.php | 169 ++ admin/backups.php | 121 + admin/changedata.php | 207 ++ admin/components.php | 162 ++ admin/cron.php | 5 + admin/deletefile.php | 72 + admin/download.php | 63 + admin/edit.php | 479 ++++ admin/favicon.png | Bin 0 -> 557 bytes admin/filebrowser.php | 202 ++ admin/health-check.php | 378 +++ admin/humans.txt | 31 + admin/image.php | 147 ++ admin/inc/ZipArchive.php | 804 +++++++ admin/inc/ajax.php | 76 + admin/inc/api.class.php | 178 ++ admin/inc/api.plugin.php | 104 + admin/inc/basic.php | 1273 ++++++++++ admin/inc/caching_functions.php | 326 +++ admin/inc/common.php | 339 +++ admin/inc/configuration.php | 31 + admin/inc/cookie_functions.php | 101 + admin/inc/image.class.php | 212 ++ admin/inc/imagemanipulation.php | 312 +++ admin/inc/logging.class.php | 134 ++ admin/inc/login_functions.php | 83 + admin/inc/nonce.php | 1 + admin/inc/plugin_functions.php | 670 ++++++ admin/inc/security_functions.php | 227 ++ admin/inc/template_functions.php | 1254 ++++++++++ admin/inc/theme_functions.php | 646 +++++ admin/inc/thumb.php | 144 ++ admin/inc/timezone_options.txt | 87 + admin/inc/tmp/tmp-404.xml | 2 + admin/inc/tmp/tmp-admin.xml | 58 + admin/inc/tmp/tmp-components.xml | 12 + admin/inc/tmp/tmp-index.xml | 27 + admin/inc/tmp/tmp.allow.htaccess | 24 + admin/inc/tmp/tmp.deny.htaccess | 24 + admin/inc/xss.php | 1 + admin/index.php | 42 + admin/lang/en_US.php | 542 +++++ admin/load-ajax.php | 3 + admin/load.php | 59 + admin/loadtab.php | 3 + admin/log.php | 119 + admin/logout.php | 25 + admin/menu-manager.php | 104 + admin/navigation.php | 74 + admin/pages.php | 123 + admin/plugins.php | 124 + admin/resetpassword.php | 110 + admin/settings.php | 297 +++ admin/share.php | 53 + admin/sitemap.php | 54 + admin/support.php | 61 + admin/template/css-wide.php | 43 + admin/template/css.php | 2091 +++++++++++++++++ admin/template/error_checking.php | 100 + admin/template/footer.php | 53 + admin/template/header.php | 92 + admin/template/ie6.css | 29 + admin/template/images/active.png | Bin 0 -> 406 bytes admin/template/images/ajax.gif | Bin 0 -> 576 bytes admin/template/images/ajax_dark.gif | Bin 0 -> 105128 bytes admin/template/images/cancel.png | Bin 0 -> 256 bytes admin/template/images/capslock.png | Bin 0 -> 576 bytes admin/template/images/clock.png | Bin 0 -> 394 bytes admin/template/images/folder.png | Bin 0 -> 213 bytes admin/template/images/getsimple_logo.gif | Bin 0 -> 264 bytes admin/template/images/minus.png | Bin 0 -> 202 bytes admin/template/images/plus.png | Bin 0 -> 217 bytes admin/template/images/search.png | Bin 0 -> 359 bytes admin/template/images/tick.png | Bin 0 -> 255 bytes admin/template/images/utick.png | Bin 0 -> 224 bytes admin/template/include-nav.php | 47 + admin/template/js/ckeditor/.htaccess | 24 + admin/template/js/ckeditor/ckeditor.js | 153 ++ admin/template/js/ckeditor/config.js | 209 ++ admin/template/js/ckeditor/contents.css | 25 + admin/template/js/ckeditor/images/spacer.gif | Bin 0 -> 43 bytes admin/template/js/ckeditor/lang/de.js | 6 + admin/template/js/ckeditor/lang/en.js | 6 + admin/template/js/ckeditor/lang/es.js | 6 + admin/template/js/ckeditor/lang/fr.js | 6 + admin/template/js/ckeditor/lang/it.js | 6 + admin/template/js/ckeditor/lang/nl.js | 6 + admin/template/js/ckeditor/lang/pl.js | 6 + admin/template/js/ckeditor/lang/pt.js | 6 + admin/template/js/ckeditor/lang/ru.js | 6 + admin/template/js/ckeditor/lang/sv.js | 6 + .../plugins/a11yhelp/dialogs/a11yhelp.js | 7 + .../js/ckeditor/plugins/a11yhelp/lang/en.js | 6 + .../ckeditor/plugins/about/dialogs/about.js | 6 + .../plugins/about/dialogs/logo_ckeditor.png | Bin 0 -> 2759 bytes .../js/ckeditor/plugins/adobeair/plugin.js | 6 + .../js/ckeditor/plugins/ajax/plugin.js | 6 + .../js/ckeditor/plugins/autogrow/plugin.js | 6 + .../js/ckeditor/plugins/bbcode/plugin.js | 9 + .../plugins/clipboard/dialogs/paste.js | 7 + .../colordialog/dialogs/colordialog.js | 7 + .../js/ckeditor/plugins/devtools/lang/en.js | 6 + .../js/ckeditor/plugins/devtools/plugin.js | 6 + .../plugins/dialog/dialogDefinition.js | 4 + .../js/ckeditor/plugins/div/dialogs/div.js | 8 + .../plugins/docprops/dialogs/docprops.js | 10 + .../js/ckeditor/plugins/docprops/plugin.js | 6 + .../js/ckeditor/plugins/find/dialogs/find.js | 10 + .../ckeditor/plugins/flash/dialogs/flash.js | 9 + .../plugins/flash/images/placeholder.png | Bin 0 -> 256 bytes .../ckeditor/plugins/forms/dialogs/button.js | 6 + .../plugins/forms/dialogs/checkbox.js | 6 + .../js/ckeditor/plugins/forms/dialogs/form.js | 6 + .../plugins/forms/dialogs/hiddenfield.js | 6 + .../ckeditor/plugins/forms/dialogs/radio.js | 6 + .../ckeditor/plugins/forms/dialogs/select.js | 9 + .../plugins/forms/dialogs/textarea.js | 6 + .../plugins/forms/dialogs/textfield.js | 6 + .../plugins/forms/images/hiddenfield.gif | Bin 0 -> 105 bytes .../ckeditor/plugins/iframe/dialogs/iframe.js | 7 + .../plugins/iframe/images/placeholder.png | Bin 0 -> 449 bytes .../ckeditor/plugins/iframedialog/plugin.js | 6 + .../ckeditor/plugins/image/dialogs/image.js | 13 + .../ckeditor/plugins/link/dialogs/anchor.js | 6 + .../js/ckeditor/plugins/link/dialogs/link.js | 12 + .../ckeditor/plugins/link/images/anchor.gif | Bin 0 -> 184 bytes .../plugins/liststyle/dialogs/liststyle.js | 7 + .../plugins/pagebreak/images/pagebreak.gif | Bin 0 -> 54 bytes .../plugins/pastefromword/filter/default.js | 11 + .../plugins/pastetext/dialogs/pastetext.js | 6 + .../placeholder/dialogs/placeholder.js | 6 + .../ckeditor/plugins/placeholder/lang/en.js | 6 + .../plugins/placeholder/placeholder.gif | Bin 0 -> 96 bytes .../js/ckeditor/plugins/placeholder/plugin.js | 6 + .../ckeditor/plugins/scayt/dialogs/options.js | 8 + .../plugins/scayt/dialogs/toolbar.css | 6 + .../showblocks/images/block_address.png | Bin 0 -> 171 bytes .../showblocks/images/block_blockquote.png | Bin 0 -> 181 bytes .../plugins/showblocks/images/block_div.png | Bin 0 -> 136 bytes .../plugins/showblocks/images/block_h1.png | Bin 0 -> 127 bytes .../plugins/showblocks/images/block_h2.png | Bin 0 -> 134 bytes .../plugins/showblocks/images/block_h3.png | Bin 0 -> 131 bytes .../plugins/showblocks/images/block_h4.png | Bin 0 -> 133 bytes .../plugins/showblocks/images/block_h5.png | Bin 0 -> 133 bytes .../plugins/showblocks/images/block_h6.png | Bin 0 -> 129 bytes .../plugins/showblocks/images/block_p.png | Bin 0 -> 119 bytes .../plugins/showblocks/images/block_pre.png | Bin 0 -> 136 bytes .../ckeditor/plugins/smiley/dialogs/smiley.js | 7 + .../plugins/smiley/images/angel_smile.gif | Bin 0 -> 465 bytes .../plugins/smiley/images/angry_smile.gif | Bin 0 -> 443 bytes .../plugins/smiley/images/broken_heart.gif | Bin 0 -> 192 bytes .../plugins/smiley/images/confused_smile.gif | Bin 0 -> 464 bytes .../plugins/smiley/images/cry_smile.gif | Bin 0 -> 468 bytes .../plugins/smiley/images/devil_smile.gif | Bin 0 -> 436 bytes .../smiley/images/embaressed_smile.gif | Bin 0 -> 442 bytes .../plugins/smiley/images/envelope.gif | Bin 0 -> 426 bytes .../ckeditor/plugins/smiley/images/heart.gif | Bin 0 -> 183 bytes .../ckeditor/plugins/smiley/images/kiss.gif | Bin 0 -> 241 bytes .../plugins/smiley/images/lightbulb.gif | Bin 0 -> 368 bytes .../plugins/smiley/images/omg_smile.gif | Bin 0 -> 451 bytes .../plugins/smiley/images/regular_smile.gif | Bin 0 -> 450 bytes .../plugins/smiley/images/sad_smile.gif | Bin 0 -> 460 bytes .../plugins/smiley/images/shades_smile.gif | Bin 0 -> 449 bytes .../plugins/smiley/images/teeth_smile.gif | Bin 0 -> 442 bytes .../plugins/smiley/images/thumbs_down.gif | Bin 0 -> 408 bytes .../plugins/smiley/images/thumbs_up.gif | Bin 0 -> 396 bytes .../plugins/smiley/images/tounge_smile.gif | Bin 0 -> 446 bytes .../images/whatchutalkingabout_smile.gif | Bin 0 -> 452 bytes .../plugins/smiley/images/wink_smile.gif | Bin 0 -> 458 bytes .../specialchar/dialogs/specialchar.js | 7 + .../ckeditor/plugins/specialchar/lang/en.js | 6 + .../ckeditor/plugins/styles/styles/default.js | 6 + .../plugins/stylesheetparser/plugin.js | 6 + .../ckeditor/plugins/table/dialogs/table.js | 9 + .../js/ckeditor/plugins/tableresize/plugin.js | 7 + .../plugins/tabletools/dialogs/tableCell.js | 8 + .../plugins/templates/dialogs/templates.js | 7 + .../plugins/templates/templates/default.js | 6 + .../templates/templates/images/template1.gif | Bin 0 -> 375 bytes .../templates/templates/images/template2.gif | Bin 0 -> 333 bytes .../templates/templates/images/template3.gif | Bin 0 -> 422 bytes .../plugins/uicolor/dialogs/uicolor.js | 7 + .../js/ckeditor/plugins/uicolor/lang/en.js | 6 + .../js/ckeditor/plugins/uicolor/plugin.js | 6 + .../js/ckeditor/plugins/uicolor/uicolor.gif | Bin 0 -> 1108 bytes .../plugins/uicolor/yui/assets/hue_bg.png | Bin 0 -> 1120 bytes .../plugins/uicolor/yui/assets/hue_thumb.png | Bin 0 -> 195 bytes .../uicolor/yui/assets/picker_mask.png | Bin 0 -> 12174 bytes .../uicolor/yui/assets/picker_thumb.png | Bin 0 -> 192 bytes .../plugins/uicolor/yui/assets/yui.css | 6 + .../js/ckeditor/plugins/uicolor/yui/yui.js | 76 + .../ckeditor/plugins/wsc/dialogs/ciframe.html | 49 + .../plugins/wsc/dialogs/tmpFrameset.html | 52 + .../js/ckeditor/plugins/wsc/dialogs/wsc.css | 6 + .../js/ckeditor/plugins/wsc/dialogs/wsc.js | 7 + .../js/ckeditor/plugins/xml/plugin.js | 6 + .../js/ckeditor/skins/getsimple/dialog.css | 678 ++++++ .../js/ckeditor/skins/getsimple/editor.css | 1444 ++++++++++++ .../js/ckeditor/skins/getsimple/icons.png | Bin 0 -> 21235 bytes .../ckeditor/skins/getsimple/images/mini.png | Bin 0 -> 1581 bytes .../skins/getsimple/images/noimage.png | Bin 0 -> 2115 bytes .../skins/getsimple/images/sprites.png | Bin 0 -> 3992 bytes .../skins/getsimple/images/sprites_ie6.png | Bin 0 -> 2724 bytes .../js/ckeditor/skins/getsimple/skin.js | 45 + .../js/ckeditor/skins/getsimple/templates.css | 61 + .../js/ckeditor/themes/default/theme.js | 8 + .../codemirror/lib/codemirror-compressed.js | 1 + .../template/js/codemirror/lib/codemirror.css | 120 + .../template/js/codemirror/theme/default.css | 19 + admin/template/js/fancybox/blank.gif | Bin 0 -> 43 bytes .../template/js/fancybox/fancybox_loading.gif | Bin 0 -> 5969 bytes .../template/js/fancybox/fancybox_sprite.png | Bin 0 -> 2750 bytes .../template/js/fancybox/jquery.fancybox.css | 225 ++ .../js/fancybox/jquery.fancybox.pack.js | 32 + admin/template/js/jcrop/Jcrop.gif | Bin 0 -> 329 bytes admin/template/js/jcrop/jquery.Jcrop.css | 45 + admin/template/js/jcrop/jquery.Jcrop.min.js | 163 ++ admin/template/js/jquery-scrolltofixed.js | 531 +++++ admin/template/js/jquery-ui.min.js | 15 + admin/template/js/jquery.getsimple.js | 601 +++++ admin/template/js/jquery.min.js | 4 + .../template/js/uploadify/jquery.uploadify.js | 677 ++++++ admin/template/js/uploadify/uploadify.swf | Bin 0 -> 12787 bytes admin/template/sidebar-backups.php | 13 + admin/template/sidebar-files.php | 97 + admin/template/sidebar-pages.php | 20 + admin/template/sidebar-plugins.php | 12 + admin/template/sidebar-settings.php | 16 + admin/template/sidebar-support.php | 13 + admin/template/sidebar-theme.php | 21 + admin/template/style.php | 66 + admin/theme-edit.php | 230 ++ admin/theme.php | 111 + admin/upload-uploadify.php | 63 + admin/upload.php | 322 +++ admin/uploadify-check-exists.php | 21 + admin/zip.php | 89 + backups/.htaccess | 24 + backups/other/components.xml.bak | 12 + backups/other/website.xml.bak | 2 + backups/pages/support.bak.xml | 7 + .../pages/testing-social-media-icons.bak.xml | 6 + backups/users/gsthemesmaster.xml.bak | 2 + data/.htaccess | 24 + .../bdb9bacf0fede7e8a56a91265c67b783.txt | 1 + .../c49a301fb50c50accf22f2c3a295b8d3.txt | 1 + .../e95aa6f492bb1942f1948e324f3f7165.txt | 1 + .../f2b89b9c7f2c9d2f5fa3e87b772bb9e3.txt | 1 + data/cache/stylesheet.txt | 1 + data/other/404.xml | 2 + data/other/authorization.xml | 2 + data/other/components.xml | 21 + data/other/logs/errorlog.txt | 2 + data/other/logs/failedlogins.log | 2 + data/other/pages.xml | 2 + data/other/plugins.xml | 2 + data/other/website.xml | 2 + data/pages/index.xml | 23 + data/pages/styles.xml | 88 + data/pages/support.xml | 5 + data/pages/testing-social-media-icons.xml | 3 + data/pages/usage-hints.xml | 43 + data/thumbs/.htaccess | 24 + data/thumbs/images/thumbnail.facebook.png | Bin 0 -> 2047 bytes data/thumbs/images/thumbnail.twitter.png | Bin 0 -> 3004 bytes data/thumbs/images/thumbnail.youtube.png | Bin 0 -> 2471 bytes data/thumbs/images/thumbsm.facebook.png | Bin 0 -> 3092 bytes data/thumbs/images/thumbsm.lcars-2-line.png | Bin 0 -> 2225 bytes data/thumbs/images/thumbsm.twitter.png | Bin 0 -> 3254 bytes data/thumbs/images/thumbsm.youtube.png | Bin 0 -> 3113 bytes data/thumbs/index.php | 3 + data/uploads/.htaccess | 24 + data/uploads/images/facebook.png | Bin 0 -> 3073 bytes data/uploads/images/lcars-2-line.png | Bin 0 -> 2746 bytes data/uploads/images/twitter.png | Bin 0 -> 3278 bytes data/uploads/images/youtube.png | Bin 0 -> 3105 bytes data/uploads/index.php | 3 + data/users/gsthemesmaster.xml | 2 + gsconfig.php | 115 + index.php | 136 ++ plugins/.htaccess | 24 + plugins/InnovationPlugin.php | 115 + plugins/InnovationPlugin/lang/en_US.php | 37 + plugins/anonymous_data.php | 204 ++ plugins/anonymous_data/lang/en_US.php | 68 + plugins/sa_toolbar.php | 654 ++++++ plugins/sa_toolbar/assets/css/.htaccess | 2 + plugins/sa_toolbar/assets/css/sa_toolbar.css | 653 +++++ plugins/sa_toolbar/assets/img/.htaccess | 2 + plugins/sa_toolbar/assets/img/gsicon.png | Bin 0 -> 642 bytes .../sa_toolbar/assets/img/sa_tb_debugmode.png | Bin 0 -> 748 bytes plugins/sa_toolbar/inc/sa_common.php | 29 + readme.txt | 74 + robots.txt | 2 + sitemap.xml | 2 + theme/Cardinal/images/bg.png | Bin 0 -> 1356 bytes theme/Cardinal/images/screenshot.png | Bin 0 -> 44518 bytes theme/Cardinal/style.css | 102 + theme/Cardinal/template.php | 66 + theme/Innovation/assets/css/print.css | 18 + theme/Innovation/assets/css/reset.css | 226 ++ theme/Innovation/assets/images/break.png | Bin 0 -> 213 bytes theme/Innovation/assets/images/facebook.png | Bin 0 -> 1214 bytes theme/Innovation/assets/images/github.png | Bin 0 -> 2430 bytes theme/Innovation/assets/images/googleplus.png | Bin 0 -> 2371 bytes theme/Innovation/assets/images/icons.txt | 6 + theme/Innovation/assets/images/instagram.png | Bin 0 -> 2094 bytes theme/Innovation/assets/images/linkedin.png | Bin 0 -> 1210 bytes theme/Innovation/assets/images/share.png | Bin 0 -> 1133 bytes theme/Innovation/assets/images/tumblr.png | Bin 0 -> 2535 bytes .../Innovation/assets/images/twitter-alt.png | Bin 0 -> 2450 bytes theme/Innovation/assets/images/twitter.png | Bin 0 -> 1214 bytes theme/Innovation/assets/images/vimeo.png | Bin 0 -> 2513 bytes theme/Innovation/assets/images/youtube.png | Bin 0 -> 2803 bytes theme/Innovation/assets/js/dd_belatedpng.js | 13 + theme/Innovation/footer.inc.php | 27 + theme/Innovation/functions.php | 44 + theme/Innovation/header.inc.php | 64 + theme/Innovation/images/screenshot.png | Bin 0 -> 28749 bytes theme/Innovation/sidebar.inc.php | 40 + theme/Innovation/style.css | 327 +++ theme/Innovation/template.php | 41 + theme/LCARS-Next-Gen/LICENSE.txt | 674 ++++++ theme/LCARS-Next-Gen/css/lcars.ttf | Bin 0 -> 38492 bytes theme/LCARS-Next-Gen/css/print.css | 38 + theme/LCARS-Next-Gen/css/style.css | 429 ++++ theme/LCARS-Next-Gen/functions.php | 17 + .../images/screenshot-large.png | Bin 0 -> 59948 bytes theme/LCARS-Next-Gen/images/screenshot.png | Bin 0 -> 55756 bytes theme/LCARS-Next-Gen/rss.php | 8 + theme/LCARS-Next-Gen/template.php | 103 + 336 files changed, 25814 insertions(+) create mode 100644 .htaccess create mode 100644 LICENSE.txt create mode 100644 admin/api.php create mode 100644 admin/apple-touch-icon.png create mode 100644 admin/archive.php create mode 100644 admin/backup-edit.php create mode 100644 admin/backups.php create mode 100644 admin/changedata.php create mode 100644 admin/components.php create mode 100644 admin/cron.php create mode 100644 admin/deletefile.php create mode 100644 admin/download.php create mode 100644 admin/edit.php create mode 100644 admin/favicon.png create mode 100644 admin/filebrowser.php create mode 100644 admin/health-check.php create mode 100644 admin/humans.txt create mode 100644 admin/image.php create mode 100644 admin/inc/ZipArchive.php create mode 100644 admin/inc/ajax.php create mode 100644 admin/inc/api.class.php create mode 100644 admin/inc/api.plugin.php create mode 100644 admin/inc/basic.php create mode 100644 admin/inc/caching_functions.php create mode 100644 admin/inc/common.php create mode 100644 admin/inc/configuration.php create mode 100644 admin/inc/cookie_functions.php create mode 100644 admin/inc/image.class.php create mode 100644 admin/inc/imagemanipulation.php create mode 100644 admin/inc/logging.class.php create mode 100644 admin/inc/login_functions.php create mode 100644 admin/inc/nonce.php create mode 100644 admin/inc/plugin_functions.php create mode 100644 admin/inc/security_functions.php create mode 100644 admin/inc/template_functions.php create mode 100644 admin/inc/theme_functions.php create mode 100644 admin/inc/thumb.php create mode 100644 admin/inc/timezone_options.txt create mode 100644 admin/inc/tmp/tmp-404.xml create mode 100644 admin/inc/tmp/tmp-admin.xml create mode 100644 admin/inc/tmp/tmp-components.xml create mode 100644 admin/inc/tmp/tmp-index.xml create mode 100644 admin/inc/tmp/tmp.allow.htaccess create mode 100644 admin/inc/tmp/tmp.deny.htaccess create mode 100644 admin/inc/xss.php create mode 100644 admin/index.php create mode 100644 admin/lang/en_US.php create mode 100644 admin/load-ajax.php create mode 100644 admin/load.php create mode 100644 admin/loadtab.php create mode 100644 admin/log.php create mode 100644 admin/logout.php create mode 100644 admin/menu-manager.php create mode 100644 admin/navigation.php create mode 100644 admin/pages.php create mode 100644 admin/plugins.php create mode 100644 admin/resetpassword.php create mode 100644 admin/settings.php create mode 100644 admin/share.php create mode 100644 admin/sitemap.php create mode 100644 admin/support.php create mode 100644 admin/template/css-wide.php create mode 100644 admin/template/css.php create mode 100644 admin/template/error_checking.php create mode 100644 admin/template/footer.php create mode 100644 admin/template/header.php create mode 100644 admin/template/ie6.css create mode 100644 admin/template/images/active.png create mode 100644 admin/template/images/ajax.gif create mode 100644 admin/template/images/ajax_dark.gif create mode 100644 admin/template/images/cancel.png create mode 100644 admin/template/images/capslock.png create mode 100644 admin/template/images/clock.png create mode 100644 admin/template/images/folder.png create mode 100644 admin/template/images/getsimple_logo.gif create mode 100644 admin/template/images/minus.png create mode 100644 admin/template/images/plus.png create mode 100644 admin/template/images/search.png create mode 100644 admin/template/images/tick.png create mode 100644 admin/template/images/utick.png create mode 100644 admin/template/include-nav.php create mode 100644 admin/template/js/ckeditor/.htaccess create mode 100644 admin/template/js/ckeditor/ckeditor.js create mode 100644 admin/template/js/ckeditor/config.js create mode 100644 admin/template/js/ckeditor/contents.css create mode 100644 admin/template/js/ckeditor/images/spacer.gif create mode 100644 admin/template/js/ckeditor/lang/de.js create mode 100644 admin/template/js/ckeditor/lang/en.js create mode 100644 admin/template/js/ckeditor/lang/es.js create mode 100644 admin/template/js/ckeditor/lang/fr.js create mode 100644 admin/template/js/ckeditor/lang/it.js create mode 100644 admin/template/js/ckeditor/lang/nl.js create mode 100644 admin/template/js/ckeditor/lang/pl.js create mode 100644 admin/template/js/ckeditor/lang/pt.js create mode 100644 admin/template/js/ckeditor/lang/ru.js create mode 100644 admin/template/js/ckeditor/lang/sv.js create mode 100644 admin/template/js/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js create mode 100644 admin/template/js/ckeditor/plugins/a11yhelp/lang/en.js create mode 100644 admin/template/js/ckeditor/plugins/about/dialogs/about.js create mode 100644 admin/template/js/ckeditor/plugins/about/dialogs/logo_ckeditor.png create mode 100644 admin/template/js/ckeditor/plugins/adobeair/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/ajax/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/autogrow/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/bbcode/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/clipboard/dialogs/paste.js create mode 100644 admin/template/js/ckeditor/plugins/colordialog/dialogs/colordialog.js create mode 100644 admin/template/js/ckeditor/plugins/devtools/lang/en.js create mode 100644 admin/template/js/ckeditor/plugins/devtools/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/dialog/dialogDefinition.js create mode 100644 admin/template/js/ckeditor/plugins/div/dialogs/div.js create mode 100644 admin/template/js/ckeditor/plugins/docprops/dialogs/docprops.js create mode 100644 admin/template/js/ckeditor/plugins/docprops/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/find/dialogs/find.js create mode 100644 admin/template/js/ckeditor/plugins/flash/dialogs/flash.js create mode 100644 admin/template/js/ckeditor/plugins/flash/images/placeholder.png create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/button.js create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/checkbox.js create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/form.js create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/hiddenfield.js create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/radio.js create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/select.js create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/textarea.js create mode 100644 admin/template/js/ckeditor/plugins/forms/dialogs/textfield.js create mode 100644 admin/template/js/ckeditor/plugins/forms/images/hiddenfield.gif create mode 100644 admin/template/js/ckeditor/plugins/iframe/dialogs/iframe.js create mode 100644 admin/template/js/ckeditor/plugins/iframe/images/placeholder.png create mode 100644 admin/template/js/ckeditor/plugins/iframedialog/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/image/dialogs/image.js create mode 100644 admin/template/js/ckeditor/plugins/link/dialogs/anchor.js create mode 100644 admin/template/js/ckeditor/plugins/link/dialogs/link.js create mode 100644 admin/template/js/ckeditor/plugins/link/images/anchor.gif create mode 100644 admin/template/js/ckeditor/plugins/liststyle/dialogs/liststyle.js create mode 100644 admin/template/js/ckeditor/plugins/pagebreak/images/pagebreak.gif create mode 100644 admin/template/js/ckeditor/plugins/pastefromword/filter/default.js create mode 100644 admin/template/js/ckeditor/plugins/pastetext/dialogs/pastetext.js create mode 100644 admin/template/js/ckeditor/plugins/placeholder/dialogs/placeholder.js create mode 100644 admin/template/js/ckeditor/plugins/placeholder/lang/en.js create mode 100644 admin/template/js/ckeditor/plugins/placeholder/placeholder.gif create mode 100644 admin/template/js/ckeditor/plugins/placeholder/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/scayt/dialogs/options.js create mode 100644 admin/template/js/ckeditor/plugins/scayt/dialogs/toolbar.css create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_address.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_blockquote.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_div.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_h1.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_h2.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_h3.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_h4.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_h5.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_h6.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_p.png create mode 100644 admin/template/js/ckeditor/plugins/showblocks/images/block_pre.png create mode 100644 admin/template/js/ckeditor/plugins/smiley/dialogs/smiley.js create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/angel_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/angry_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/broken_heart.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/confused_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/cry_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/devil_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/embaressed_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/envelope.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/heart.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/kiss.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/lightbulb.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/omg_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/regular_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/sad_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/shades_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/teeth_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/thumbs_down.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/thumbs_up.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/tounge_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/smiley/images/wink_smile.gif create mode 100644 admin/template/js/ckeditor/plugins/specialchar/dialogs/specialchar.js create mode 100644 admin/template/js/ckeditor/plugins/specialchar/lang/en.js create mode 100644 admin/template/js/ckeditor/plugins/styles/styles/default.js create mode 100644 admin/template/js/ckeditor/plugins/stylesheetparser/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/table/dialogs/table.js create mode 100644 admin/template/js/ckeditor/plugins/tableresize/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/tabletools/dialogs/tableCell.js create mode 100644 admin/template/js/ckeditor/plugins/templates/dialogs/templates.js create mode 100644 admin/template/js/ckeditor/plugins/templates/templates/default.js create mode 100644 admin/template/js/ckeditor/plugins/templates/templates/images/template1.gif create mode 100644 admin/template/js/ckeditor/plugins/templates/templates/images/template2.gif create mode 100644 admin/template/js/ckeditor/plugins/templates/templates/images/template3.gif create mode 100644 admin/template/js/ckeditor/plugins/uicolor/dialogs/uicolor.js create mode 100644 admin/template/js/ckeditor/plugins/uicolor/lang/en.js create mode 100644 admin/template/js/ckeditor/plugins/uicolor/plugin.js create mode 100644 admin/template/js/ckeditor/plugins/uicolor/uicolor.gif create mode 100644 admin/template/js/ckeditor/plugins/uicolor/yui/assets/hue_bg.png create mode 100644 admin/template/js/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png create mode 100644 admin/template/js/ckeditor/plugins/uicolor/yui/assets/picker_mask.png create mode 100644 admin/template/js/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png create mode 100644 admin/template/js/ckeditor/plugins/uicolor/yui/assets/yui.css create mode 100644 admin/template/js/ckeditor/plugins/uicolor/yui/yui.js create mode 100644 admin/template/js/ckeditor/plugins/wsc/dialogs/ciframe.html create mode 100644 admin/template/js/ckeditor/plugins/wsc/dialogs/tmpFrameset.html create mode 100644 admin/template/js/ckeditor/plugins/wsc/dialogs/wsc.css create mode 100644 admin/template/js/ckeditor/plugins/wsc/dialogs/wsc.js create mode 100644 admin/template/js/ckeditor/plugins/xml/plugin.js create mode 100644 admin/template/js/ckeditor/skins/getsimple/dialog.css create mode 100644 admin/template/js/ckeditor/skins/getsimple/editor.css create mode 100644 admin/template/js/ckeditor/skins/getsimple/icons.png create mode 100644 admin/template/js/ckeditor/skins/getsimple/images/mini.png create mode 100644 admin/template/js/ckeditor/skins/getsimple/images/noimage.png create mode 100644 admin/template/js/ckeditor/skins/getsimple/images/sprites.png create mode 100644 admin/template/js/ckeditor/skins/getsimple/images/sprites_ie6.png create mode 100644 admin/template/js/ckeditor/skins/getsimple/skin.js create mode 100644 admin/template/js/ckeditor/skins/getsimple/templates.css create mode 100644 admin/template/js/ckeditor/themes/default/theme.js create mode 100644 admin/template/js/codemirror/lib/codemirror-compressed.js create mode 100644 admin/template/js/codemirror/lib/codemirror.css create mode 100644 admin/template/js/codemirror/theme/default.css create mode 100644 admin/template/js/fancybox/blank.gif create mode 100644 admin/template/js/fancybox/fancybox_loading.gif create mode 100644 admin/template/js/fancybox/fancybox_sprite.png create mode 100644 admin/template/js/fancybox/jquery.fancybox.css create mode 100644 admin/template/js/fancybox/jquery.fancybox.pack.js create mode 100644 admin/template/js/jcrop/Jcrop.gif create mode 100644 admin/template/js/jcrop/jquery.Jcrop.css create mode 100644 admin/template/js/jcrop/jquery.Jcrop.min.js create mode 100644 admin/template/js/jquery-scrolltofixed.js create mode 100644 admin/template/js/jquery-ui.min.js create mode 100644 admin/template/js/jquery.getsimple.js create mode 100644 admin/template/js/jquery.min.js create mode 100644 admin/template/js/uploadify/jquery.uploadify.js create mode 100644 admin/template/js/uploadify/uploadify.swf create mode 100644 admin/template/sidebar-backups.php create mode 100644 admin/template/sidebar-files.php create mode 100644 admin/template/sidebar-pages.php create mode 100644 admin/template/sidebar-plugins.php create mode 100644 admin/template/sidebar-settings.php create mode 100644 admin/template/sidebar-support.php create mode 100644 admin/template/sidebar-theme.php create mode 100644 admin/template/style.php create mode 100644 admin/theme-edit.php create mode 100644 admin/theme.php create mode 100644 admin/upload-uploadify.php create mode 100644 admin/upload.php create mode 100644 admin/uploadify-check-exists.php create mode 100644 admin/zip.php create mode 100644 backups/.htaccess create mode 100644 backups/other/components.xml.bak create mode 100644 backups/other/website.xml.bak create mode 100644 backups/pages/support.bak.xml create mode 100644 backups/pages/testing-social-media-icons.bak.xml create mode 100644 backups/users/gsthemesmaster.xml.bak create mode 100644 data/.htaccess create mode 100644 data/cache/bdb9bacf0fede7e8a56a91265c67b783.txt create mode 100644 data/cache/c49a301fb50c50accf22f2c3a295b8d3.txt create mode 100644 data/cache/e95aa6f492bb1942f1948e324f3f7165.txt create mode 100644 data/cache/f2b89b9c7f2c9d2f5fa3e87b772bb9e3.txt create mode 100644 data/cache/stylesheet.txt create mode 100644 data/other/404.xml create mode 100644 data/other/authorization.xml create mode 100644 data/other/components.xml create mode 100644 data/other/logs/errorlog.txt create mode 100644 data/other/logs/failedlogins.log create mode 100644 data/other/pages.xml create mode 100644 data/other/plugins.xml create mode 100644 data/other/website.xml create mode 100644 data/pages/index.xml create mode 100644 data/pages/styles.xml create mode 100644 data/pages/support.xml create mode 100644 data/pages/testing-social-media-icons.xml create mode 100644 data/pages/usage-hints.xml create mode 100644 data/thumbs/.htaccess create mode 100644 data/thumbs/images/thumbnail.facebook.png create mode 100644 data/thumbs/images/thumbnail.twitter.png create mode 100644 data/thumbs/images/thumbnail.youtube.png create mode 100644 data/thumbs/images/thumbsm.facebook.png create mode 100644 data/thumbs/images/thumbsm.lcars-2-line.png create mode 100644 data/thumbs/images/thumbsm.twitter.png create mode 100644 data/thumbs/images/thumbsm.youtube.png create mode 100644 data/thumbs/index.php create mode 100644 data/uploads/.htaccess create mode 100644 data/uploads/images/facebook.png create mode 100644 data/uploads/images/lcars-2-line.png create mode 100644 data/uploads/images/twitter.png create mode 100644 data/uploads/images/youtube.png create mode 100644 data/uploads/index.php create mode 100644 data/users/gsthemesmaster.xml create mode 100644 gsconfig.php create mode 100644 index.php create mode 100644 plugins/.htaccess create mode 100644 plugins/InnovationPlugin.php create mode 100644 plugins/InnovationPlugin/lang/en_US.php create mode 100644 plugins/anonymous_data.php create mode 100644 plugins/anonymous_data/lang/en_US.php create mode 100644 plugins/sa_toolbar.php create mode 100644 plugins/sa_toolbar/assets/css/.htaccess create mode 100644 plugins/sa_toolbar/assets/css/sa_toolbar.css create mode 100644 plugins/sa_toolbar/assets/img/.htaccess create mode 100644 plugins/sa_toolbar/assets/img/gsicon.png create mode 100644 plugins/sa_toolbar/assets/img/sa_tb_debugmode.png create mode 100644 plugins/sa_toolbar/inc/sa_common.php create mode 100644 readme.txt create mode 100644 robots.txt create mode 100644 sitemap.xml create mode 100644 theme/Cardinal/images/bg.png create mode 100644 theme/Cardinal/images/screenshot.png create mode 100644 theme/Cardinal/style.css create mode 100644 theme/Cardinal/template.php create mode 100644 theme/Innovation/assets/css/print.css create mode 100644 theme/Innovation/assets/css/reset.css create mode 100644 theme/Innovation/assets/images/break.png create mode 100644 theme/Innovation/assets/images/facebook.png create mode 100644 theme/Innovation/assets/images/github.png create mode 100644 theme/Innovation/assets/images/googleplus.png create mode 100644 theme/Innovation/assets/images/icons.txt create mode 100644 theme/Innovation/assets/images/instagram.png create mode 100644 theme/Innovation/assets/images/linkedin.png create mode 100644 theme/Innovation/assets/images/share.png create mode 100644 theme/Innovation/assets/images/tumblr.png create mode 100644 theme/Innovation/assets/images/twitter-alt.png create mode 100644 theme/Innovation/assets/images/twitter.png create mode 100644 theme/Innovation/assets/images/vimeo.png create mode 100644 theme/Innovation/assets/images/youtube.png create mode 100644 theme/Innovation/assets/js/dd_belatedpng.js create mode 100644 theme/Innovation/footer.inc.php create mode 100644 theme/Innovation/functions.php create mode 100644 theme/Innovation/header.inc.php create mode 100644 theme/Innovation/images/screenshot.png create mode 100644 theme/Innovation/sidebar.inc.php create mode 100644 theme/Innovation/style.css create mode 100644 theme/Innovation/template.php create mode 100644 theme/LCARS-Next-Gen/LICENSE.txt create mode 100644 theme/LCARS-Next-Gen/css/lcars.ttf create mode 100644 theme/LCARS-Next-Gen/css/print.css create mode 100644 theme/LCARS-Next-Gen/css/style.css create mode 100644 theme/LCARS-Next-Gen/functions.php create mode 100644 theme/LCARS-Next-Gen/images/screenshot-large.png create mode 100644 theme/LCARS-Next-Gen/images/screenshot.png create mode 100644 theme/LCARS-Next-Gen/rss.php create mode 100644 theme/LCARS-Next-Gen/template.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..3ed7580 --- /dev/null +++ b/.htaccess @@ -0,0 +1,61 @@ +# +# GetSimple CMS htaccess ROOT file +# apache 2.4 +# + +# The following require certain allow overrides, if getting 500 error comment them out one by one +# can be resolved in apache httpd.conf to ensure security alternatives + +# override charset +AddDefaultCharset UTF-8 + +# prevent directory listings +Options -Indexes + +# Follow symbolink links, This is required for rewrites on some hosts +Options +FollowSymLinks + +# Set the default handler. +DirectoryIndex index.php + +# blocks direct access to the XML files - they hold all the data! + + + Deny from all + + + Deny from all + + + + Require all denied + + + + + + + Allow from all + + + Allow from all + + + + Require all granted + + + + +# handle rewrites for fancy urls + + RewriteEngine on + + # Usually RewriteBase is just '/', but + # replace it with your subdirectory path + RewriteBase /GetSimpleThemes/lcars/ + + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L] + \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, 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 +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state 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 program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/admin/api.php b/admin/api.php new file mode 100644 index 0000000..a145a2e --- /dev/null +++ b/admin/api.php @@ -0,0 +1,58 @@ + 'error', 'message' => i18n_r('API_ERR_MISSINGPARAM')); + echo json_encode($message); + exit; + }; + + #step 2 - setup request + $in = simplexml_load_string($_POST['data'], 'SimpleXMLExtended', LIBXML_NOCDATA); + $request = new API_Request(); + $request->add_data($in); + + #step 3 - verify a compatible method was provided + $methods = array('page_read', 'page_save', 'all_pages_read', 'all_files_read', 'file_upload', 'settings_read' ); + if (!in_array($in->method, $methods)) { + $message = array('status' => 'error', 'message' => sprintf(i18n_r('API_ERR_BADMETHOD'), $in->method)); + echo json_encode($message); + exit; + } + + #step 4 - process request + $method = (string)$in->method; + echo call_user_func(array($request, $method), ''); + + + +exit; + +/* +---------------------------- +EXAMPLE XML FILE COMING IN +---------------------------- + + + ABCDE12345 + page_read + + + + + + + +*/ diff --git a/admin/apple-touch-icon.png b/admin/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d847119b529c487308c8aa7d9835189fa300beb7 GIT binary patch literal 1628 zcmV-i2BZ0jP)000W>0fLJSS^xk57IZ~ebVG7wVRUJ4ZXi@?ZDjy4GA}VX zFEKD2o1v@#0010xMObuGZ)S9NVRB^vL1b@YWgtdra%FdKa%*!SLsK0~S{Zx0Sp<5~xU<0cWr zG&rdfTw-cBi486&aiUNkDyt~87yV>ID8RjX4@?ZHUVYG^Jk~=lk9_d*uCNAN&K0K+Wjub%GF5e^*r%&tH^G*)UAf!P^m@4#7P%h*Qp!)HbrBAeZ06 zPl+UQQo+Kn4o7b;ma$?-nV2h=F z%wM`BuLDCm!SF%a@uus&{qpcEs*)9;(wu%$z?5|EPyr#}R_?bckA)&WiB($8hxc ziTV=|&LS`EQQPx&JA`0BS576lzP7^LqH48@)jJ#LA0DZ9{NYEZF&|lgtgyZ7-L(~P z4PLSa->8S$S6>0K1BUkRulv#rcz!P}Xuc;V7QOM>;msVbsdF+{$a)78;z zvuuW^&$W%U(XAL9yj@pbmSxSmhNOS=Gpey-Y2Q?Ek0+8;lEA^rHJ-EQFG}!v_1oCz z^&oa{6Va_l%)aA^q@nR>NV*xTXw+B@Wm&<|<0lNYEw&H~KCcHpuLrWCAe9l3%7`5) zDUBF-n*Nn~a6SGp(|XYi{>VK8Z`W@-8q{hP>5Pb7sep7wG<1YCB>(>FPiiBhtI{d_ zqaHkrb{3b@S+V7o1`Lo?t5uxn`@DX$AT zsese&5zI#xn2M$qPB~8^c2B?U+mdAEj;|B(L=vHy*}7azXGNyKXvUChK&O*6+f}Vr zsXEfZ+nHH^SyrfmnQ-LL6I7FnwGh_V>x2*tKnMm}rhmdj0IAHYouF|%kK@}^RdVgd zw}@`VObswR9m0)kU+csP7m7MGUW z#^qX)K=a7WtE@Sbsmv3q!BftY)D(sVju2|bLBo)1K=(Kt#=L7hk!+dX)u18CI$r>L z)@iuAcFWL}2}`Z`y>tytx6$4q>AdTAjQbd3vmv>&&CKwDgB4s~TcHYW8ghC1gicP3 z8=6oDZ>Ku9=GE1Sft*x8IxA8KN^CYfjBcV>+D9t$q&`T8!;WFsAT!HnAtx0eD+)FE zCwI0H`f`>j*AA{|exTMhdRBmOTgMTCmMG`ggoYzBu5CIrhn;3V%0!fC0YnM>~&-#<|7Nb)R3uoDyoVzzA>gFYKOeEhcmu0 zLv1fyzJhxX9(B}DBWMJHHnOgwsu&lh@I`o*d7sjZ+HKyra3GY8ez&-^jDT>qBh8x5 zis&C6VJ7#6{)N=C^1fat+(UzKy9U4!0>TkEcsq*45-O^SR94g_vgNXD_-yB-0&-HJ z9%uV{opmouI0Ciu%I>aIKv`A{CC+XCg;)V^#Q(`INvohs(kkeZv'.i18n_r('WEB_HEALTH_CHECK').''; +} + +get_template('header', cl($SITENAME).' » '.i18n_r('BAK_MANAGEMENT').' » '.i18n_r('WEBSITE_ARCHIVES')); + +?> + + + +
+ +
+
+

+ + + + + + + + + + '; + $count++; + } + } + + ?> +
'.$name .''.$size.'×
+

+
+
+ + + +
+ diff --git a/admin/backup-edit.php b/admin/backup-edit.php new file mode 100644 index 0000000..c3c3b8b --- /dev/null +++ b/admin/backup-edit.php @@ -0,0 +1,169 @@ +title); + $pubDate = $data->pubDate; + $parent = $data->parent; + $metak = htmldecode($data->meta); + $metad = htmldecode($data->metad); + $url = $data->url; + $content = htmldecode($data->content); + $private = $data->private; + $template = $data->template; + $menu = htmldecode($data->menu); + $menuStatus = $data->menuStatus; + $menuOrder = $data->menuOrder; +} else { + redirect('backups.php?upd=bak-err'); +} + +if ($private != '' ) { $private = '('.i18n_r('PRIVATE_SUBTITLE').')'; } else { $private = ''; } +if ($menuStatus == '' ) { $menuStatus = i18n_r('NO'); } else { $menuStatus = i18n_r('YES'); } + +// are we going to do anything with this backup? +if ($_GET['p'] != '') { + $p = $_GET['p']; +} else { + redirect('backups.php?upd=bak-err'); +} + +if ($p == 'delete') { + // check for csrf + if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { + $nonce = $_GET['nonce']; + if(!check_nonce($nonce, "delete", "backup-edit.php")) { + die("CSRF detected!"); + } + } + delete_bak($id); + redirect("backups.php?upd=bak-success&id=".$id); +} + +elseif ($p == 'restore') { + // check for csrf + if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { + $nonce = $_GET['nonce']; + if(!check_nonce($nonce, "restore", "backup-edit.php")) { + die("CSRF detected!"); + } + } + if (isset($_GET['new'])) { + updateSlugs($_GET['new'], $id); + restore_bak($id); + $existing = GSDATAPAGESPATH . $_GET['new'] .".xml"; + $bakfile = GSBACKUPSPATH."pages/". $_GET['new'] .".bak.xml"; + copy($existing, $bakfile); + unlink($existing); + redirect("edit.php?id=". $id ."&old=".$_GET['new']."&upd=edit-success&type=restore"); + } else { + restore_bak($id); + redirect("edit.php?id=". $id ."&upd=edit-success&type=restore"); + } + + +} + +get_template('header', cl($SITENAME).' » '. i18n_r('BAK_MANAGEMENT').' » '.i18n_r('VIEWPAGE_TITLE')); + +?> + + + +
+ +
+
+

+ + + + + + + + + + + + +
:
: + '. find_url($url, $parent) .''; + } + ?> +
:
:
:
:
:
+ + + +
+ + + + + + + +
+ + + +
+ diff --git a/admin/backups.php b/admin/backups.php new file mode 100644 index 0000000..e70b73e --- /dev/null +++ b/admin/backups.php @@ -0,0 +1,121 @@ +menuStatus; + $pagesArray_tmp[$count]['title'] = html_entity_decode($data->title, ENT_QUOTES, 'UTF-8'); + $pagesArray_tmp[$count]['url'] = $data->url; + $pagesArray_tmp[$count]['date'] = $data->pubDate; + $count++; + } + } + $pagesSorted = subval_sort($pagesArray_tmp,'title'); +} + +if (count($pagesSorted) != 0) +{ + foreach ($pagesSorted as $page) + { + $counter++; + $table .= ''; + + if ($page['title'] == '' ) { $page['title'] = '[No Title]  »  '. $page['url'] .''; } + + $table .= ''. cl($page['title']) .''; + $table .= ''. shtDate($page['date']) .''; + $table .= '×'; + $table .= ''; + } +} + +get_template('header', cl($SITENAME).' » '.i18n_r('BAK_MANAGEMENT')); + +?> + + + +
+ +
+
+

+ + 0) { ?> + + + + + +
+ +
+ + +

+
+
+ + + +
+ \ No newline at end of file diff --git a/admin/changedata.php b/admin/changedata.php new file mode 100644 index 0000000..f97822a --- /dev/null +++ b/admin/changedata.php @@ -0,0 +1,207 @@ +Invalid Referer
-------
"; + echo 'Invalid Referer: ' . htmlentities($_SERVER['HTTP_REFERER'], ENT_QUOTES); + die('Invalid Referer'); + } +} + +login_cookie_check(); + +if (isset($_POST['submitted'])) { + + // check for csrf + if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { + $nonce = $_POST['nonce']; + if(!check_nonce($nonce, "edit", "edit.php")) { + die("CSRF detected!"); + } + } + + if ( trim($_POST['post-title']) == '' ) { + redirect("edit.php?upd=edit-error&type=".urlencode(i18n_r('CANNOT_SAVE_EMPTY'))); + } else { + + $url="";$title="";$metad=""; $metak=""; $cont=""; + + // is a slug provided? + if ($_POST['post-id']) { + $url = trim($_POST['post-id']); + if (isset($i18n['TRANSLITERATION']) && is_array($translit=$i18n['TRANSLITERATION']) && count($translit>0)) { + $url = str_replace(array_keys($translit),array_values($translit),$url); + } + $url = to7bit($url, "UTF-8"); + $url = clean_url($url); //old way + } else { + if ($_POST['post-title']) { + $url = trim($_POST['post-title']); + if (isset($i18n['TRANSLITERATION']) && is_array($translit=$i18n['TRANSLITERATION']) && count($translit>0)) { + $url = str_replace(array_keys($translit),array_values($translit),$url); + } + $url = to7bit($url, "UTF-8"); + $url = clean_url($url); //old way + } else { + $url = "temp"; + } + } + + + //check again to see if the URL is empty + if ( trim($url) == '' ) { + $url = 'temp'; + } + + + // was the slug changed on an existing page? + if ( isset($_POST['existing-url']) ) { + if ($_POST['post-id'] != $_POST['existing-url']){ + // dont change the index page's slug + if ($_POST['existing-url'] == 'index') { + $url = $_POST['existing-url']; + redirect("edit.php?id=". urlencode($_POST['existing-url']) ."&upd=edit-index&type=edit"); + } else { + exec_action('changedata-updateslug'); + updateSlugs($_POST['existing-url']); + $file = GSDATAPAGESPATH . $url .".xml"; + $existing = GSDATAPAGESPATH . $_POST['existing-url'] .".xml"; + $bakfile = GSBACKUPSPATH."pages/". $_POST['existing-url'] .".bak.xml"; + copy($existing, $bakfile); + unlink($existing); + } + } + } + + $file = GSDATAPAGESPATH . $url .".xml"; + + // format and clean the responses + if(isset($_POST['post-title'])) { $title = safe_slash_html($_POST['post-title']); } + if(isset($_POST['post-metak'])) { $metak = safe_slash_html($_POST['post-metak']); } + if(isset($_POST['post-metad'])) { $metad = safe_slash_html($_POST['post-metad']); } + if(isset($_POST['post-author'])) { $author = safe_slash_html($_POST['post-author']); } + if(isset($_POST['post-template'])) { $template = $_POST['post-template']; } + if(isset($_POST['post-parent'])) { $parent = $_POST['post-parent']; } + if(isset($_POST['post-menu'])) { $menu = safe_slash_html($_POST['post-menu']); } + if(isset($_POST['post-menu-enable'])) { $menuStatus = "Y"; } else { $menuStatus = ""; } + if(isset($_POST['post-private']) ) { $private = safe_slash_html($_POST['post-private']); } + if(isset($_POST['post-content'])) { $content = safe_slash_html($_POST['post-content']); } + if(isset($_POST['post-menu-order'])) { + if (is_numeric($_POST['post-menu-order'])) + { + $menuOrder = $_POST['post-menu-order']; + } + else + { + $menuOrder = "0"; + } + } + // If saving a new file do not overwrite existing, get next incremental filename, file-count.xml + if ( (file_exists($file) && $url != $_POST['existing-url']) || in_array($url,$reservedSlugs) ) { + $count = "1"; + $file = GSDATAPAGESPATH . $url ."-".$count.".xml"; + while ( file_exists($file) ) { + $count++; + $file = GSDATAPAGESPATH . $url ."-".$count.".xml"; + } + $url = $url .'-'. $count; + } + + + // if we are editing an existing page, create a backup + if ( file_exists($file) ) + { + $bakfile = GSBACKUPSPATH."pages/". $url .".bak.xml"; + copy($file, $bakfile); + } + + + $xml = new SimpleXMLExtended(''); + $xml->addChild('pubDate', date('r')); + + $note = $xml->addChild('title'); + $note->addCData($title); + + $note = $xml->addChild('url'); + $note->addCData($url); + + $note = $xml->addChild('meta'); + $note->addCData($metak); + + $note = $xml->addChild('metad'); + $note->addCData($metad); + + $note = $xml->addChild('menu'); + $note->addCData($menu); + + $note = $xml->addChild('menuOrder'); + $note->addCData($menuOrder); + + $note = $xml->addChild('menuStatus'); + $note->addCData($menuStatus); + + $note = $xml->addChild('template'); + $note->addCData($template); + + $note = $xml->addChild('parent'); + $note->addCData($parent); + + $note = $xml->addChild('content'); + $note->addCData($content); + + $note = $xml->addChild('private'); + $note->addCData($private); + + $note = $xml->addChild('author'); + $note->addCData($author); + + exec_action('changedata-save'); + if (isset($_POST['autosave']) && $_POST['autosave'] == 'true' && $autoSaveDraft == true) { + XMLsave($xml, GSAUTOSAVEPATH.$url); + } else { + XMLsave($xml, $file); + } + + //ending actions + exec_action('changedata-aftersave'); + generate_sitemap(); + + // redirect user back to edit page + if (isset($_POST['autosave']) && $_POST['autosave'] == 'true') { + echo 'OK'; + } else { + + if ($_POST['redirectto']!='') { + $redirect_url = $_POST['redirectto']; + } else { + $redirect_url = 'edit.php'; + } + + if ($url == $_POST['existing-url']) { + redirect($redirect_url."?id=". $url ."&upd=edit-success&type=edit"); + } else { + redirect($redirect_url."?id=". $url ."&old=".$_POST['existing-url']."&upd=edit-success&type=edit"); + } + } + } +} else { + redirect('pages.php'); +} \ No newline at end of file diff --git a/admin/components.php b/admin/components.php new file mode 100644 index 0000000..8ba98fd --- /dev/null +++ b/admin/components.php @@ -0,0 +1,162 @@ +'); + if (count($ids) != 0) { + + $ct = 0; $coArray = array(); + foreach ($ids as $id) { + if ($title[$ct] != null) { + if ( $slug[$ct] == null ) { + $slug_tmp = to7bit($title[$ct], 'UTF-8'); + $slug[$ct] = clean_url($slug_tmp); + $slug_tmp = ''; + } + + $coArray[$ct]['id'] = $ids[$ct]; + $coArray[$ct]['slug'] = $slug[$ct]; + $coArray[$ct]['title'] = safe_slash_html($title[$ct]); + $coArray[$ct]['value'] = safe_slash_html($value[$ct]); + + } + $ct++; + } + + $ids = subval_sort($coArray,'title'); + + $count = 0; + foreach ($ids as $comp) { + # create the body of components.xml file + $components = $xml->addChild('item'); + $c_note = $components->addChild('title'); + $c_note->addCData($comp['title']); + $components->addChild('slug', $comp['slug']); + $c_note = $components->addChild('value'); + $c_note->addCData($comp['value']); + $count++; + } + } + exec_action('component-save'); + XMLsave($xml, $path . $file); + redirect('components.php?upd=comp-success'); +} + +# if undo was invoked +if (isset($_GET['undo'])) { + + # check for csrf + $nonce = $_GET['nonce']; + if(!check_nonce($nonce, "undo")) { + die("CSRF detected!"); + } + + # perform the undo + undo($file, $path, $bakpath); + redirect('components.php?upd=comp-restored'); +} + +# create components form html +$data = getXML($path . $file); +$componentsec = $data->item; +$count= 0; +if (count($componentsec) != 0) { + foreach ($componentsec as $component) { + $table .= '
'; + $table .= '
'. stripslashes($component->title) .'<?php get_component(\''.$component->slug.'\'); ?>'; + $table .= '×
'; + $table .= ''; + $table .= ''; + $table .= ''; + $table .= ''; + exec_action('component-extras'); + $table .= '
'; + $count++; + } +} + # create list to show on sidebar for easy access + $listc = ''; $submitclass = ''; + if($count > 1) { + $item = 0; + foreach($componentsec as $component) { + $listc .= '' . $component->title . ''; + $item++; + } + } elseif ($count == 0) { + $submitclass = 'hidden'; + + } + +get_template('header', cl($SITENAME).' » '.i18n_r('COMPONENTS')); + +?> + + + +
+ +
+
+

+
+ +
+
+ +
+ + " /> + +
+ +

+      +

+
+
+
+ + '; } ?> +
+ + + \ No newline at end of file diff --git a/admin/cron.php b/admin/cron.php new file mode 100644 index 0000000..1f84bab --- /dev/null +++ b/admin/cron.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/admin/deletefile.php b/admin/deletefile.php new file mode 100644 index 0000000..e524e1f --- /dev/null +++ b/admin/deletefile.php @@ -0,0 +1,72 @@ +title); + $pubDate = $data_edit->pubDate; + $metak = stripslashes($data_edit->meta); + $metad = stripslashes($data_edit->metad); + $url = $data_edit->url; + $content = stripslashes($data_edit->content); + $template = $data_edit->template; + $parent = $data_edit->parent; + $author = $data_edit->author; + $menu = stripslashes($data_edit->menu); + $private = $data_edit->private; + $menuStatus = $data_edit->menuStatus; + $menuOrder = $data_edit->menuOrder; + $buttonname = i18n_r('BTN_SAVEUPDATES'); +} else { + // prefill fields is provided + $title = isset( $_GET['title'] ) ? var_out( $_GET['title'] ) : ''; + $template = isset( $_GET['template'] ) ? var_out( $_GET['template'] ) : ''; + $parent = isset( $_GET['parent'] ) ? var_out( $_GET['parent'] ) : ''; + $menu = isset( $_GET['menu'] ) ? var_out( $_GET['menu'] ) : ''; + $private = isset( $_GET['private'] ) ? var_out( $_GET['private'] ) : ''; + $menuStatus = isset( $_GET['menuStatus'] ) ? var_out( $_GET['menuStatus'] ) : ''; + $menuOrder = isset( $_GET['menuOrder'] ) ? var_out( $_GET['menuOrder'] ) : ''; + $buttonname = i18n_r('BTN_SAVEPAGE'); +} + + +// MAKE SELECT BOX OF AVAILABLE TEMPLATES +if ($template == '') { $template = 'template.php'; } + +$themes_path = GSTHEMESPATH . $TEMPLATE; +$themes_handle = opendir($themes_path) or die("Unable to open ". GSTHEMESPATH); +while ($file = readdir($themes_handle)) { + if( isFile($file, $themes_path, 'php') ) { + if ($file != 'functions.php' && substr(strtolower($file),-8) !='.inc.php' && substr($file,0,1)!=='.') { + $templates[] = $file; + } + } +} + +sort($templates); + +foreach ($templates as $file){ + if ($template == $file) { + $sel="selected"; + } else{ + $sel=""; + } + + if ($file == 'template.php'){ + $templatename=i18n_r('DEFAULT_TEMPLATE'); + } else { + $templatename=$file; + } + + $theme_templates .= ''; +} + +// SETUP CHECKBOXES +$sel_m = ($menuStatus != '') ? 'checked' : '' ; +$sel_p = ($private == 'Y') ? 'selected' : '' ; +if ($menu == '') { $menu = $title; } + +get_template('header', cl($SITENAME).' » '.i18n_r('EDIT').' '.$title); + +?> + + + + + +
+ +
+
+ +

+ + +
+ ', i18n_r('VIEW'), ' '; + } + ?> + +
+
+ +
+ " /> + + + +

+ + +

+ + + + + + + +

+ + +

+ + + + '; + } ?> + + +
+ + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + +
+
+ + + + +
+ diff --git a/admin/favicon.png b/admin/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..e505082d30232faf1a4607b004144657f8847a07 GIT binary patch literal 557 zcmV+|0@D47P)000W>0fLJSS^xk57IZ~ebVG7wVRUJ4ZXi@?ZDjy4GA}VX zFEKD2o1v@#0010xMObuGZ)S9NVRB^vL1b@YWgtdra%FdKa%*!SLsKdSHE6dp2 zSchpC0Dy}t502{r0CL$3jt}<}@4ge_)ILLBYd}cFo!TCU@`I3ltx1ygMw3D+_O)hT zYt|c0`awA6K}f|Yj!BZGa)m-FmdX{9WE95~QYCTTDl%^s=?5WOcAG*fri4^{eR)Rr z@d>4J<0FLXSw!01Q@*LMUx5#BPFs7ye08!M# zQegpxX&{PvFwMbv-0O`Hgj8(V?Xl6XZ*G$=ExSE7eiX-Ct8R^!_<3PgVG({OglQO< v%Vywr!o-`IPDAUr!TW#cOM##2@BhL(H9I3M8*8a=00000NkvXXu0mjfCr9LQ literal 0 HcmV?d00001 diff --git a/admin/filebrowser.php b/admin/filebrowser.php new file mode 100644 index 0000000..bc67fcb --- /dev/null +++ b/admin/filebrowser.php @@ -0,0 +1,202 @@ + + + + + + <?php echo i18n_r('FILE_BROWSER'); ?> + + + + + + +
+
+
+

  /  

+/ uploads / '; + foreach ($pathParts as $pathPart){ + if ($pathPart!=''){ + $urlPath.=$pathPart."/"; + echo ''.$pathPart.' / '; + } + } + echo "
"; + + echo ''; + + if (count($dirsSorted) != 0) { + foreach ($dirsSorted as $upload) { + echo ''; + echo ''; + echo ''; + } + } + + if (count($filesSorted) != 0) { + foreach ($filesSorted as $upload) { + $upload['name'] = rawurlencode($upload['name']); + $thumb = null; $thumbnailLink = null; + $subDir = ($subPath == '' ? '' : $subPath.'/'); + $selectLink = 'title="'.i18n_r('SELECT_FILE').': '. htmlspecialchars($upload['name']) .'" href="javascript:void(0)" onclick="submitLink('.$CKEditorFuncNum.',\''.$fullPath.$subDir.$upload['name'].'\')"'; + + if ($type == 'images') { + if ($upload['type'] == i18n_r('IMAGES') .' Images') { + # get internal thumbnail to show beside link in table + $thumb = ''; + + # get external thumbnail link + $thumbLinkExternal = 'data/thumbs/'.$urlPath.'thumbnail.'.$upload['name']; + if (file_exists('../'.$thumbLinkExternal)) { + $thumbnailLink = ' –  '.i18n_r('THUMBNAIL').''; + } + } + else { continue; } + } + + $counter++; + + echo ''; + echo ($thumb=='' ? '' : $thumb); + echo ''; + echo ''; + + // get the file permissions. + if ($isUnixHost && isDebug() && function_exists('posix_getpwuid')) { + $filePerms = substr(sprintf('%o', fileperms($path.$upload['name'])), -4); + $fileOwner = posix_getpwuid(fileowner($path.$upload['name'])); + echo ''; + } + + echo ''; + echo ''; + } + + } + echo '
'; + $adm = substr($path . $upload['name'] , 16); + if ($returnid!='') { + $returnlink = '&returnid='.$returnid; + } else { + $returnlink=''; + } + if ($func!='') { + $funct = '&func='.$func; + } else { + $funct=''; + } + echo ' '.$upload['name'].''; + echo '
'; + $thumbLink = $urlPath.'thumbsm.'.$upload['name']; + if (file_exists('../data/thumbs/'.$thumbLink)) { + $imgSrc=''; + } else { + $imgSrc=''; + } + $thumb .= ''.$imgSrc.''; + $thumb .= '
'.htmlspecialchars($upload['name']) .''.$thumbnailLink.''. $upload['size'] .''.$fileOwner['name'].'/'.$filePerms.''. shtDate($upload['date']) .'
'; + echo '

'. $counter .' '.i18n_r('TOTAL_FILES').' ('. fSize($totalsize) .')

'; +?> +
+
+ + + diff --git a/admin/health-check.php b/admin/health-check.php new file mode 100644 index 0000000..6c643cd --- /dev/null +++ b/admin/health-check.php @@ -0,0 +1,378 @@ + + + + +
+ +
+
+

+ + status; + } else { + $verstatus = null; + } + if ($verstatus == '0') { + $ver = ''.$site_version_no.'
'. i18n_r('UPG_NEEDED').' ('.$apikey->latest .')
'. i18n_r('DOWNLOAD').'
'; + } elseif ($verstatus == '1') { + $ver = ''.$site_version_no.'
'. i18n_r('LATEST_VERSION').'
'; + } elseif ($verstatus == '2') { + $ver = ''.$site_version_no.'
'. i18n_r('BETA').'
'; + } else { + $ver = ''.$site_version_no.'
'. i18n_r('CANNOT_CHECK').'
'. i18n_r('DOWNLOAD').'
'; + } + ?> + + '; + + if(defined('GSLOGINSALT') && GSLOGINSALT!='') echo ''; + else echo ''; + + if(defined('GSUSECUSTOMSALT') && GSUSECUSTOMSALT!='') echo ''; + else echo ''; + ?> +
GSADMIN'.GSADMIN.'
GSLOGINSALT'. i18n_r('YES').'
GSLOGINSALT'. i18n_r('NO').'
GSUSECUSTOMSALT'. i18n_r('YES').'
GSUSECUSTOMSALT'. i18n_r('NO').'
+ +

+ + '; + } else { + echo 'PHP '.i18n_r('VERSION').''; + } + + if (in_arrayi('curl', $php_modules) && function_exists('curl_init') && function_exists('curl_exec')) { + echo ''; + } else{ + echo ''; + } + if (in_arrayi('gd', $php_modules) ) { + echo ''; + } else{ + echo ''; + } + if (in_arrayi('zip', $php_modules) ) { + echo ''; + } else{ + echo ''; + } + if (! in_arrayi('SimpleXML', $php_modules) ) { + echo ''; + } else { + echo ''; + } + if (!function_exists('chmod') ) { + echo ''; + } else { + echo ''; + } + + if (server_is_apache()) { + echo ''; + if ( function_exists('apache_get_modules') ) { + if(! in_arrayi('mod_rewrite',apache_get_modules())) { + echo ''; + } else { + echo ''; + } + } else { + echo ''; + } + } else { + if (!defined('GSNOAPACHECHECK') || GSNOAPACHECHECK == false) { + echo ''; + } + } + + $disabled_funcs = ini_get('disable_functions'); + if(!empty($disabled_funcs)) echo ''; + ?> +
+ '. PHP_VERSION.' - PHP 5.2 '.i18n_r('OR_GREATER_REQ').' - '.i18n_r('ERROR').'
'. PHP_VERSION.' - '.i18n_r('OK').'
cURL Module'.i18n_r('INSTALLED').' - '.i18n_r('OK').'
cURL Module'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'
GD Library'.i18n_r('INSTALLED').' - '.i18n_r('OK').'
GD Library'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'
ZipArchive'.i18n_r('INSTALLED').' - '.i18n_r('OK').'
ZipArchive'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'
SimpleXML Module'.i18n_r('NOT_INSTALLED').' - '.i18n_r('ERROR').'
SimpleXML Module'.i18n_r('INSTALLED').' - '.i18n_r('OK').'
chmod'.i18n_r('NOT_INSTALLED').' - '.i18n_r('ERROR').'
chmodchmod - '.i18n_r('OK').'
Apache Web Server'.$_SERVER['SERVER_SOFTWARE'].' - '.i18n_r('OK').'
Apache Mod Rewrite'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'
Apache Mod Rewrite'.i18n_r('INSTALLED').' - '.i18n_r('OK').'
Apache Mod Rewrite'.i18n_r('INSTALLED').' - '.i18n_r('OK').'
Apache web server'.$_SERVER['SERVER_SOFTWARE'].' - '.i18n_r('ERROR').'
PHP disable_functions ' . $disabled_funcs . '
+

+ +

+ + '; + } + } + + $path = GSDATAOTHERPATH; + $data = getFiles($path); + sort($data); + foreach($data as $file) { + if( isFile($file, $path) ) { + echo ''; + } + } + + $path = GSDATAOTHERPATH.'logs/'; + $data = getFiles($path); + sort($data); + foreach($data as $file) { + if( isFile($file, $path, '.log') ) { + echo ''; + } + } + + $path = GSUSERSPATH; + $data = getFiles($path); + sort($data); + foreach($data as $file) { + if( isFile($file, $path) ) { + echo ''; + } + } + ?> +
/data/pages/' . $file .'' . valid_xml($path . $file) .'
/data/other/' . $file .'' . valid_xml($path . $file) .'
/data/other/logs/' . $file .'' . valid_xml($path . $file) .'
/backups/users/' . $file .'' . valid_xml($path . $file) .'
+ +

+ + + + + + + + + + + + + +
: /data/other/plugins.xml= '0644' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/data/pages/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/data/other/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/data/other/logs/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/data/thumbs/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/data/uploads/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/data/users/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/data/cache/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/backups/zip/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/backups/pages/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/backups/other/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
/backups/users/= '0755' ) { echo ''. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').''; } else { echo ''. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!'; } ?>
+ + +

+ + + + + + + + + + + + + + + + + + + + +
/data/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Deny from all')) { + echo ''.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ''.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/data/uploads/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Allow from all')) { + echo ' '.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ' '.i18n_r('GOOD_A_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/data/users/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Deny from all')) { + echo ''.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ''.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/data/cache/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Deny from all')) { + echo ''.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ''.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/data/thumbs/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Allow from all')) { + echo ' '.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ' '.i18n_r('GOOD_A_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/data/pages/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Deny from all')) { + echo ' '.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ' '.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/plugins/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Deny from all')) { + echo ' '.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ' '.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/data/other/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Deny from all')) { + echo ' '.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ' '.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/data/other/logs/ + '.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').''; + } else { + $res = file_get_contents($file); + if ( !strstr($res, 'Deny from all')) { + echo ' '.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').''; + } else { + echo ' '.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').''; + } + } + ?> +
/theme/ + '.i18n_r('CANNOT_DEL_FILE').' - '.i18n_r('ERROR').''; + } else { + echo ' '.i18n_r('NO_FILE').' - '.i18n_r('OK').''; + } + ?> +
+ +
+ +
+ + + +
+ \ No newline at end of file diff --git a/admin/humans.txt b/admin/humans.txt new file mode 100644 index 0000000..d77f233 --- /dev/null +++ b/admin/humans.txt @@ -0,0 +1,31 @@ +/* TEAM */ + Founder & Developer: Chris Cagle + Forum Handle: ccagle8 + Site: http://chriscagle.me/ + Twitter: @ccagle8 + Location: Pittsburgh, Pennsylvania, USA + + Developer: Mike Swan + Forum Handle: n00dles101 + Site: http://www.digimute.com/ + Twitter: @digimute + Location: Dublin, Ireland + + Developer: Matthew Phillips + Forum Handle: OWS_Matthew + Site: http://www.owassowebsolutions.com/ + Location: Owasso, Oklahoma, USA + + Developer: Shawn Alverson + Forum Handle: shawn_a + Site: http://shawnalverson.com/ + Location: Tennessee, USA + +/* THANKS */ + Carlos Navarro (cnb) + Joshas + Connie Connie Müller-Gödecke (Connie) + Thorsten Panknin (polyfragmented) + Mike Henken (MikeH) + Martijn van der Ven (Zegnåt) + ...and the countless others on the forums and SVN that help us make this amazing product possible. diff --git a/admin/image.php b/admin/image.php new file mode 100644 index 0000000..5424478 --- /dev/null +++ b/admin/image.php @@ -0,0 +1,147 @@ +imageok ) { + $objImage->setCrop($_POST['x'], $_POST['y'], $_POST['w'], $_POST['h']); + //$objImage->show(); + $objImage->save($thumb_folder . 'thumbnail.' .$src); + $success = i18n_r('THUMB_SAVED'); + } else { + i18n('ERROR'); + } +} + +$thumb_exists = $thwidth = $thheight = $thtype = $athttr = ''; + +list($imgwidth, $imgheight, $imgtype, $imgattr) = getimagesize($src_folder .$subPath. $src); + +if (file_exists($thumb_folder . 'thumbnail.' . $src)) { + list($thwidth, $thheight, $thtype, $athttr) = getimagesize($thumb_folder . 'thumbnail.'.$src); + $thumb_exists = '   |   '.i18n_r('CURRENT_THUMBNAIL').' '.$thwidth.'x'.$thheight.''; +}else{ + // if thumb is missing recreate it + require_once('inc/imagemanipulation.php'); + if(genStdThumb($subPath,$src)){ + list($thwidth, $thheight, $thtype, $athttr) = getimagesize($thumb_folder . 'thumbnail.'.$src); + $thumb_exists = '   |   '.i18n_r('CURRENT_THUMBNAIL').' '.$thwidth.'x'.$thheight.''; + } +} + +get_template('header', cl($SITENAME).' » '.i18n_r('FILE_MANAGEMENT').' » '.i18n_r('IMAGES')); + +include('template/include-nav.php'); ?> + +
+
+ +
+

+ + '.i18n_r('ORIGINAL_IMG').' '.$imgwidth.'x'.$imgheight .''. $thumb_exists .'

'; ?> + +
+ + +

+
+
+

<img src="" class="gs_image" height="" width="" alt="">

+ + +

<img src="" class="gs_image gs_thumb" height="" width="" alt="">

+ +

<a href="" class="gs_image_link" ><img src="" class="gs_thumb" height="" width="" alt="" /></a>

+ +
+
+ + +
+ +

x
+ +
+ + + + +   + +
+
+ + +
+ + + + + +
+ diff --git a/admin/inc/ZipArchive.php b/admin/inc/ZipArchive.php new file mode 100644 index 0000000..d2aea70 --- /dev/null +++ b/admin/inc/ZipArchive.php @@ -0,0 +1,804 @@ + + * The file name of the ZIP archive to open. + *

+ * @param flags int[optional]

+ * The mode to use to open the archive. + *

+ * ZIPARCHIVE::OVERWRITE + *

+ * @return mixed Error codes + *

+ * Returns true on success or the error code. + *

+ * ZIPARCHIVE::ER_EXISTS + *

+ *

+ * ZIPARCHIVE::ER_INCONS + *

+ *

+ * ZIPARCHIVE::ER_INVAL + *

+ *

+ * ZIPARCHIVE::ER_MEMORY + *

+ *

+ * ZIPARCHIVE::ER_NOENT + *

+ *

+ * ZIPARCHIVE::ER_NOZIP + *

+ *

+ * ZIPARCHIVE::ER_OPEN + *

+ *

+ * ZIPARCHIVE::ER_READ + *

+ *

+ * ZIPARCHIVE::ER_SEEK + *

+ *

+ */ + public function open ($filename, $flags = null) { + + if( is_dir($filename) ){ + return self::ER_NOZIP; + } + + //if zip file exists already exists + if( is_file($filename) ){ + + if( !is_readable($filename) ){ + return self::ER_READ; + } + + //if user asked for error then return it + if( $flags & self::EXCL ){ + return self::ER_EXISTS; + } + //if need to create new file but overwrite flag is not defined + if(($flags & self::CREATE) && !($flags & self::OVERWRITE) ){ + return self::ER_EXISTS; + } + } + + //if overwrite then remove file + if($flags & self::OVERWRITE){ + if( is_file($filename) ){ + if ( !(@unlink($filename)) ){ + return self::ER_READ; + } + } + } + + + //create/extract directory layout in temporary folder + + + //create temp dir + $tempDir = sys_get_temp_dir(); + if( $tempDir[strlen($tempDir)-1] != DIRECTORY_SEPARATOR ){ + $tempDir = $tempDir . DIRECTORY_SEPARATOR; + } + $this->tempDirPath = $tempDir.__CLASS__. uniqid(); + if( @mkdir($this->tempDirPath) !== true ) { + return self::ER_OPEN; + } + + if( is_file($filename) ){ + //extract zip file to tempDir + if( !$this->__extractTo($filename,$this->tempDirPath) ){ + return self::ER_OPEN; + } + } + + if($filename[0] == '/'){ + $this->zipFilePath = $filename; + }else{ + $this->zipFilePath = getcwd() .DIRECTORY_SEPARATOR. $filename; + } + $this->zip_is_open = true; + + return true; + } + + /** + * Close the active archive (opened or newly created) + * @link http://php.net/manual/en/function.ziparchive-close.php + * @return bool Returns true on success or false on failure. + */ + public function close () { + if(!$this->zip_is_open){ + return false; + } + + + if( strtolower(substr($this->zipFilePath, strlen($this->zipFilePath)-4)) == ".zip" ){ + //if $this->zipFilePath has .zip in the end then use this path for zip + $target_zip_file = $this->zipFilePath; + }else{ + //else use {$this->tempDirPath}.zip as zip file and then move it to final location + $target_zip_file = $this->tempDirPath . ".zip"; + } + + + $currentWorkingDir = getcwd(); + if( @chdir($this->tempDirPath) !== True){ + //unable to chdir to temp directory + return false; + } + + exec(self::$zip_exec." -m -r {$target_zip_file} * 2>&1", $output, $return_value); + chdir($currentWorkingDir); + + if($target_zip_file != $this->zipFilePath){ + if( @rename($target_zip_file, $this->zipFilePath) !== true){ + //if unable to copy zip to final destination then return false + return false; + } + } + + if($return_value != 0){ + return false; + } + + //remove trailing tempdir + @rmdir($this->tempDirPath); + + //do cleanup + $this->zip_is_open = false; + $this->zipFilePath = ""; + $this->tempDirPath = ""; + $this->fileIndex = array(); + + return true; + } + + /** + * Add a new directory + * @link http://php.net/manual/en/function.ziparchive-addemptydir.php + * @param dirname string

+ * The directory to add. + *

+ * @return bool Returns true on success or false on failure. + */ + public function addEmptyDir ($dirname) { + if(!$this->zip_is_open){ + return false; + } + return mkdir($this->tempDirPath .DIRECTORY_SEPARATOR. $dirname ); + } + + /** + * Add a file to a ZIP archive using its contents + * @link http://php.net/manual/en/function.ziparchive-addfromstring.php + * @param localname string

+ * The name of the entry to create. + *

+ * @param contents string

+ * The contents to use to create the entry. It is used in a binary + * safe mode. + *

+ * @return bool Returns true on success or false on failure. + */ + public function addFromString ($localname, $contents) { + if(!$this->zip_is_open){ + return false; + } + $target_dir = $this->tempDirPath .DIRECTORY_SEPARATOR. dirname($localname); + $taget_file = basename($localname); + + //create directory if it does not exist + if( ! is_dir($target_dir) ){ + if(! mkdir($target_dir,0777,true) ){ + return false; + } + } + //create file from string + if( file_put_contents($target_dir.DIRECTORY_SEPARATOR.$taget_file,$contents) === False){ + return false; + } + return true; + } + + /** + * Adds a file to a ZIP archive from the given path + * @link http://php.net/manual/en/function.ziparchive-addfile.php + * @param filename string

+ * The path to the file to add. + *

+ * @param localname string[optional]

+ * local name inside ZIP archive. + *

+ * @return bool Returns true on success or false on failure. + */ + public function addFile ($filename, $localname = null) {} + + /** + * Renames an entry defined by its index + * @link http://php.net/manual/en/function.ziparchive-renameindex.php + * @param index int

+ * Index of the entry to rename. + *

+ * @param newname string

+ * New name. + *

+ * @return bool Returns true on success or false on failure. + */ + public function renameIndex ($index, $newname) {} + + /** + * Renames an entry defined by its name + * @link http://php.net/manual/en/function.ziparchive-renamename.php + * @param name string

+ * Name of the entry to rename. + *

+ * @param newname string

+ * New name. + *

+ * @return bool Returns true on success or false on failure. + */ + public function renameName ($name, $newname) {} + + /** + * Set the comment of a ZIP archive + * @link http://php.net/manual/en/function.ziparchive-setarchivecomment.php + * @param comment string

+ * The contents of the comment. + *

+ * @return mixed Returns true on success or false on failure. + */ + public function setArchiveComment ($comment) {} + + /** + * Returns the Zip archive comment + * @link http://php.net/manual/en/function.ziparchive-getarchivecomment.php + * @return string the Zip archive comment or false on failure. + */ + public function getArchiveComment () {} + + /** + * Set the comment of an entry defined by its index + * @link http://php.net/manual/en/function.ziparchive-setcommentindex.php + * @param index int

+ * Index of the entry. + *

+ * @param comment string

+ * The contents of the comment. + *

+ * @return mixed Returns true on success or false on failure. + */ + public function setCommentIndex ($index, $comment) {} + + /** + * Set the comment of an entry defined by its name + * @link http://php.net/manual/en/function.ziparchive-setCommentName.php + * @param name string

+ * Name of the entry. + *

+ * @param comment string

+ * The contents of the comment. + *

+ * @return mixed Returns true on success or false on failure. + */ + public function setCommentName ($name, $comment) {} + + /** + * Returns the comment of an entry using the entry index + * @link http://php.net/manual/en/function.ziparchive-getcommentindex.php + * @param index int

+ * Index of the entry + *

+ * @param flags int[optional]

+ * If flags is set to ZIPARCHIVE::FL_UNCHANGED, the original unchanged + * comment is returned. + *

+ * @return string the comment on success or false on failure. + */ + public function getCommentIndex ($index, $flags = null) {} + + /** + * Returns the comment of an entry using the entry name + * @link http://php.net/manual/en/function.ziparchive-getcommentname.php + * @param name string

+ * Name of the entry + *

+ * @param flags int[optional]

+ * If flags is set to ZIPARCHIVE::FL_UNCHANGED, the original unchanged + * comment is returned. + *

+ * @return string the comment on success or false on failure. + */ + public function getCommentName ($name, $flags = null) {} + + /** + * delete an entry in the archive using its index + * @link http://php.net/manual/en/function.ziparchive-deleteindex.php + * @param index int

+ * Index of the entry to delete. + *

+ * @return bool Returns true on success or false on failure. + */ + public function deleteIndex ($index) {} + + /** + * delete an entry in the archive using its name + * @link http://php.net/manual/en/function.ziparchive-deletename.php + * @param name string

+ * Name of the entry to delete. + *

+ * @return bool Returns true on success or false on failure. + */ + public function deleteName ($name) {} + + /** + * Get the details of an entry defined by its name. + * @link http://php.net/manual/en/function.ziparchive-statname.php + * @param name name

+ * Name of the entry + *

+ * @param flags int[optional]

+ * The flags argument specifies how the name lookup should be done. + * Also, ZIPARCHIVE::FL_UNCHANGED may be ORed to it to request + * information about the original file in the archive, + * ignoring any changes made. + *

+ * ZIPARCHIVE::FL_NOCASE + *

+ * @return mixed an array containing the entry details or false on failure. + */ + public function statName ($name, $flags = null) {} + + /** + * Get the details of an entry defined by its index. + * @link http://php.net/manual/en/function.ziparchive-statindex.php + * @param index int

+ * Index of the entry + *

+ * @param flags int[optional]

+ * ZIPARCHIVE::FL_UNCHANGED may be ORed to it to request + * information about the original file in the archive, + * ignoring any changes made. + *

+ * @return mixed an array containing the entry details or false on failure. + */ + public function statIndex ($index, $flags = null) {} + + /** + * Returns the index of the entry in the archive + * @link http://php.net/manual/en/function.ziparchive-locatename.php + * @param name string

+ * The name of the entry to look up + *

+ * @param flags int[optional]

+ * The function returns the index of the file named fname in + * archive. The flags are specified by ORing the following values, + * or 0 for none of them. + *

+ * ZIPARCHIVE::FL_NOCASE + *

+ * @return mixed the index of the entry on success or false on failure. + */ + public function locateName ($name, $flags = null) { + if(!$this->zip_is_open){ + return false; + } + $noDir = ($flags & self::FL_NODIR) ? true:false; + $noCase = ($flags & self::FL_NOCASE) ? true:false; + + $loopFile = ($noDir) ? basename($name) : $name ; + if($noCase){ + $search = strtolower($search); + } + foreach($this->fileIndex as $ind => $fileRelPath){ + $loopFile = ($noDir) ? basename($fileRelPath) : $fileRelPath ; + if($noCase){ + $loopFile = strtolower($loopFile); + } + if( $loopFile == $search ){ + return $ind; + } + } + } + + /** + * Returns the name of an entry using its index + * @link http://php.net/manual/en/function.ziparchive-getnameindex.php + * @param index int

+ * Index of the entry. + *

+ * @return string the name on success or false on failure. + */ + public function getNameIndex ($index) { + if(!$this->zip_is_open){ + return false; + } + if(! is_set($this->fileIndex[$index]) ){ + return false; + } + return $this->fileIndex[$index]; + } + + /** + * Revert all global changes done in the archive. + * @link http://php.net/manual/en/function.ziparchive-unchangearchive.php + * @return mixed Returns true on success or false on failure. + */ + public function unchangeArchive () {} + + /** + * Undo all changes done in the archive. + * @link http://php.net/manual/en/function.ziparchive-unchangeall.php + * @return mixed Returns true on success or false on failure. + */ + public function unchangeAll () {} + + /** + * Revert all changes done to an entry at the given index. + * @link http://php.net/manual/en/function.ziparchive-unchangeindex.php + * @param index int

+ * Index of the entry. + *

+ * @return mixed Returns true on success or false on failure. + */ + public function unchangeIndex ($index) {} + + /** + * Revert all changes done to an entry with the given name. + * @link http://php.net/manual/en/function.ziparchive-unchangename.php + * @param name string

+ * Name of the entry. + *

+ * @return mixed Returns true on success or false on failure. + */ + public function unchangeName ($name) {} + + /** + * Extract the archive contents + * @link http://php.net/manual/en/function.ziparchive-extractto.php + * @param destination string

+ * Location where to extract the files. + *

+ * @param entries mixed[optional]

+ * The entries to extract. It accepts either a single entry name or + * an array of names. + *

+ * @return mixed Returns true on success or false on failure. + */ + public function extractTo ($destination, $entries = null) { + if(!$this->zip_is_open){ + return false; + } + return $this->__extractTo($this->zipFilePath, $destination, $entries); + } + + private function __extractTo($zip_path, $destination, $entries = null) { + $return_value=0; + $output = array(); + + //determine list of files to extract + $list = ""; + if( is_string($entries) ){ + $list = "'$entries'"; + } + if(is_array($entries)){ + $list = "'".implode("' '", $entries)."'"; + } + + exec(self::$unzip_exec." -o {$zip_path} -d {$destination} {$list} 2>&1", $output, $return_value); + + if($return_value != 0){ + return false; + } + return true; + } + /** + * Returns the entry contents using its name. + * @link http://php.net/manual/en/function.ziparchive-getfromname.php + * @param name string

+ * Name of the entry + *

+ * @param flags int[optional]

+ * The flags to use to open the archive. the following values may + * be ORed to it. + *

+ * ZIPARCHIVE::FL_UNCHANGED + *

+ * @return mixed the contents of the entry on success or false on failure. + */ + public function getFromName ($name, $flags = null) { + if(!$this->zip_is_open){ + return false; + } + return @file_get_contents($this->tempDirPath .DIRECTORY_SEPARATOR. $name ); + } + + /** + * Returns the entry contents using its index. + * @link http://php.net/manual/en/function.ziparchive-getfromindex.php + * @param index int

+ * Index of the entry + *

+ * @param flags int[optional]

+ * The flags to use to open the archive. the following values may + * be ORed to it. + *

+ * ZIPARCHIVE::FL_UNCHANGED + *

+ * @return mixed the contents of the entry on success or false on failure. + */ + public function getFromIndex ($index, $flags = null) { + if(!$this->zip_is_open){ + return false; + } + $localFilePath = $this->getNameIndex($index); + if($localFilePath === false){ + return false; + } + return $this->getFromName($localFilePath); + } + + /** + * Get a file handler to the entry defined by its name (read only). + * @link http://php.net/manual/en/function.ziparchive-getstream.php + * @param name string

+ * The name of the entry to use. + *

+ * @return resource a file pointer (resource) on success or false on failure. + */ + public function getStream ($name) {} + + /** + * + * @param $dir_path absolute path to zip directory + */ + private function __indexDirRec($dir_path){ + $dirEntries = scandir($dir_path); + + foreach($dirEntries as $dirEntriy){ + if( $dirEntriy == "." || $dirEntriy == ".."){ + continue; + } + $subject = $dir_path .DIRECTORY_SEPARATOR. $dirEntriy; + + //if this is directory then index its contents + if( is_dir($subject) ){ + $this->__indexDirRec($subject); + }else{ + //save path as relative path inside zip + $this->fileIndex[] = str_replace($this->tempDirPath.DIRECTORY_SEPARATOR, "", $subject); + } + } + } +} + +ZipArchive::setup(); //try to find locations of zip/unzip binaries + +/** + * Open a ZIP file archive + * @link http://php.net/manual/en/function.zip-open.php + * @param filename string

+ * The file name of the ZIP archive to open. + *

+ * @return mixed a resource handle for later use with + * zip_read and zip_close + * or returns the number of error if filename does not + * exist or in case of other error. + */ +function zip_open ($filename) {} + +/** + * Close a ZIP file archive + * @link http://php.net/manual/en/function.zip-close.php + * @param zip resource

+ * A ZIP file previously opened with zip_open. + *

+ * @return void + */ +function zip_close ($zip) {} + +/** + * Read next entry in a ZIP file archive + * @link http://php.net/manual/en/function.zip-read.php + * @param zip resource

+ * A ZIP file previously opened with zip_open. + *

+ * @return mixed a directory entry resource for later use with the + * zip_entry_... functions or false if + * there's no more entries to read or number of error in case of other error. + */ +function zip_read ($zip) {} + +/** + * Open a directory entry for reading + * @link http://php.net/manual/en/function.zip-entry-open.php + * @param zip resource

+ * A valid resource handle returned by zip_open. + *

+ * @param zip_entry resource

+ * A directory entry returned by zip_read. + *

+ * @param mode string[optional]

+ * Any of the modes specified in the documentation of + * fopen. + *

+ *

+ * Currently, mode is ignored and is always + * "rb". This is due to the fact that zip support + * in PHP is read only access. + *

+ * @return bool Returns true on success or false on failure. + *

+ *

+ * Unlike fopen and other similar functions, + * the return value of zip_entry_open only + * indicates the result of the operation and is not needed for + * reading or closing the directory entry. + */ +function zip_entry_open ($zip, $zip_entry, $mode = null) {} + +/** + * Close a directory entry + * @link http://php.net/manual/en/function.zip-entry-close.php + * @param zip_entry resource

+ * A directory entry previously opened zip_entry_open. + *

+ * @return bool Returns true on success or false on failure. + */ +function zip_entry_close ($zip_entry) {} + +/** + * Read from an open directory entry + * @link http://php.net/manual/en/function.zip-entry-read.php + * @param zip_entry resource

+ * A directory entry returned by zip_read. + *

+ * @param length int[optional]

+ * The number of bytes to return. If not specified, this function will + * attempt to read 1024 bytes. + *

+ *

+ * This should be the uncompressed length you wish to read. + *

+ * @return string the data read, or false if the end of the file is + * reached. + */ +function zip_entry_read ($zip_entry, $length = null) {} + +/** + * Retrieve the actual file size of a directory entry + * @link http://php.net/manual/en/function.zip-entry-filesize.php + * @param zip_entry resource

+ * A directory entry returned by zip_read. + *

+ * @return int The size of the directory entry. + */ +function zip_entry_filesize ($zip_entry) {} + +/** + * Retrieve the name of a directory entry + * @link http://php.net/manual/en/function.zip-entry-name.php + * @param zip_entry resource

+ * A directory entry returned by zip_read. + *

+ * @return string The name of the directory entry. + */ +function zip_entry_name ($zip_entry) {} + +/** + * Retrieve the compressed size of a directory entry + * @link http://php.net/manual/en/function.zip-entry-compressedsize.php + * @param zip_entry resource

+ * A directory entry returned by zip_read. + *

+ * @return int The compressed size. + */ +function zip_entry_compressedsize ($zip_entry) {} + +/** + * Retrieve the compression method of a directory entry + * @link http://php.net/manual/en/function.zip-entry-compressionmethod.php + * @param zip_entry resource

+ * A directory entry returned by zip_read. + *

+ * @return string The compression method. + */ +function zip_entry_compressionmethod ($zip_entry) {} + diff --git a/admin/inc/ajax.php b/admin/inc/ajax.php new file mode 100644 index 0000000..f74fe75 --- /dev/null +++ b/admin/inc/ajax.php @@ -0,0 +1,76 @@ +'; + foreach ($templates as $file) { + $extension=pathinfo($file,PATHINFO_EXTENSION); + if (in_array($extension, $allowed_extensions)){ + $filename=pathinfo($file,PATHINFO_BASENAME); + $filenamefull=substr(strstr($file,'/theme/'.$TEMPLATE.'/'),strlen('/theme/'.$TEMPLATE.'/')); + if ($TEMPLATE_FILE == $filename){ + $sel="selected"; + } else { + $sel=""; + } + if ($filename == 'template.php'){ + $templatename=i18n_r('DEFAULT_TEMPLATE'); + } else { + $templatename=$filenamefull; + } + $theme_templates .= ''; + } + } + + $theme_templates .= ""; + + echo $theme_templates; +} +?> \ No newline at end of file diff --git a/admin/inc/api.class.php b/admin/inc/api.class.php new file mode 100644 index 0000000..9e1c8ce --- /dev/null +++ b/admin/inc/api.class.php @@ -0,0 +1,178 @@ +status == 'true') { + if ( (string)$appid_file->key == (string)$this->xml->key) { + return true; + } else { + $message = array('status' => 'error', 'message' => i18n_r('API_ERR_AUTHFAILED')); + echo json_encode($message); + } + } else { + $message = array('status' => 'error', 'message' => i18n_r('API_ERR_AUTHDISABLED')); + echo json_encode($message); + } + } + + public function add_data($array) { + $this->xml = $array; + } + + /* + * Read Page + * + * @return json + */ + public function page_read() { + if($this->auth()) { + $id = (string)$this->xml->data->slug; + if (file_exists(GSDATAPAGESPATH.$id.'.xml')) { + $page = getXML(GSDATAPAGESPATH.$id.'.xml'); + $page->content = strip_decode($page->content); + $page->metak = strip_decode($page->metak); + $page->metad = strip_decode($page->metad); + $page->title = strip_decode($page->title); + $wrapper = array('status' => 'success', 'message' => 'page_read ok', 'response' => $page); + return json_encode($wrapper); + } else { + $error = array('status' => 'error', 'message' => sprintf(i18n_r('API_ERR_NOPAGE'), $id)); + return json_encode($error); + } + } + } + + /* + * Read Settings + * + * @return json + */ + public function settings_read() { + if($this->auth()) { + $settings = getXML(GSDATAOTHERPATH.'website.xml'); + $wrapper = array('status' => 'success', 'message' => 'settings_read ok', 'response' => $settings); + return json_encode($wrapper); + } + } + + /* + * Read All Pages + * + * @return json + */ + public function all_pages_read() { + if($this->auth()) { + $pages = get_available_pages(); + $wrapper = array('status' => 'success', 'message' => 'all_pages_read ok', 'response' => $pages); + return json_encode($wrapper); + } + } + + /* + * Upload File + * + * @return bool + */ + public function file_upload() { + if($this->auth()) { + + $patho = (string)$this->xml->data->path; + $path = tsl(GSDATAUPLOADPATH . $patho); + + } + } + + /* + * Save Page + * + * @return bool + */ + public function page_save() { + if($this->auth()) { + $id = (string)$this->xml->data->slug; + $thisfile = GSDATAPAGESPATH.$id.'.xml'; + if (file_exists($thisfile)) { + $page = getXML($thisfile); + $page->content = safe_slash_html($this->xml->data->content); + $page->title = safe_slash_html($this->xml->data->title); + $page->pubDate = date('r'); + $bakfile = GSBACKUPSPATH."pages/". $id .".bak.xml"; + copy($thisfile, $bakfile); + $status = XMLsave($page, $thisfile); + if ($status) { + touch($thisfile); + $wrapper = array('status' => 'success', 'message' => 'page_save ok', 'response' => $page); + } else { + $wrapper = array('status' => 'error', 'message' => 'There was an error saving your page'); + } + return json_encode($wrapper); + } else { + $error = array('status' => 'error', 'message' => sprintf(i18n_r('API_ERR_NOPAGE'), $id)); + return json_encode($error); + } + } + } + + /* + * Read Files + * + * @return json + */ + public function all_files_read() { + if($this->auth()) { + $patho = (string)$this->xml->data->path; + $path = tsl(GSDATAUPLOADPATH . $patho); + $filesArray = array(); + $count =0; + global $SITEURL; + + $filenames = getFiles($path); + if (count($filenames) != 0) { + foreach ($filenames as $file) { + if ($file == "." || $file == ".." || $file == ".htaccess" ){ + // not a upload file + } else { + + $filesArray[$count]['name'] = $file; + if (is_dir($path . $file)) { + $filesArray[$count]['type'] = 'folder'; + } else { + $filesArray[$count]['type'] = 'file'; + $filesArray[$count]['url'] = tsl($SITEURL.'data/uploads/'.$patho).$file; + $ext = pathinfo($file,PATHINFO_EXTENSION); + $extention = get_FileType($ext); + $filesArray[$count]['category'] = $extention; + clearstatcache(); + $ss = stat($path . $file); + $filesArray[$count]['date'] = date('c',$ss['ctime']); + $filesArray[$count]['size'] = $ss['size']; + } + + } + $count++; + } + } + $filesArray = subval_sort($filesArray, 'name'); + $filesArray = subval_sort($filesArray, 'type'); + $wrapper = array('status' => 'success', 'message' => 'all_files_read ok', 'response' => $filesArray); + return json_encode($wrapper); + } + } + +} // end of class +?> \ No newline at end of file diff --git a/admin/inc/api.plugin.php b/admin/inc/api.plugin.php new file mode 100644 index 0000000..52f5afe --- /dev/null +++ b/admin/inc/api.plugin.php @@ -0,0 +1,104 @@ +'); + $xml->addChild('status', $api_status); + $xml->addChild('key', $api_key); + XMLsave($xml, $thisdatafile); + } + + # if the api file does not exist + if (!file_exists($thisdatafile)) { + $xml = new SimpleXMLExtended(''); + $xml->addChild('status', 'false'); + $xml->addChild('key', strtoupper(substr(md5(uniqid(rand(), true)),0,10)) ); + XMLsave($xml, $thisdatafile); + } + + # get data to show in control panel + $api=getXML($thisdatafile); + $enabled_status = null; + if ($api->status == 'true') { + $enabled_status = 'checked'; + } + + ?> + + +

GetSimple

+ +
+

+ +

+

+ + key; ?> + +    +

+
+


+

+
+

+
+

*

+ + ','?','[',']','\\',';',"'",',','/','*','+','~','`','=','.'); + $code_entities_replace = array('','-','-','','','','','','','','','','','','','','','','','','','','','','','',''); + $text = str_replace($code_entities_match, $code_entities_replace, $text); + $text = urlencode($text); + $text = str_replace('--','-',$text); + $text = rtrim($text, "-"); + return $text; +} + +/** + * Clean Image Name + * + * Mirror image of Clean URL, but it allows periods so file extentions still work + * + * @since 2.0 + * + * @param string $text + * @return string + */ +function clean_img_name($text) { + $text = strip_tags(lowercase($text)); + $code_entities_match = array(' ?',' ','--','"','!','#','$','%','^','&','*','(',')','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','/','*','+','~','`','='); + $code_entities_replace = array('','-','-','','','','','','','','','','','','','','','','','','','','','',''); + $text = str_replace($code_entities_match, $code_entities_replace, $text); + $text = urlencode($text); + $text = str_replace('--','-',$text); + $text = str_replace('%40','@',$text); // ensure @ is not encoded + $text = rtrim($text, "-"); + return $text; +} + +/** + * 7bit Text Converter + * + * Converts a string to a different encoding format + * + * @since 1.0 + * + * @param string $text + * @param string $from_enc + * @return string + */ +function to7bit($text,$from_enc="UTF-8") { + if (function_exists('mb_convert_encoding')) { + $text = mb_convert_encoding($text,'HTML-ENTITIES',$from_enc); + } else { + $text = htmlspecialchars_decode(utf8_decode(htmlentities($text, ENT_COMPAT, 'utf-8', false))); + } + $text = preg_replace( + array('/ß/','/&(..)lig;/', + '/&([aouAOU])uml;/','/&(.)[^;]*;/'), + array('ss',"$1","$1".'e',"$1"), + $text); + return $text; +} + + +/** + * Formats Email to HTML Style + * + * @since 3.1 + * + * @param string $message + * @return string + */ +function email_template($message) { + $data = ' + + + + + + + + + + + +
+
+ + + + + + + + + + +
+ GetSimple CMS +
+ '.$message.' +
+

This is a system-generated email, please do not reply to it. For help or questions about GetSimple, please visit our website.
© '.date('Y').' GetSimple CMS. All Rights Reserved. Privacy Policy.

+
+
+
+ + + '; + return $data; +} + + +/** + * Send Email + * + * @since 1.0 + * @uses GSFROMEMAIL + * @uses $EMAIL + * + * @param string $to + * @param string $subject + * @param string $message + * @return string + */ +function sendmail($to,$subject,$message) { + + $message = email_template($message); + + if (defined('GSFROMEMAIL')){ + $fromemail = GSFROMEMAIL; + } else { + if(!empty($_SERVER['SERVER_ADMIN']) && check_email_address($_SERVER['SERVER_ADMIN'])) $fromemail = $_SERVER['SERVER_ADMIN']; + else $fromemail = 'noreply@'.$_SERVER['SERVER_NAME']; + } + + global $EMAIL; + $headers ='"MIME-Version: 1.0' . PHP_EOL; + $headers .= 'Content-Type: text/html; charset=UTF-8' . PHP_EOL; + $headers .= 'From: '.$fromemail . PHP_EOL; + $headers .= 'Reply-To: '.$fromemail . PHP_EOL; + $headers .= 'Return-Path: '.$fromemail . PHP_EOL; + + if( @mail($to,'=?UTF-8?B?'.base64_encode($subject).'?=',"$message",$headers) ) { + return 'success'; + } else { + return 'error'; + } +} + +/** + * Sub-Array Sort + * + * Sorts the passed array by a subkey + * + * @since 1.0 + * + * @param array $a + * @param string $subkey Key within the array passed you want to sort by + * @param string $order - order 'asc' ascending or 'desc' descending + * @param bool $natural - sort using a "natural order" algorithm + * @return array + */ +function subval_sort($a,$subkey, $order='asc',$natural = true) { + if (count($a) != 0 || (!empty($a))) { + foreach($a as $k=>$v) { + if(isset($v[$subkey])) $b[$k] = lowercase($v[$subkey]); + } + + if(!isset($b)) return $a; + + if($natural){ + natsort($b); + if($order=='desc') $b = array_reverse($b,true); + } + else { + ($order=='asc')? asort($b) : arsort($b); + } + + foreach($b as $key=>$val) { + $c[] = $a[$key]; + } + + return $c; + } +} + +/** + * SimpleXMLExtended Class + * + * Extends the default PHP SimpleXMLElement class by + * allowing the addition of cdata + * + * @since 1.0 + * + * @param string $cdata_text + */ +class SimpleXMLExtended extends SimpleXMLElement{ + public function addCData($cdata_text){ + $node= dom_import_simplexml($this); + $no = $node->ownerDocument; + $node->appendChild($no->createCDATASection($cdata_text)); + } +} + +/** + * Is File + * + * @since 1.0 + * @uses tsl + * + * @param string $file + * @param string $path + * @param string $type Optiona, default is 'xml' + * @return bool + */ +function isFile($file, $path, $type = 'xml') { + if( is_file(tsl($path) . $file) && $file != "." && $file != ".." && (strstr($file, $type)) ) { + return true; + } else { + return false; + } +} + +/** + * Get Files + * + * Returns an array of files from the passed path + * + * @since 1.0 + * + * @param string $path + * @return array + */ +function getFiles($path) { + $handle = opendir($path) or die("getFiles: Unable to open $path"); + $file_arr = array(); + while ($file = readdir($handle)) { + if ($file != '.' && $file != '..') { + $file_arr[] = $file; + } + } + closedir($handle); + return $file_arr; +} + +$microtime_start = null; + +function get_execution_time($reset=false) +{ + GLOBAL $microtime_start; + if($reset) $microtime_start = null; + + if($microtime_start === null) + { + $microtime_start = microtime(true); + return 0.0; + } + return round(microtime(true) - $microtime_start,5); +} + +/** + * Get XML Data + * + * Turns the XML file into an object + * + * @since 1.0 + * + * @param string $file + * @return object + */ +function getXML($file) { + $xml = @file_get_contents($file); + if($xml){ + $data = simplexml_load_string($xml, 'SimpleXMLExtended', LIBXML_NOCDATA); + return $data; + } +} + +/** + * XML Save + * + * @since 2.0 + * @todo create and chmod file before ->asXML call (if it doesnt exist already, if so, then just chmod it.) + * + * @param object $xml + * @param string $file Filename that it will be saved as + * @return bool + */ +function XMLsave($xml, $file) { + # get_execution_time(true); + if(!is_object($xml)) return false; + $success = @$xml->asXML($file) === TRUE; + # debugLog('XMLsave: ' . $file . ' ' . get_execution_time()); + + if (defined('GSCHMOD')) { + return $success && chmod($file, GSCHMOD); + } else { + return $success && chmod($file, 0755); + } +} + +/** + * Long Date Output + * + * @since 1.0 + * @uses $i18n + * @uses i18n_r + * + * @param string $dt Date/Time format, default is $i18n['DATE_AND_TIME_FORMAT'] + * @return string + */ +function lngDate($dt) { + global $i18n; + + if (!$dt) { + $data = date(i18n_r('DATE_AND_TIME_FORMAT')); + } else { + $data = date(i18n_r('DATE_AND_TIME_FORMAT'), strtotime($dt)); + } + return $data; +} + +/** + * Short Date Output + * + * @since 1.0 + * @uses $i18n + * @uses i18n_r + * + * @param string $dt Date/Time format, default is $i18n['DATE_FORMAT'] + * @return string + */ +function shtDate($dt) { + global $i18n; + + if (!$dt) { + $data = date(i18n_r('DATE_FORMAT')); + } else { + $data = date(i18n_r('DATE_FORMAT'), strtotime($dt)); + } + return $data; +} + +/** + * Clean Utility + * + * @since 1.0 + * + * @param string $data + * @return string + */ +function cl($data){ + $data = stripslashes(strip_tags(html_entity_decode($data, ENT_QUOTES, 'UTF-8'))); + //$data = preg_replace('/[[:cntrl:]]/', '', $data); //remove control characters that cause interface to choke + return $data; +} + +/** + * Add Trailing Slash + * + * @since 1.0 + * + * @param string $path + * @return string + */ +function tsl($path) { + if( substr($path, strlen($path) - 1) != '/' ) { + $path .= '/'; + } + return $path; +} + +/** + * Case-Insensitve In-Array + * + * Creates a function that PHP should already have, but doesnt + * + * @since 1.0 + * + * @param string $path + * @return string + */ +if(!function_exists('in_arrayi')) { + function in_arrayi($needle, $haystack) { + return in_array(lowercase($needle), array_map('lowercase', $haystack)); + } +} + +/** + * Creates Standard URL for Pages + * + * Default function to create the correct url structure for each front-end page + * + * @since 2.0 + * @uses $PRETTYURLS + * @uses $SITEURL + * @uses $PERMALINK + * @uses tsl + * + * @param string $slug + * @param string $parent + * @param string $type Default is 'full', alternative is 'relative' + * @return string + */ +function find_url($slug, $parent, $type='full') { + global $PRETTYURLS; + global $SITEURL; + global $PERMALINK; + + if ($type == 'full') { + $full = $SITEURL; + } elseif($type == 'relative') { + $s = pathinfo(htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES)); + $full = $s['dirname'] .'/'; + $full = str_replace('//', '/', $full); + } else { + $full = '/'; + } + + if ($parent != '') { + $parent = tsl($parent); + } + + if ($PRETTYURLS == '1') { + if ($slug != 'index'){ + $url = $full . $parent . $slug . '/'; + } else { + $url = $full; + } + } else { + if ($slug != 'index'){ + $url = $full .'index.php?id='.$slug; + } else { + $url = $full; + } + } + + if (trim($PERMALINK) != '' && $slug != 'index'){ + $plink = str_replace('%parent%/', $parent, $PERMALINK); + $plink = str_replace('%parent%', $parent, $plink); + $plink = str_replace('%slug%', $slug, $plink); + $url = $full . $plink; + } + + return (string)$url; +} + +/** + * Strip Path + * + * Strips all path info from a filepath or basedir + * + * @since 2.0 + * @author Martijn van der Ven + * + * @param string $path + * @return string + */ +function strippath($path) { + $pathparts = pathinfo($path); + if(isset($pathparts['extension'])) return $pathparts['filename'].'.'.$pathparts['extension']; + return $pathparts['basename']; +} + +/** + * Strip Quotes + * + * @since 2.0 + * + * @param string $text + * @return string + */ +function strip_quotes($text) { + $text = strip_tags($text); + $code_entities_match = array('"','\'','"'); + $text = str_replace($code_entities_match, '', $text); + return trim($text); +} + +/** + * Encode Quotes + * + * @since 3.0 + * + * @param string $text + * @return string + */ +function encode_quotes($text) { + $text = strip_tags($text); + if (version_compare(PHP_VERSION, "5.2.3") >= 0) { + $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false); + } else { + $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); + } + return trim($text); +} + +/** + * Redirect URL + * + * @since 3.0 + * @author schlex + * + * @param string $url + */ +function redirect($url) { + global $i18n; + + // handle expired sessions for ajax requests + if(requestIsAjax() && !cookie_check()){ + header('HTTP/1.1 401 Unauthorized', true, 401); + header('WWW-Authenticate: FormBased'); + die(); + } + + if (!headers_sent($filename, $linenum)) { + header('Location: '.$url); + } else { + echo "".i18n_r('REDIRECT').""; + if ( !isDebug() ) { + echo ''; + echo ''; + } + echo i18n_r('ERROR').": Headers already sent in ".$filename." on line ".$linenum."\n"; + printf(i18n_r('REDIRECT_MSG'), $url); + echo ""; + } + + exit; +} + +/** + * Display i18n + * + * Displays the default language's tranlation, but if it + * does not exist, it falls back to the en_US one. + * + * @since 3.0 + * @author ccagle8 + * @uses GSLANGPATH + * @uses $i18n + * @uses $LANG + * + * @param string $name + * @param bool $echo Optional, default is true + */ +function i18n($name, $echo=true) { + global $i18n; + global $LANG; + + if(isset($i18n)){ + + if (isset($i18n[$name])) { + $myVar = $i18n[$name]; + } else { + $myVar = '{'.$name.'}'; + } + } + else { + $myVar = '{'.$name.'}'; // if $i18n doesnt exist yet return something + } + + if (!$echo) { + return $myVar; + } else { + echo $myVar; + } +} + +/** + * Return i18n + * + * Same as i18n, but returns instead of echos + * + * @since 3.0 + * @author ccagle8 + * + * @param string $name + */ +function i18n_r($name) { + return i18n($name, false); +} + +/** + * i18n Merge + * + * Merges a plugin's language file with the global $i18n language + * This is the function that plugin developers will call to initiate the language merge + * + * @since 3.0 + * @author mvlcek + * @uses i18n_merge_impl + * @uses $i18n + * @uses $LANG + * + * @param string $plugin + * @param string $language, default=null + * @return bool + */ +function i18n_merge($plugin, $language=null) { + global $i18n, $LANG; + return i18n_merge_impl($plugin, $language ? $language : $LANG, $i18n); +} + +/** + * i18n Merge Implementation + * + * Does the merging of a plugin's language file with the global $i18n language + * + * @since 3.0 + * @author mvlcek + * @uses GSPLUGINPATH + * + * @param string $plugin null if merging in core langs + * @param string $lang + * @param string $globali18n + * @return bool + */ +function i18n_merge_impl($plugin, $lang, &$globali18n) { + + $i18n = array(); // local from file + if(!isset($globali18n)) $globali18n = array(); //global ref to $i18n + + $path = ($plugin ? GSPLUGINPATH.$plugin.'/lang/' : GSLANGPATH); + $filename = $path.$lang.'.php'; + $prefix = $plugin ? $plugin.'/' : ''; + + if (!filepath_is_safe($filename,$path) || !file_exists($filename)) { + return false; + } + + include($filename); + + // if core lang and glboal is empty assign + if(!$plugin && !$globali18n && count($i18n) > 0){ + $globali18n = $i18n; + return true; + } + + // replace on per key basis + if (count($i18n) > 0){ + foreach ($i18n as $code => $text) { + if (!array_key_exists($prefix.$code, $globali18n)) { + $globali18n[$prefix.$code] = $text; + } + } + } + return true; +} + +/** + * Safe AddSlashes HTML + * + * @since 2.04 + * @author ccagle8 + * + * @param string $text + * @return string + */ +function safe_slash_html($text) { + if (get_magic_quotes_gpc()==0) { + $text = addslashes(htmlspecialchars($text, ENT_QUOTES, 'UTF-8')); + } else { + $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); + } + $text = str_replace(chr(12), '', $text); // FF + $text = str_replace(chr(3), ' ', $text); // ETX + return $text; +} + + +/** + * Safe StripSlashes HTML Decode + * + * @since 2.04 + * @author ccagle8 + * + * @param string $text + * @return string + */ +function safe_strip_decode($text) { + if (get_magic_quotes_gpc()==0) { + $text = htmlspecialchars_decode($text, ENT_QUOTES); + } else { + $text = stripslashes(htmlspecialchars_decode($text, ENT_QUOTES)); + } + return $text; +} + +/** + * StripSlashes HTML Decode + * + * @since 2.04 + * @author ccagle8 + * + * @param string $text + * @return string + */ +function strip_decode($text) { + $text = stripslashes(htmlspecialchars_decode($text, ENT_QUOTES)); + return $text; +} + +/** + * Safe Pathinfo Filename + * + * for backwards compatibility for before PHP 5.2 + * + * @since 3.0 + * @author madvic + * + * @param string $file + * @return string + */ +function pathinfo_filename($file) { + if (defined('PATHINFO_FILENAME')) return pathinfo($file,PATHINFO_FILENAME); + $path_parts = pathinfo($file); + + if(isset($path_parts['extension']) && ($file!='..')){ + return substr($path_parts['basename'],0 ,strlen($path_parts['basename'])-strlen($path_parts['extension'])-1); + } else{ + return $path_parts['basename']; + } +} + +/** + * Suggest Site Path + * + * Suggestion function for SITEURL variable + * + * @since 2.04 + * @uses $GSAMIN + * @uses http_protocol + * @author ccagle8 + * + * @param bool $parts + * @return string + */ +function suggest_site_path($parts=false) { + global $GSADMIN; + $protocol = http_protocol(); + $path_parts = pathinfo(htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES)); + $path_parts = str_replace("/".$GSADMIN, "", $path_parts['dirname']); + $port = ($p=$_SERVER['SERVER_PORT'])!='80'&&$p!='443'?':'.$p:''; + + if($path_parts == '/') { + + $fullpath = $protocol."://". htmlentities($_SERVER['SERVER_NAME'], ENT_QUOTES) . $port . "/"; + + } else { + + $fullpath = $protocol."://". htmlentities($_SERVER['SERVER_NAME'], ENT_QUOTES) . $port . $path_parts ."/"; + + } + + if ($parts) { + return $path_parts; + } else { + return $fullpath; + } +} + +/** + * Myself + * + * Returns the page itself + * + * @since 2.04 + * @author ccagle8 + * + * @param bool $echo + * @return string + */ +function myself($echo=true) { + if ($echo) { + echo htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES); + } else { + return htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES); + } +} + +/** + * Get Available Themes + * + * @since 2.04 + * @uses GSTHEMESPATH + * @author ccagle8 + * + * @param string $temp + * @return array + */ +function get_themes($temp) { + $themes_path = GSTHEMESPATH . $temp .'/'; + $themes_handle = opendir($themes_path); + while ($file = readdir($themes_handle)) { + if( is_file($themes_path . $file) && $file != "." && $file != ".." ) { + $templates[] = $file; + } + } + sort($templates); + return $templates; +} + + +/** + * HTML Decode + * + * @since 2.04 + * @author ccagle8 + * + * @param string $text + * @return string + */ +function htmldecode($text) { + return html_entity_decode($text, ENT_QUOTES, 'UTF-8'); +} + +/** + * Safe to LowerCase + * + * @since 2.04 + * @author ccagle8 + * + * @param string $text + * @return string + */ +function lowercase($text) { + if (function_exists('mb_strtolower')) { + $text = mb_strtolower($text, 'UTF-8'); + } else { + $text = strtolower($text); + } + + return $text; +} + +/** + * Find AccessKey + * + * Provides a simple way to find the accesskey defined by translators as + * accesskeys are language dependent. + * + * @param string $string, text from the i18n array + * @return string + */ +function find_accesskey($string) { + $found = array(); + $matched = preg_match('/([a-zA-Z])<\/em>/', $string, $found); + if ($matched != 1) { + return null; + } + return strtolower($found[1]); +} + +/** + * Clean ID + * + * Removes characters that don't work in URLs or IDs + * + * @param string $text + * @return string + */ +function _id($text) { + $text = to7bit($text, "UTF-8"); + $text = clean_url($text); + $text = preg_replace('/[[:cntrl:]]/', '', $text); //remove control characters that cause interface to choke + return lowercase($text); +} + +/** + * Defined Array + * + * Checks an array of PHP constants and verifies they are defined + * + * @param array $constants + * @return bool + */ +function defined_array($constants) { + $defined = true; + foreach ($constants as $constant) { + if (!defined($constant)) { + $defined = false; + break; + } + } + return $defined; +} + + +/** + * Is Folder Empty + * + * Check to see if a folder is empty or not + * + * @param string $folder + * @return bool + */ +function check_empty_folder($folder) { + $files = array (); + if ( $handle = opendir ( $folder ) ) { + while ( false !== ( $file = readdir ( $handle ) ) ) { + if ( $file != "." && $file != ".." ) { + $files [] = $file; + } + } + closedir ( $handle ); + } + return ( count ( $files ) > 0 ) ? FALSE : TRUE; +} + + +/** + * Folder Items + * + * Return the amount of items within the given folder + * + * @param string $folder + * @return string + */ +function folder_items($folder) { + $files = array (); + if ( $handle = opendir ( $folder ) ) { + while ( false !== ( $file = readdir ( $handle ) ) ) { + if ( $file != "." && $file != ".." ) { + $files [] = $file; + } + } + closedir($handle); + } + return count($files); +} + +/** + * Validate a URL String + * + * @param string $u + * @return bool + */ +function validate_url($u) { + return filter_var($u,FILTER_VALIDATE_URL); +} + + +/** + * Format XML to Formatted String + * + * @param string $xml + * @return string + */ +function formatXmlString($xml) { + + // add marker linefeeds to aid the pretty-tokeniser (adds a linefeed between all tag-end boundaries) + $xml = preg_replace('/(>)(<)(\/*)/', "$1\n$2$3", $xml); + + // now indent the tags + $token = strtok($xml, "\n"); + $result = ''; // holds formatted version as it is built + $pad = 0; // initial indent + $matches = array(); // returns from preg_matches() + + // scan each line and adjust indent based on opening/closing tags + while ($token !== false) : + + // test for the various tag states + + // 1. open and closing tags on same line - no change + if (preg_match('/.+<\/\w[^>]*>$/', $token, $matches)) : + $indent=0; + // 2. closing tag - outdent now + elseif (preg_match('/^<\/\w/', $token, $matches)) : + $pad--; + // 3. opening tag - don't pad this one, only subsequent tags + elseif (preg_match('/^<\w[^>]*[^\/]>.*$/', $token, $matches)) : + $indent=1; + // 4. no indentation needed + else : + $indent = 0; + endif; + + // pad the line with the required number of leading spaces + $line = str_pad($token, strlen($token)+$pad, ' ', STR_PAD_LEFT); + $result .= $line . "\n"; // add to the cumulative result, with linefeed + $token = strtok("\n"); // get the next token + $pad += $indent; // update the pad size for subsequent lines + endwhile; + + return $result; +} + +/** + * Check Server Protocol + * + * Checks to see if the website should be served using HTTP or HTTPS + * + * @since 3.1 + * @return string + */ +function http_protocol() { + if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { + return 'https'; + } else { + return 'http'; + } +} + +/** + * Get File Mime-Type + * + * @since 3.1 + * @param $file, absolute path + * @return string/bool + */ +function file_mime_type($file) { + if (!file_exists($file)) { + return false; + exit; + } + if(function_exists('finfo_open')) { + # http://www.php.net/manual/en/function.finfo-file.php + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mimetype = finfo_file($finfo, $file); + finfo_close($finfo); + + } elseif(function_exists('mime_content_type')) { + # Depreciated: http://php.net/manual/en/function.mime-content-type.php + $mimetype = mime_content_type($file); + } else { + return false; + exit; + } + return $mimetype; +} + + +/** + * Check Is FrontEnd + * + * Checks to see if the you are on the frontend or not + * + * @since 3.1 + * @return bool + */ +function is_frontend() { + GLOBAL $base; + if(isset($base)) { + return true; + } else { + return false; + } +} + +/** + * Get Installed GetSimple Version + * + * This will return the version of GetSimple that is installed + * + * @since 1.0 + * @uses GSVERSION + * + * @param bool $echo Optional, default is true. False will 'return' value + * @return string Echos or returns based on param $echo + */ +function get_site_version($echo=true) { + include(GSADMININCPATH.'configuration.php'); + if ($echo) { + echo GSVERSION; + } else { + return GSVERSION; + } +} + + +/** + * Get GetSimple Language + * + * @since 3.1 + * @uses $LANG + * + * @param string + */ +function get_site_lang($short=false) { + global $LANG; + if ($short) { + $LANG_header = preg_replace('/(?:(?<=([a-z]{2}))).*/', '', $LANG); + return $LANG_header; + } else { + return $LANG; + } +} + +/** + * Convert to Bytes + * + * @since 3.0 + * + * @param $str string + * @return string + */ +function toBytes($str){ + $val = trim($str); + $last = strtolower($str[strlen($str)-1]); + switch($last) { + case 'g': $val *= 1024; + case 'm': $val *= 1024; + case 'k': $val *= 1024; + } + return $val; +} + +/** + * Remove Relative Paths + * + * @since 3.1 + * + * @param $file string + * @return string + */ +function removerelativepath($file) { + while(strpos($file,'../')!==false) { + $file = str_replace('../','',$file); + } + return $file; +} + +/** + * Return a directory of files and folders + * + * @since 3.1 + * + * @param $directory string directory to scan + * @param $recursive boolean whether to do a recursive scan or not. + * @return array or files and folders + */ +function directoryToArray($directory, $recursive) { + $array_items = array(); + if ($handle = opendir($directory)) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { + if (is_dir($directory. "/" . $file)) { + if($recursive) { + $array_items = array_merge($array_items, directoryToArray($directory. "/" . $file, $recursive)); + } + $file = $directory . "/" . $file; + $array_items[] = preg_replace("/\/\//si", "/", $file); + } else { + $file = $directory . "/" . $file; + $array_items[] = preg_replace("/\/\//si", "/", $file); + } + } + } + closedir($handle); + } + return $array_items; +} + + +/** + * Returns definition safely + * + * @since 3.1.3 + * + * @param str $id + * @param bool $isbool treat definition as boolean and cast it + * @return * returns definition or null if not defined + */ +function getDef($id,$isbool = false){ + if( defined($id) ) { + if($isbool) return (bool) constant($id); + return constant($id); + } +} + +/** + * Alias for checking for debug constant + * @since 3.2.1 + * @return bool true if debug enabled + */ +function isDebug(){ + return getDef('GSDEBUG',true); +} + +/** + * check gs version is Beta + * + * @since 3.3.0 + * @return boolean true if beta release + */ +function isBeta(){ + return strPos(get_site_version(false),"b"); +} + +/** + * Check if request is an ajax request + * @since 3.3.0 + * @return bool true if ajax + */ +function requestIsAjax(){ + return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') || isset($_GET['ajax']); +} + +/** + * check if array is multidimensional + * @since 3.3.2 + * @param mixed $ary + * @return bool true if $ary is a multidimensional array + */ +function arrayIsMultid($ary){ + return is_array($ary) && ( count($ary) != count($ary,COUNT_RECURSIVE) ); +} + +/** + * normalizes toolbar setting, always returns js array string syntax + * @since 3.3.2 + * + * @param mixed $var string or array var to convert to js array syntax + */ +function returnJsArray($var){ + + if(!$var) return; + + if(!is_array($var)) { + // if looks like an array string try to parse as array + if(strrpos($var, '[')){ + // normalize array strings + $var = stripslashes($var); // remove escaped quotes + $var = trim(trim($var),','); // remove trailing commas + $var = str_replace('\'','"',$var); // replace single quotes with double (for json) + + $ary = json_decode($var); + + // add primary nest if missing + if(!is_array($ary) || !arrayIsMultid($ary) ) $ary = json_decode('['.$var.']'); + + // if proper array use it + if(is_array($ary) ) $var = json_encode($ary); + else $var = "'".trim($var,"\"'")."'"; + } + else{ + // else quote wrap string, trim to avoid double quoting + $var = "'".trim($var,"\"'")."'"; + } + } + else { + // convert php array to js array + $var = json_encode($var); + } + + return $var; +} + + +?> \ No newline at end of file diff --git a/admin/inc/caching_functions.php b/admin/inc/caching_functions.php new file mode 100644 index 0000000..1273bdd --- /dev/null +++ b/admin/inc/caching_functions.php @@ -0,0 +1,326 @@ +$field, ENT_QUOTES)); + if ($field=='content'){ + $content = exec_filter('content',$content); + } + echo $content; +} + +/** + * Get Page Field + * + * Retrieve and display the requested field from the given page. + * + * @since 3.1 + * @param $page - slug of the page to retrieve content + * @param $field - the Field to display + * + */ +function getPageField($page,$field){ + global $pagesArray; + if(!$pagesArray) getPagesXmlValues(); + + if ($field=="content"){ + getPageContent($page); + } else { + if (array_key_exists($field, $pagesArray[(string)$page])){ + echo strip_decode($pagesArray[(string)$page][(string)$field]); + } else { + getPageContent($page,$field); + } + } +} + +/** + * Echo Page Field + * + * Retrieve and display the requested field from the given page. + * + * @since 3.1 + * @param $page - slug of the page to retrieve content + * @param $field - the Field to display + * + */ +function echoPageField($page,$field){ + getPageField($page,$field); +} + + +/** + * Return Page Content + * + * Return the content of the requested page. + * As the Content is not cahed the file is read in. + * + * @since 3.1 + * @param $page - slug of the page to retrieve content + * @param $raw false - if true return raw xml + * @param $nofilter false - if true skip content filter execution + * + */ +function returnPageContent($page, $field='content', $raw = false, $nofilter = false){ + $thisfile = file_get_contents(GSDATAPAGESPATH.$page.'.xml'); + $data = simplexml_load_string($thisfile); + $content = $data->$field; + if(!$raw) $content = stripslashes(htmlspecialchars_decode($content, ENT_QUOTES)); + if ($field=='content' and !$nofilter){ + $content = exec_filter('content',$content); + } + return $content; +} + +/** + * Get Page Field + * + * Retrieve and display the requested field from the given page. + * If the field is "content" it will call returnPageContent() + * + * @since 3.1 + * @param $page - slug of the page to retrieve content + * @param $field - the Field to display + * + */ +function returnPageField($page,$field){ + global $pagesArray; + if(!$pagesArray) getPagesXmlValues(); + + if ($field=="content"){ + $ret=returnPageContent($page); + } else { + if (array_key_exists($field, $pagesArray[(string)$page])){ + $ret=strip_decode(@$pagesArray[(string)$page][(string)$field]); + } else { + $ret = returnPageContent($page,$field); + } + } + return $ret; +} + + +/** + * Get Page Children + * + * Return an Array of pages that are children of the requested page/slug + * + * @since 3.1 + * @param $page - slug of the page to retrieve content + * + * @returns - Array of slug names + * + */ +function getChildren($page){ + global $pagesArray; + if(!$pagesArray) getPagesXmlValues(); + $returnArray = array(); + foreach ($pagesArray as $key => $value) { + if ($pagesArray[$key]['parent']==$page){ + $returnArray[]=$key; + } + } + return $returnArray; +} + +/** + * Get Page Children - returns multi fields + * + * Return an Array of pages that are children of the requested page/slug with optional fields. + * + * @since 3.1 + * @param $page - slug of the page to retrieve content + * @param options - array of optional fields to return + * + * @returns - Array of slug names and optional fields. + * + */ + +function getChildrenMulti($page,$options=array()){ + global $pagesArray; + if(!$pagesArray) getPagesXmlValues(); + $count=0; + $returnArray = array(); + foreach ($pagesArray as $key => $value) { + if ($pagesArray[$key]['parent']==$page){ + $returnArray[$count]=array(); + $returnArray[$count]['url']=$key; + foreach ($options as $option){ + $returnArray[$count][$option]=returnPageField($key,$option); + } + $count++; + } + } + return $returnArray; +} + +/** + * Get Cached Pages XML Values + * + * Loads the Cached XML data into the Array $pagesArray + * If the file does not exist it is created the first time. + * + * @since 3.1 + * + */ +function getPagesXmlValues($chkcount=false){ + global $pagesArray; + + // debugLog(__FUNCTION__.": chkcount - " .(int)$chkcount); + + // if page cache not load load it + if(!$pagesArray){ + $pagesArray=array(); + $file=GSDATAOTHERPATH."pages.xml"; + if (file_exists($file)){ + // load the xml file and setup the array. + // debugLog(__FUNCTION__.": load pages.xml"); + $thisfile = file_get_contents($file); + $data = simplexml_load_string($thisfile); + $pages = $data->item; + foreach ($pages as $page) { + $key=$page->url; + $pagesArray[(string)$key]=array(); + foreach ($page->children() as $opt=>$val) { + $pagesArray[(string)$key][(string)$opt]=(string)$val; + } + } + } + else { + // no page cache, regen and then load it + // debugLog(__FUNCTION__.": pages.xml not exist"); + if(create_pagesxml(true)) getPagesXmlValues(false); + return; + } + } + + // if checking cache sync, regen cache if pages differ. + if ($chkcount==true){ + $path = GSDATAPAGESPATH; + $dir_handle = @opendir($path) or die("getPageXmlValues: Unable to open $path"); + $filenames = array(); + while ($filename = readdir($dir_handle)) { + $ext = substr($filename, strrpos($filename, '.') + 1); + if ($ext=="xml"){ + $filenames[] = $filename; + } + } + if (count($pagesArray)!=count($filenames)) { + // debugLog(__FUNCTION__.": count differs regen pages.xml"); + if(create_pagesxml(true)) getPagesXmlValues(false); + } + } + +} + +/** + * Create the Cached Pages XML file + * + * Reads in each page of the site and creates a single XML file called + * data/pages/pages.array + * + * @since 3.1 + * + */ +function create_pagesxml($flag){ +global $pagesArray; + +$success = ''; + +// debugLog("create_pagesxml: " . $flag); +if ((isset($_GET['upd']) && $_GET['upd']=="edit-success") || $flag===true || $flag=='true'){ + $pagesArray = array(); + // debugLog("create_pagesxml proceeding"); + $menu = ''; + $filem=GSDATAOTHERPATH."pages.xml"; + + $path = GSDATAPAGESPATH; + $dir_handle = @opendir($path) or die("create_pagesxml: Unable to open $path"); + $filenames = array(); + while ($filename = readdir($dir_handle)) { + $ext = substr($filename, strrpos($filename, '.') + 1); + if ($ext=="xml"){ + $filenames[] = $filename; + } + } + + $count=0; + $xml = @new SimpleXMLExtended(''); + if (count($filenames) != 0) { + foreach ($filenames as $file) { + if ($file == "." || $file == ".." || is_dir(GSDATAPAGESPATH.$file) || $file == ".htaccess" ) { + // not a page data file + } else { + $thisfile = file_get_contents($path.$file); + $data = simplexml_load_string($thisfile); + $count++; + $id=$data->url; + + $pages = $xml->addChild('item'); + // $pages->addChild('url', $id); + // $pagesArray[(string)$id]['url']=(string)$id; + + foreach ($data->children() as $item => $itemdata) { + if ($item!="content"){ + $note = $pages->addChild($item); + $note->addCData($itemdata); + $pagesArray[(string)$id][$item]=(string)$itemdata; + } + } + + $note = $pages->addChild('slug'); + $note->addCData($id); + $pagesArray[(string)$id]['slug']=(string)$id; + + $pagesArray[(string)$id]['filename']=$file; + $note = $pages->addChild('filename'); + $note->addCData($file); + + } // else + } // end foreach + } // endif + if ($flag===true || $flag == 'true'){ + + // Plugin Authors should add custom fields etc.. here + $xml = exec_filter('pagecache',$xml); + + // sanity check in case the filter does not come back properly or returns null + if($xml){ + $success = $xml->asXML($filem); + } + // debugLog("create_pagesxml saved: ". $success); + exec_action('pagecache-aftersave'); + return $success; + } +} +} + + + +?> \ No newline at end of file diff --git a/admin/inc/common.php b/admin/inc/common.php new file mode 100644 index 0000000..97e3254 --- /dev/null +++ b/admin/inc/common.php @@ -0,0 +1,339 @@ += 0) { + foreach ($_GET as &$xss) $xss = antixss($xss); +} + +/** + * Basic file inclusions + */ +include('basic.php'); +include('template_functions.php'); +include('logging.class.php'); + +define('GSROOTPATH', get_root_path()); + +if(!is_frontend()){ + if (file_exists(GSROOTPATH . 'gsconfig.php')) { + require_once(GSROOTPATH . 'gsconfig.php'); + } + + if (defined('GSADMIN')) { + $GSADMIN = GSADMIN; + } else { + $GSADMIN = 'admin'; + } +} + +/** + * Define some constants + */ +define('GSADMINPATH', get_admin_path()); +define('GSADMININCPATH', GSADMINPATH. 'inc/'); +define('GSPLUGINPATH', GSROOTPATH. 'plugins/'); +define('GSLANGPATH', GSADMINPATH. 'lang/'); +define('GSDATAPATH', GSROOTPATH. 'data/'); +define('GSDATAOTHERPATH', GSROOTPATH. 'data/other/'); +define('GSDATAPAGESPATH', GSROOTPATH. 'data/pages/'); +define('GSDATAUPLOADPATH', GSROOTPATH. 'data/uploads/'); +define('GSTHUMBNAILPATH', GSROOTPATH. 'data/thumbs/'); +define('GSBACKUPSPATH', GSROOTPATH. 'backups/'); +define('GSTHEMESPATH', GSROOTPATH. 'theme/'); +define('GSUSERSPATH', GSROOTPATH. 'data/users/'); +define('GSBACKUSERSPATH', GSROOTPATH. 'backups/users/'); +define('GSCACHEPATH', GSROOTPATH. 'data/cache/'); +define('GSAUTOSAVEPATH', GSROOTPATH. 'data/pages/autosave/'); + +$reservedSlugs = array($GSADMIN,'data','theme','plugins','backups'); + +require_once(GSADMININCPATH.'configuration.php'); + +/** + * Debugging + */ +if ( isDebug() ) { + error_reporting(-1); + ini_set('display_errors', 1); +} else if( getDef('SUPRESSERRORS',true) ) { + error_reporting(0); + ini_set('display_errors', 0); +} +ini_set('log_errors', 1); +ini_set('error_log', GSDATAOTHERPATH .'logs/errorlog.txt'); + + +/** + * Variable check to prevent debugging going off + * @todo some of these may not even be needed anymore + */ +$admin_relative = (isset($admin_relative)) ? $admin_relative : ''; +$lang_relative = (isset($lang_relative)) ? $lang_relative : ''; +$load['login'] = (isset($load['login'])) ? $load['login'] : ''; +$load['plugin'] = (isset($load['plugin'])) ? $load['plugin'] : ''; + + + +/** + * Pull data from storage + */ + +/** grab website data */ +$thisfilew = GSDATAOTHERPATH .'website.xml'; +if (file_exists($thisfilew)) { + $dataw = getXML($thisfilew); + $SITENAME = stripslashes($dataw->SITENAME); + $SITEURL = $dataw->SITEURL; + $TEMPLATE = $dataw->TEMPLATE; + $PRETTYURLS = $dataw->PRETTYURLS; + $PERMALINK = $dataw->PERMALINK; +} else { + $SITENAME = ''; + $SITEURL = ''; +} + + +/** grab user data */ +if (isset($_COOKIE['GS_ADMIN_USERNAME'])) { + $cookie_user_id = _id($_COOKIE['GS_ADMIN_USERNAME']); + if (file_exists(GSUSERSPATH . $cookie_user_id.'.xml')) { + $datau = getXML(GSUSERSPATH . $cookie_user_id.'.xml'); + $USR = stripslashes($datau->USR); + $HTMLEDITOR = $datau->HTMLEDITOR; + $TIMEZONE = $datau->TIMEZONE; + $LANG = $datau->LANG; + } else { + $USR = null; + } +} else { + $USR = null; +} + +/** + * Language control + */ +if(!isset($LANG) || $LANG == '') { + $filenames = glob(GSLANGPATH.'*.php'); + $cntlang = count($filenames); + if ($cntlang == 1) { + // assign lang to only existing file + $LANG = basename($filenames[0], ".php"); + } elseif($cntlang > 1 && in_array(GSLANGPATH .'en_US.php',$filenames)) { + // fallback to en_US if it exists + $LANG = 'en_US'; + } elseif(isset($filenames[0])) { + // fallback to first lang found + $LANG=basename($filenames[0], ".php"); + } +} + +i18n_merge(null); // load $LANG file into $i18n + +// Merge in default lang to avoid empty lang tokens +// if GSMERGELANG is undefined or false merge en_US else merge custom +if(getDef('GSMERGELANG', true) !== false and !getDef('GSMERGELANG', true) ){ + if($LANG !='en_US') i18n_merge(null,"en_US"); +} else{ + // merge GSMERGELANG defined lang if not the same as $LANG + if($LANG !=getDef('GSMERGELANG') ) i18n_merge(null,getDef('GSMERGELANG')); +} + +/** + * Init Editor globals + * @uses $EDHEIGHT + * @uses $EDLANG + * @uses $EDTOOL js array string | php array | 'none' | ck toolbar_ name + * @uses $EDOPTIONS js obj param strings, comma delimited + */ +if (defined('GSEDITORHEIGHT')) { $EDHEIGHT = GSEDITORHEIGHT .'px'; } else { $EDHEIGHT = '500px'; } +if (defined('GSEDITORLANG')) { $EDLANG = GSEDITORLANG; } else { $EDLANG = i18n_r('CKEDITOR_LANG'); } +if (defined('GSEDITORTOOL') and !isset($EDTOOL)) { $EDTOOL = GSEDITORTOOL; } +if (defined('GSEDITOROPTIONS') and !isset($EDOPTIONS) && trim(GSEDITOROPTIONS)!="" ) $EDOPTIONS = GSEDITOROPTIONS; + +if(!isset($EDTOOL)) $EDTOOL = 'basic'; // default gs toolbar + +if($EDTOOL == "none") $EDTOOL = null; // toolbar to use cke default +$EDTOOL = returnJsArray($EDTOOL); +// if($EDTOOL === null) $EDTOOL = 'null'; // not supported in cke 3.x +// at this point $EDTOOL should always be a valid js nested array ([[ ]]) or escaped toolbar id ('toolbar_id') + +/** + * Timezone setup + */ + +// set defined timezone from config if not set on user +if( (!isset($TIMEZONE) || trim($TIMEZONE) == '' ) && defined('GSTIMEZONE') ){ + $TIMEZONE = GSTIMEZONE; +} + +if(isset($TIMEZONE) && function_exists('date_default_timezone_set') && ($TIMEZONE != "" || stripos($TIMEZONE, '--')) ) { + date_default_timezone_set($TIMEZONE); +} + + +/** + * Variable Globalization + */ +global $SITENAME, $SITEURL, $TEMPLATE, $TIMEZONE, $LANG, $SALT, $i18n, $USR, $PERMALINK, $GSADMIN, $components, $EDTOOL, $EDOPTIONS, $EDLANG, $EDHEIGHT; + +/** grab authorization and security data */ +if (defined('GSUSECUSTOMSALT')) { + // use GSUSECUSTOMSALT + $SALT = sha1(GSUSECUSTOMSALT); +} +else { + // use from authorization.xml + if (file_exists(GSDATAOTHERPATH .'authorization.xml')) { + $dataa = getXML(GSDATAOTHERPATH .'authorization.xml'); + $SALT = stripslashes($dataa->apikey); + } else { + if($SITEURL !='' && get_filename_id() != 'install' && get_filename_id() != 'setup' && get_filename_id() != 'update' && get_filename_id() != 'style'){ + die(i18n_r('KILL_CANT_CONTINUE')."
".i18n_r('MISSING_FILE').": "."authorization.xml"); + } + } +} +$SESSIONHASH = sha1($SALT . $SITENAME); + + +/** + * $base is if the site is being viewed from the front-end + */ +if(isset($base)) { + include_once(GSADMININCPATH.'theme_functions.php'); +} + +function serviceUnavailable(){ + GLOBAL $base; + if(isset($base)){ + header('HTTP/1.1 503 Service Temporarily Unavailable'); + header('Status: 503 Service Temporarily Unavailable'); + header('Retry-After: 7200'); // in seconds + i18n('SERVICE_UNAVAILABLE'); + die(); + } +} + +/** + * Check to make sure site is already installed + */ +if (get_filename_id() != 'install' && get_filename_id() != 'setup' && get_filename_id() != 'update') { + $fullpath = suggest_site_path(); + + # if there is no SITEURL set, then it's a fresh install. Start installation process + # siteurl check is not good for pre 3.0 since it will be empty, so skip and run update first. + if ($SITEURL == '' && get_gs_version() >= 3.0) { + serviceUnavailable(); + redirect($fullpath . $GSADMIN.'/install.php'); + } + else { + # if an update file was included in the install package, redirect there first + if (file_exists(GSADMINPATH.'update.php') && !isset($_GET['updated']) && !getDef('GSDEBUGINSTALL')) { + serviceUnavailable(); + redirect($fullpath . $GSADMIN.'/update.php'); + } + } + + if(!getDef('GSDEBUGINSTALL',true)){ + # if you've made it this far, the site is already installed so remove the installation files + $filedeletionstatus=true; + if (file_exists(GSADMINPATH.'install.php')) { + $filedeletionstatus = unlink(GSADMINPATH.'install.php'); + } + if (file_exists(GSADMINPATH.'setup.php')) { + $filedeletionstatus = unlink(GSADMINPATH.'setup.php'); + } + if (file_exists(GSADMINPATH.'update.php')) { + $filedeletionstatus = unlink(GSADMINPATH.'update.php'); + } + if (!$filedeletionstatus) { + $error = sprintf(i18n_r('ERR_CANNOT_DELETE'), '/'.$GSADMIN.'/install.php, /'.$GSADMIN.'/setup.php or /'.$GSADMIN.'/update.php'); + } + } + +} + +/** + * Include other files depending if they are needed or not + */ +include_once(GSADMININCPATH.'cookie_functions.php'); +if(isset($load['plugin']) && $load['plugin']){ + # remove the pages.php plugin if it exists. + if (file_exists(GSPLUGINPATH.'pages.php')) { + unlink(GSPLUGINPATH.'pages.php'); + } + include_once(GSADMININCPATH.'plugin_functions.php'); + if(get_filename_id()=='settings' || get_filename_id()=='load') { + /* this core plugin only needs to be visible when you are viewing the + settings page since that is where its sidebar item is. */ + if (defined('GSEXTAPI') && GSEXTAPI==1) { + include_once('api.plugin.php'); + } + } + # include core plugin for page caching + include_once('caching_functions.php'); + + # main hook for common.php + exec_action('common'); + +} +if(isset($load['login']) && $load['login']){ include_once(GSADMININCPATH.'login_functions.php'); } +?> diff --git a/admin/inc/configuration.php b/admin/inc/configuration.php new file mode 100644 index 0000000..fd50c5a --- /dev/null +++ b/admin/inc/configuration.php @@ -0,0 +1,31 @@ + diff --git a/admin/inc/cookie_functions.php b/admin/inc/cookie_functions.php new file mode 100644 index 0000000..3fe0e1c --- /dev/null +++ b/admin/inc/cookie_functions.php @@ -0,0 +1,101 @@ + \ No newline at end of file diff --git a/admin/inc/image.class.php b/admin/inc/image.class.php new file mode 100644 index 0000000..3ea4639 --- /dev/null +++ b/admin/inc/image.class.php @@ -0,0 +1,212 @@ +image_type == 1) && !function_exists('imagegif')) $this->image_type = 3; + + switch ($this->image_type) { + case 1: + if ($this->save_to_file) { + header("Content-type: image/gif"); + $res = ImageGIF($im,$filename); + $res = ImageGIF($im,NULL); + } + else { + header("Content-type: image/gif"); + $res = ImageGIF($im,$filename); + $res = ImageGIF($im,NULL); + } + break; + case 2: + if ($this->save_to_file) { + header("Content-type: image/jpeg"); + $res = ImageJPEG($im,$filename,$this->quality); + $res = ImageJPEG($im,NULL,$this->quality); + } + else { + header("Content-type: image/jpeg"); + $res = ImageJPEG($im,$filename,$this->quality); + $res = ImageJPEG($im,NULL,$this->quality); + } + break; + case 3: + if (PHP_VERSION >= '5.1.2') { + // Convert to PNG quality. + // PNG quality: 0 (best quality, bigger file) to 9 (worst quality, smaller file) + $quality = 9 - min( round($this->quality / 10), 9 ); + if ($this->save_to_file) { + header("Content-type: image/png"); + $res = ImagePNG($im, $filename, $quality); + $res = ImagePNG($im, NULL, $quality); + } + else { + header("Content-type: image/png"); + $res = ImagePNG($im, $filename, $quality); + $res = ImagePNG($im, NULL, $quality); + } + } + else { + if ($this->save_to_file) { + header("Content-type: image/png"); + $res = ImagePNG($im, $filename); + $res = ImagePNG($im); + } + else { + header("Content-type: image/png"); + $res = ImagePNG($im, $filename); + $res = ImagePNG($im); + } + } + break; + } + + return $res; + + } + + function ImageCreateFromType($type,$filename) { + $im = null; + switch ($type) { + case 1: + $im = ImageCreateFromGif($filename); + break; + case 2: + $im = ImageCreateFromJpeg($filename); + break; + case 3: + $im = ImageCreateFromPNG($filename); + break; + } + return $im; + } + + // generate thumb from image and save it + function GenerateThumbFile($from_name, $to_name) { + + // if src is URL then download file first + $temp = false; + if (substr($from_name,0,7) == 'http://') { + $tmpfname = tempnam("tmp/", "TmP-"); + $temp = @fopen($tmpfname, "w"); + if ($temp) { + @fwrite($temp, @file_get_contents($from_name)) or die("Cannot download image"); + @fclose($temp); + $from_name = $tmpfname; + } + else { + die("Cannot create temp file"); + } + } + + // check if file exists + if (!file_exists($from_name)) die("Source image does not exist!"); + + // get source image size (width/height/type) + // orig_img_type 1 = GIF, 2 = JPG, 3 = PNG + list($orig_x, $orig_y, $orig_img_type, $img_sizes) = @GetImageSize($from_name); + + // cut image if specified by user + if ($this->cut_x > 0) $orig_x = min($this->cut_x, $orig_x); + if ($this->cut_y > 0) $orig_y = min($this->cut_y, $orig_y); + + // should we override thumb image type? + $this->image_type = ($this->image_type != -1 ? $this->image_type : $orig_img_type); + + // check for allowed image types + if ($orig_img_type < 1 or $orig_img_type > 3) die("Image type not supported"); + + if ($orig_x > $this->max_x or $orig_y > $this->max_y) { + + // resize + $per_x = $orig_x / $this->max_x; + $per_y = $orig_y / $this->max_y; + if ($per_y > $per_x) { + $this->max_x = $orig_x / $per_y; + } + else { + $this->max_y = $orig_y / $per_x; + } + + } + else { + // keep original sizes, i.e. just copy + if ($this->save_to_file) { + @copy($from_name, $to_name); + } + else { + switch ($this->image_type) { + case 1: + header("Content-type: image/gif"); + readfile($from_name); + break; + case 2: + header("Content-type: image/jpeg"); + readfile($from_name); + break; + case 3: + header("Content-type: image/png"); + readfile($from_name); + break; + } + } + return; + } + + if ($this->image_type == 1) { + // should use this function for gifs (gifs are palette images) + $ni = imagecreate($this->max_x, $this->max_y); + } + else { + // Create a new true color image + $ni = ImageCreateTrueColor($this->max_x,$this->max_y); + } + + // Fill image with white background (255,255,255) + $white = imagecolorallocate($ni, 255, 255, 255); + imagefilledrectangle( $ni, 0, 0, $this->max_x, $this->max_y, $white); + // Create a new image from source file + $im = $this->ImageCreateFromType($orig_img_type,$from_name); + // Copy the palette from one image to another + imagepalettecopy($ni,$im); + // Copy and resize part of an image with resampling + imagecopyresampled( + $ni, $im, // destination, source + 0, 0, 0, 0, // dstX, dstY, srcX, srcY + $this->max_x, $this->max_y, // dstW, dstH + $orig_x, $orig_y); // srcW, srcH + + // save thumb file + $this->SaveImage($ni, $to_name); + + if($temp) { + unlink($tmpfname); // this removes the file + } + + } + +} + +?> \ No newline at end of file diff --git a/admin/inc/imagemanipulation.php b/admin/inc/imagemanipulation.php new file mode 100644 index 0000000..db65beb --- /dev/null +++ b/admin/inc/imagemanipulation.php @@ -0,0 +1,312 @@ +0, + 'targety'=>0, + 'quality'=>75); + + /** + * A boolean value to detect if an image has not been created. This + * can be used to validate that an image is viable before trying + * resize or crop. + * + * @var boolean + */ + public $imageok = false; + + /** + * Contructor method. Will create a new image from the target file. + * Accepts an image filename as a string. Method also works out how + * big the image is and stores this in the $image array. + * + * @param string $imgFile The image filename. + */ + public function ImageManipulation($imgfile) + { + //detect image format + $this->image["format"] = preg_replace("/.*\.(.*)$/", "\\1", $imgfile); + $this->image["format"] = strtoupper($this->image["format"]); + + // convert image into usable format. + if ( $this->image["format"] == "JPG" || $this->image["format"] == "JPEG" ) { + //JPEG + $this->image["format"] = "JPEG"; + $this->image["src"] = ImageCreateFromJPEG($imgfile); + } elseif( $this->image["format"] == "PNG" ){ + //PNG + $this->image["format"] = "PNG"; + $this->image["src"] = imagecreatefrompng($imgfile); + } elseif( $this->image["format"] == "GIF" ){ + //GIF + $this->image["format"] = "GIF"; + $this->image["src"] = ImageCreateFromGif($imgfile); + } elseif ( $this->image["format"] == "WBMP" ){ + //WBMP + $this->image["format"] = "WBMP"; + $this->image["src"] = ImageCreateFromWBMP($imgfile); + } else { + //DEFAULT + return false; + } + + // Image is ok + $this->imageok = true; + + // Work out image size + $this->image["sizex"] = imagesx($this->image["src"]); + $this->image["sizey"] = imagesy($this->image["src"]); + } + + /** + * Sets the height of the image to be created. The width of the image + * is worked out depending on the value of the height. + * + * @param int $height The height of the image. + */ + public function setImageHeight($height=100) + { + //height + $this->image["sizey_thumb"] = $height; + $this->image["sizex_thumb"] = ($this->image["sizey_thumb"]/$this->image["sizey"])*$this->image["sizex"]; + } + + /** + * Sets the width of the image to be created. The height of the image + * is worked out depending on the value of the width. + * + * @param int $size The width of the image. + */ + public function setImageWidth($width=100) + { + //width + $this->image["sizex_thumb"] = $width; + $this->image["sizey_thumb"] = ($this->image["sizex_thumb"]/$this->image["sizex"])*$this->image["sizey"]; + } + + /** + * This method automatically sets the width and height depending + * on the dimensions of the image up to a maximum value. + * + * @param int $size The maximum size of the image. + */ + public function resize($size=100) + { + if ( $this->image["sizex"] >= $this->image["sizey"] ) { + $this->image["sizex_thumb"] = $size; + $this->image["sizey_thumb"] = ($this->image["sizex_thumb"]/$this->image["sizex"])*$this->image["sizey"]; + } else { + $this->image["sizey_thumb"] = $size; + $this->image["sizex_thumb"] = ($this->image["sizey_thumb"]/$this->image["sizey"])*$this->image["sizex"]; + } + } + + /** + * This method sets the cropping values of the image. Be sure + * to set the height and with of the image if you want the + * image to be a certain size after cropping. + * + * @param int $x The x coordinates to start cropping from. + * @param int $y The y coordinates to start cropping from. + * @param int $w The width of the crop from the x and y coordinates. + * @param int $h The height of the crop from the x and y coordinates. + */ + public function setCrop($x, $y, $w, $h) + { + $this->image["targetx"] = $x; + $this->image["targety"] = $y; + $this->image["sizex"] = $w; + $this->image["sizey"] = $h; + } + + /** + * Sets the JPEG output quality. + * + * @param int $quality The quality of the JPEG image. + */ + public function setJpegQuality($quality=75) + { + //jpeg quality + $this->image["quality"] = $quality; + } + + /** + * Shows the image to a browser. Sets the correct image format in a header. + */ + public function show() + { + //show thumb + header("Content-Type: image/".$this->image["format"]); + + $this->createResampledImage(); + + if ( $this->image["format"]=="JPG" || $this->image["format"]=="JPEG" ) { + //JPEG + imageJPEG($this->image["des"], "", $this->image["quality"]); + } elseif ( $this->image["format"] == "PNG" ) { + //PNG + imagePNG($this->image["des"]); + } elseif ( $this->image["format"] == "GIF" ) { + //GIF + imageGIF($this->image["des"]); + } elseif ( $this->image["format"] == "WBMP" ) { + //WBMP + imageWBMP($this->image["des"]); + } + } + + /** + * Private method to run the imagecopyresampled() function with the parameters that have been set up. + * This method is used by the save() and show() methods. + */ + private function createResampledImage() + { + /* change ImageCreateTrueColor to ImageCreate if your GD not supported ImageCreateTrueColor function*/ + if ( isset($this->image["sizex_thumb"]) && isset($this->image["sizey_thumb"]) ) { + $this->image["des"] = ImageCreateTrueColor($this->image["sizex_thumb"], $this->image["sizey_thumb"]); + imagecopyresampled($this->image["des"], $this->image["src"], 0, 0, $this->image["targetx"], $this->image["targety"], $this->image["sizex_thumb"], $this->image["sizey_thumb"], $this->image["sizex"], $this->image["sizey"]); + } else { + $this->image["des"] = ImageCreateTrueColor($this->image["sizex"], $this->image["sizey"]); + imagecopyresampled($this->image["des"], $this->image["src"], 0, 0, $this->image["targetx"], $this->image["targety"], $this->image["sizex"], $this->image["sizey"], $this->image["sizex"], $this->image["sizey"]); + } + } + + /** + * Saves the image to a given filename, if no filename is given then a default is created. + * + * @param string $save The new image filename. + */ + public function save($save="") + { + //save thumb + if ( empty($save) ) { + $save = strtolower("./thumb.".$this->image["format"]); + } + header("Content-Type: image/".$this->image["format"]); + $this->createResampledImage(); + + if ( $this->image["format"] == "JPG" || $this->image["format"] == "JPEG" ) { + //JPEG + imageJPEG($this->image["des"], $save, $this->image["quality"]); + } elseif ( $this->image["format"] == "PNG" ) { + //PNG + imagePNG($this->image["des"], $save); + } elseif ( $this->image["format"] == "GIF" ) { + //GIF + imageGIF($this->image["des"], $save); + } elseif ( $this->image["format"] == "WBMP" ) { + //WBMP + imageWBMP($this->image["des"], $save); + } + + header("Content-Type: text/html"); + } +} \ No newline at end of file diff --git a/admin/inc/logging.class.php b/admin/inc/logging.class.php new file mode 100644 index 0000000..81303b7 --- /dev/null +++ b/admin/inc/logging.class.php @@ -0,0 +1,134 @@ +add('field','value'); // add record entries to log record + * $class->save(); // write log record to file + * $class->clear(); // removes log file + */ + +class GS_Logging_Class { + + private $_xml; + private $_xmlfile; + private $_entry; + + function __construct($filename,$logdefaults=true) { + // check filename, must be .log + + if($this->validFilename($filename)){ + $this->_xmlfile = GSDATAOTHERPATH.'logs/'.$filename; + if ( file_exists($this->_xmlfile) ) { + $xml = file_get_contents($this->_xmlfile); + if($xml) $this->_xml = simplexml_load_string($xml, 'SimpleXMLExtended', LIBXML_NOCDATA); + else $this->_xml = new SimpleXMLExtended(''); + } else { + $this->_xml = new SimpleXMLExtended(''); + } + + // create entry and add date + $thislog = $this->_xml->addChild('entry'); + $thislog->addChild('date', date('r')); + $this->_entry = $thislog; + + if($logdefaults==true) $this->defaults(); + } + else return false; + } + + /* + * Checks valid filenames + * Filename must have extension .log and not have path info + * + * @thows Exception + * @returns bool success + * + */ + private static function validFilename($filename){ + $pathinfo=pathinfo($filename); + if(!isset($pathinfo['extension']) || strtolower($pathinfo['extension']) != 'log' || $pathinfo['dirname']!='.'){ + throw new Exception("Filename is not valid in GS_Logging_Class"); + } else { + return true; + } + } + + /* + * Add default fields to log + * Adds Username(If logged in),IP Address + * + */ + private function defaults(){ + GLOBAL $USR; + + if(isset($USR)){ + $cdata = $this->_entry->addChild('Username'); + $cdata->addCData(htmlentities($USR, ENT_QUOTES)); + } + + $cdata = $this->_entry->addChild('IP_Address'); + $ip = getenv("REMOTE_ADDR"); + $cdata->addCData(htmlentities($ip, ENT_QUOTES)); + } + + /* + * Save Log Record + * Writes file + * + * @return success + */ + public function save(){ + return XMLsave($this->_xml, $this->_xmlfile); + } + + /* + * Clear Log File + * Deletes Log File + * + * @return success + */ + public function clear(){ + if (is_file($this->_xmlfile)) { + $res = unlink($this->_xmlfile); + exec_action('logfile_delete'); + return $res; + } + } + + /* + * Add Log Record Field + * + * @param string $field + * @param string $value + * + * @return success + */ + public function add($field,$value){ + if(isset($field) && isset($value) && isset($this->_entry)){ + $cdata = $this->_entry->addChild(htmlentities($field, ENT_QUOTES)); + $cdata->addCData(safe_slash_html($value)); + } + } + +} // end of class + +?> \ No newline at end of file diff --git a/admin/inc/login_functions.php b/admin/inc/login_functions.php new file mode 100644 index 0000000..18baa25 --- /dev/null +++ b/admin/inc/login_functions.php @@ -0,0 +1,83 @@ +PWD; + $USR = strtolower($data->USR); + + # do the username and password match? + if ( ($userid == $USR) && ($password == $PASSWD) ) { + $authenticated = true; + } else { + $authenticated = false; + + # add login failure to failed logins log + $logFailed = new GS_Logging_Class('failedlogins.log'); + $logFailed->add('Username',$userid); + $logFailed->add('Reason','Invalid Password'); + + } # end password match check + + } else { + # user doesnt exist in this system + $authenticated = false; + + # add login failure to failed logins log + $logFailed = new GS_Logging_Class('failedlogins.log'); + $logFailed->add('Username',$userid); + $logFailed->add('Reason','Invalid User'); + } + + # is this successful? + if( $authenticated ) { + # YES - set the login cookie, then redirect user to secure panel + create_cookie(); + exec_action('successful-login-end'); + redirect($cookie_redirect); + } else { + # NO - show error message + $error = i18n_r('LOGIN_FAILED'); + $logFailed->save(); + } # end authenticated check + + } # end error check + +} # end submission check +?> \ No newline at end of file diff --git a/admin/inc/nonce.php b/admin/inc/nonce.php new file mode 100644 index 0000000..73c894f --- /dev/null +++ b/admin/inc/nonce.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/inc/plugin_functions.php b/admin/inc/plugin_functions.php new file mode 100644 index 0000000..a412c12 --- /dev/null +++ b/admin/inc/plugin_functions.php @@ -0,0 +1,670 @@ +$en) { + $pluginsLoaded=true; + # debugLog("plugin: $file" . " exists: " . file_exists(GSPLUGINPATH . $file) ." enabled: " . $en); + if ($en=='true' && file_exists(GSPLUGINPATH . $file)){ + require_once(GSPLUGINPATH . $file); + } else { + if(!is_frontend() and get_filename_id() == 'plugins'){ + $apiback = get_api_details('plugin', $file); + $response = json_decode($apiback); + if ($response and $response->status == 'successful') { + register_plugin( pathinfo_filename($file), $file, 'disabled', $response->owner, '', i18n_r('PLUGIN_DISABLED'), '', ''); + } else { + register_plugin( pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', ''); + } + } else { + register_plugin( pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', ''); + } + } +} + +/** + * change_plugin + * + * Enable/Disable a plugin + * + * @since 2.04 + * @uses $live_plugins + * + * @param $name + * @param $active bool default=null, sets plugin active | inactive else toggle + */ +function change_plugin($name,$active=null){ + global $live_plugins; + if (isset($live_plugins[$name])){ + + // set plugin active | inactive + if(isset($active) and is_bool($active)) { + $live_plugins[$name] = $active ? 'true' : 'false'; + create_pluginsxml(true); + return; + } + + // else we toggle + if ($live_plugins[$name]=="true"){ + $live_plugins[$name]="false"; + } else { + $live_plugins[$name]="true"; + } + + create_pluginsxml(true); + } +} + + +/** + * read_pluginsxml + * + * Read in the plugins.xml file and populate the $live_plugins array + * + * @since 2.04 + * @uses $live_plugins + * + */ +function read_pluginsxml(){ + global $live_plugins; + + $data = getXML(GSDATAOTHERPATH . "plugins.xml"); + if($data){ + $componentsec = $data->item; + if (count($componentsec) != 0) { + foreach ($componentsec as $component) { + $live_plugins[trim((string)$component->plugin)]=trim((string)$component->enabled); + } + } + } +} + + +/** + * create_pluginsxml + * + * If the plugins.xml file does not exists, read in each plugin + * and add it to the file. + * read_pluginsxml() is called again to repopulate $live_plugins + * + * @since 2.04 + * @uses $live_plugins + * + */ +function create_pluginsxml($force=false){ + global $live_plugins; + if (file_exists(GSPLUGINPATH)){ + $pluginfiles = getFiles(GSPLUGINPATH); + } + $phpfiles = array(); + foreach ($pluginfiles as $fi) { + if (lowercase(pathinfo($fi, PATHINFO_EXTENSION))=='php') { + $phpfiles[] = $fi; + } + } + if (!$force) { + $livekeys = array_keys($live_plugins); + if (count(array_diff($livekeys, $phpfiles))>0 || count(array_diff($phpfiles, $livekeys))>0) { + $force = true; + } + } + if ($force) { + $xml = @new SimpleXMLExtended(''); + foreach ($phpfiles as $fi) { + $plugins = $xml->addChild('item'); + $p_note = $plugins->addChild('plugin'); + $p_note->addCData($fi); + $p_note = $plugins->addChild('enabled'); + if (isset($live_plugins[(string)$fi])){ + $p_note->addCData($live_plugins[(string)$fi]); + } else { + $p_note->addCData('false'); + } + } + XMLsave($xml, GSDATAOTHERPATH."plugins.xml"); + read_pluginsxml(); + } + +} + + +/** + * Add Action + * + * @since 2.0 + * @uses $plugins + * @uses $live_plugins + * + * @param string $hook_name + * @param string $added_function + * @param array $args + */ +function add_action($hook_name, $added_function, $args = array()) { + global $plugins; + global $live_plugins; + + $bt = debug_backtrace(); + $shift=count($bt) - 4; // plugin name should be + $caller = array_shift($bt); + $realPathName=pathinfo_filename($caller['file']); + $realLineNumber=$caller['line']; + while ($shift > 0) { + $caller = array_shift($bt); + $shift--; + } + $pathName= pathinfo_filename($caller['file']); + + if ((isset ($live_plugins[$pathName.'.php']) && $live_plugins[$pathName.'.php']=='true') || $shift<0 ){ + if ($realPathName!=$pathName) { + $pathName=$realPathName; + $lineNumber=$realLineNumber; + } else { + $lineNumber=$caller['line']; + } + + $plugins[] = array( + 'hook' => $hook_name, + 'function' => $added_function, + 'args' => (array) $args, + 'file' => $pathName.'.php', + 'line' => $caller['line'] + ); + } +} + +/** + * Execute Action + * + * @since 2.0 + * @uses $plugins + * + * @param string $a Name of hook to execute + */ +function exec_action($a) { + global $plugins; + + foreach ($plugins as $hook) { + if ($hook['hook'] == $a) { + call_user_func_array($hook['function'], $hook['args']); + } + } +} + +/** + * Create Side Menu + * + * This adds a side level link to a control panel's section + * + * @since 2.0 + * @uses $plugins + * + * @param string $id ID of the link you are adding + * @param string $txt Text to add to tabbed link + */ + +function createSideMenu($id, $txt, $action=null, $always=true){ + $current = false; + if (isset($_GET['id']) && $_GET['id'] == $id && (!$action || isset($_GET[$action]))) { + $current = true; + } + if ($always || $current) { + echo '
  • '.$txt.'
  • '; + } +} + +/** + * Create Navigation Tab + * + * This adds a top level tab to the control panel + * + * @since 2.0 + * @uses $plugins + * + * @param string $id Id of current page + * @param string $txt Text to add to tabbed link + * @param string $klass class to add to a element + */ +function createNavTab($tabname, $id, $txt, $action=null) { + global $plugin_info; + $current = false; + if (basename($_SERVER['PHP_SELF']) == 'load.php') { + $plugin_id = @$_GET['id']; + if ($plugin_info[$plugin_id]['page_type'] == $tabname) $current = true; + } + echo ''; +} + +/** + * Register Plugin + * + * @since 2.0 + * @uses $plugin_info + * + * @param string $id Unique ID of your plugin + * @param string $name Name of the plugin + * @param string $ver Optional, default is null. + * @param string $auth Optional, default is null. + * @param string $auth_url Optional, default is null. + * @param string $desc Optional, default is null. + * @param string $type Optional, default is null. This is the page type your plugin is classifying itself + * @param string $loaddata Optional, default is null. This is the function that run on load + */ +function register_plugin($id, $name, $ver=null, $auth=null, $auth_url=null, $desc=null, $type=null, $loaddata=null) { + global $plugin_info; + + $plugin_info[$id] = array( + 'name' => $name, + 'version' => $ver, + 'author' => $auth, + 'author_url' => $auth_url, + 'description' => $desc, + 'page_type' => $type, + 'load_data' => $loaddata + ); + +} + + +/** + * Add Filter + * + * @since 2.0 + * @uses $filters + * @uses $live_plugins + * + * @param string $id Id of current page + * @param string $txt Text to add to tabbed link + */ +function add_filter($filter_name, $added_function) { + global $filters; + global $live_plugins; + $bt = debug_backtrace(); + $caller = array_shift($bt); + $pathName= pathinfo_filename($caller['file']); + $filters[] = array( + 'filter' => $filter_name, + 'function' => $added_function + ); +} + +/** + * Execute Filter + * + * Allows changing of the passed variable + * + * @since 2.0 + * @uses $filters + * + * @param string $script Filter name to execute + * @param array $data + */ +function exec_filter($script,$data=array()) { + global $filters; + foreach ($filters as $filter) { + if ($filter['filter'] == $script) { + $data = call_user_func_array($filter['function'], array($data)); + } + } + return $data; +} + +/** + * Register Script + * + * Register a script to include in Themes + * + * @since 3.1 + * @uses $GS_scripts + * + * @param string $handle name for the script + * @param string $src location of the src for loading + * @param string $ver script version + * @param boolean $in_footer load the script in the footer if true + */ +function register_script($handle, $src, $ver, $in_footer=FALSE){ + global $GS_scripts; + $GS_scripts[$handle] = array( + 'name' => $handle, + 'src' => $src, + 'ver' => $ver, + 'in_footer' => $in_footer, + 'where' => 0 + ); +} + +/** + * De-Register Script + * + * Deregisters a script + * + * @since 3.1 + * @uses $GS_scripts + * + * @param string $handle name for the script to remove + */ +function deregister_script($handle){ + global $GS_scripts; + if (array_key_exists($handle, $GS_scripts)){ + unset($GS_scripts[$handle]); + } +} + +/** + * Queue Script + * + * Queue a script for loading + * + * @since 3.1 + * @uses $GS_scripts + * + * @param string $handle name for the script to load + */ +function queue_script($handle,$where){ + global $GS_scripts; + if (array_key_exists($handle, $GS_scripts)){ + $GS_scripts[$handle]['load']=true; + $GS_scripts[$handle]['where']=$GS_scripts[$handle]['where'] | $where; + } +} + +/** + * De-Queue Script + * + * Remove a queued script + * + * @since 3.1 + * @uses $GS_scripts + * + * @param string $handle name for the script to load + */ +function dequeue_script($handle, $where){ + global $GS_scripts; + if (array_key_exists($handle, $GS_scripts)){ + $GS_scripts[$handle]['load']=false; + $GS_scripts[$handle]['where']=$GS_scripts[$handle]['where'] & ~ $where; + } +} + +/** + * Get Scripts + * + * Echo and load scripts + * + * @since 3.1 + * @uses $GS_scripts + * + * @param boolean $footer Load only script with footer flag set + */ +function get_scripts_frontend($footer=FALSE){ + global $GS_scripts; + if (!$footer){ + get_styles_frontend(); + } + foreach ($GS_scripts as $script){ + if ($script['where'] & GSFRONT ){ + if (!$footer){ + if ($script['load']==TRUE && $script['in_footer']==FALSE ){ + echo ''; + cdn_fallback($script); + } + } else { + if ($script['load']==TRUE && $script['in_footer']==TRUE ){ + echo ''; + cdn_fallback($script); + } + } + } + } +} + +/** + * Get Scripts + * + * Echo and load scripts + * + * @since 3.1 + * @uses $GS_scripts + * + * @param boolean $footer Load only script with footer flag set + */ +function get_scripts_backend($footer=FALSE){ + global $GS_scripts; + if (!$footer){ + get_styles_backend(); + } + + # debugLog($GS_scripts); + foreach ($GS_scripts as $script){ + if ($script['where'] & GSBACK ){ + if (!$footer){ + if ($script['load']==TRUE && $script['in_footer']==FALSE ){ + echo ''; + cdn_fallback($script); + } + } else { + if ($script['load']==TRUE && $script['in_footer']==TRUE ){ + echo ''; + cdn_fallback($script); + } + } + } + } +} + +/** + * Add javascript for cdn fallback to local + * get_scripts_backend helper + * @param array $script gsscript array + */ +function cdn_fallback($script){ + GLOBAL $GS_script_assets, $GS_asset_objects; + if (getDef('GSNOCDN',true)) return; // if nocdn skip + if($script['name'] == 'jquery' || $script['name'] == 'jquery-ui'){ + echo ""; + } +} + +/** + * Queue Style + * + * Queue a Style for loading + * + * @since 3.1 + * @uses $GS_styles + * + * @param string $handle name for the Style to load + */ +function queue_style($handle,$where=1){ + global $GS_styles; + if (array_key_exists($handle, $GS_styles)){ + $GS_styles[$handle]['load']=true; + $GS_styles[$handle]['where']=$GS_styles[$handle]['where'] | $where; + } +} + +/** + * De-Queue Style + * + * Remove a queued Style + * + * @since 3.1 + * @uses $GS_styles + * + * @param string $handle name for the Style to load + */ +function dequeue_style($handle,$where){ + global $GS_styles; + if (array_key_exists($handle, $GS_styles)){ + $GS_styles[$handle]['load']=false; + $GS_styles[$handle]['where']=$GS_styles[$handle]['where'] & ~$where; + } +} + +/** + * Register Style + * + * Register a Style to include in Themes + * + * @since 3.1 + * @uses $GS_scripts + * + * @param string $handle name for the Style + * @param string $src location of the src for loading + * @param string $ver Style version + * @param string $media load the Style in the footer if true + */ +function register_style($handle, $src, $ver, $media){ + global $GS_styles; + $GS_styles[$handle] = array( + 'name' => $handle, + 'src' => $src, + 'ver' => $ver, + 'media' => $media, + 'where' => 0 + ); +} + +/** + * Get Styles Frontend + * + * Echo and load Styles in the Theme header + * + * @since 3.1 + * @uses $GS_styles + * + */ +function get_styles_frontend(){ + global $GS_styles; + foreach ($GS_styles as $style){ + if ($style['where'] & GSFRONT ){ + if ($style['load']==TRUE){ + echo ''; + } + } + } +} +/** + * Get Styles Backend + * + * Echo and load Styles on Admin + * + * @since 3.1 + * @uses $GS_styles + * + */ +function get_styles_backend(){ + global $GS_styles; + foreach ($GS_styles as $style){ + if ($style['where'] & GSBACK ){ + if ($style['load']==TRUE){ + echo ''; + } + } + } +} +?> diff --git a/admin/inc/security_functions.php b/admin/inc/security_functions.php new file mode 100644 index 0000000..69b2fdc --- /dev/null +++ b/admin/inc/security_functions.php @@ -0,0 +1,227 @@ +?#', '', $str); + $str = preg_replace('# + + GetSimple Default Admin + Chris Cagle + http://www.cagintranet.com/ + + + + #0E1316 + + + + #182227 + + + + #283840 + + + + #415A66 + + + + #618899 + + + + #E8EDF0 + + + + #AFC5CF + + + + + + #9F2C04 + + + + #CF3805 + + + \ No newline at end of file diff --git a/admin/inc/tmp/tmp-components.xml b/admin/inc/tmp/tmp-components.xml new file mode 100644 index 0000000..6e08b9b --- /dev/null +++ b/admin/inc/tmp/tmp-components.xml @@ -0,0 +1,12 @@ + +<![CDATA[Sidebar]]>sidebar<![CDATA[Tagline]]>tagline diff --git a/admin/inc/tmp/tmp-index.xml b/admin/inc/tmp/tmp-index.xml new file mode 100644 index 0000000..93be42c --- /dev/null +++ b/admin/inc/tmp/tmp-index.xml @@ -0,0 +1,27 @@ + +Tue, 01 Sep 2009 18:35:53 -0700<![CDATA[Welcome to GetSimple!]]> diff --git a/admin/inc/tmp/tmp.allow.htaccess b/admin/inc/tmp/tmp.allow.htaccess new file mode 100644 index 0000000..de731d4 --- /dev/null +++ b/admin/inc/tmp/tmp.allow.htaccess @@ -0,0 +1,24 @@ +# +# GetSimple CMS htaccess ALLOW file +# + +# prevent breaking plugin htaccess, prefer compat, since require is not overridable by order + +# apache < 2.3 + + Allow from all + + +# apache > 2.3 with mod_access_compat + + Allow from all + + +# apache > 2.3 without mod_access_compat + + + + Require all granted + + + \ No newline at end of file diff --git a/admin/inc/tmp/tmp.deny.htaccess b/admin/inc/tmp/tmp.deny.htaccess new file mode 100644 index 0000000..4fa7e53 --- /dev/null +++ b/admin/inc/tmp/tmp.deny.htaccess @@ -0,0 +1,24 @@ +# +# GetSimple CMS htaccess DENY file +# + +# prevent breaking plugin htaccess, prefer compat, since require is not overridable by order + +# apache < 2.3 + + Deny from all + + +# apache > 2.3 with mod_access_compat + + Deny from all + + +# apache > 2.3 without mod_access_compat + + + + Require all denied + + + \ No newline at end of file diff --git a/admin/inc/xss.php b/admin/inc/xss.php new file mode 100644 index 0000000..73c894f --- /dev/null +++ b/admin/inc/xss.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..8ec46f4 --- /dev/null +++ b/admin/index.php @@ -0,0 +1,42 @@ + + + + +
    + +
    +
    +
    +

    + + +

    «   |   »

    +
    +
    +
    +
    + \ No newline at end of file diff --git a/admin/lang/en_US.php b/admin/lang/en_US.php new file mode 100644 index 0000000..fd6d347 --- /dev/null +++ b/admin/lang/en_US.php @@ -0,0 +1,542 @@ + "Unable to continue: PHP 5.1.3 or greater is required, you have ", +"SIMPLEXML_ERROR" => "Unable to continue: SimpleXML is not installed", +"CURL_WARNING" => "Warning: cURL Not Installed", +"TZ_WARNING" => "Warning: date_default_timezone_set is missing", +"WEBSITENAME_ERROR" => "Error: There was a problem with your website title", +"WEBSITEURL_ERROR" => "Error: There was a problem with your website URL", +"USERNAME_ERROR" => "Error: Username was not set", +"EMAIL_ERROR" => "Error: There was a problem with your email address", +"CHMOD_ERROR" => "Unable to continue: Unable to write the configuration file. CHMOD 755 or 777 the /data, /backups folders & sub-folders and retry.", +"EMAIL_COMPLETE" => "Setup Complete", +"EMAIL_USERNAME" => "Your username is", +"EMAIL_PASSWORD" => "Your new password is", +"EMAIL_LOGIN" => "Login here", +"EMAIL_THANKYOU" => "Thank you for using", +"NOTE_REGISTRATION" => "Your registration information has been sent to", +"NOTE_REGERROR" => "Error: There was a problem sending out the registration information via email. Please make note of the password below", +"NOTE_USERNAME" => "Your username is", +"NOTE_PASSWORD" => "and your password is", +"INSTALLATION" => "Installation", +"LABEL_WEBSITE" => "Website Name", +"LABEL_BASEURL" => "Website URL", +"LABEL_SUGGESTION" => "Our suggestion is", +"LABEL_USERNAME" => "Username", +"LABEL_DISPNAME" => "Display Name", +"LABEL_EMAIL" => "Email Address", +"LABEL_INSTALL" => "Install Now!", +"SELECT_LANGUAGE" => "Select your language", +"CONTINUE_SETUP" => "Continue with Setup", +"DOWNLOAD_LANG" => "Download Languages", +"SITE_UPDATED" => "Your site has been updated", +"SERVICE_UNAVAILABLE" => "This page is temporarily unavailable", + +/* + * For: pages.php +*/ +"MENUITEM_SUBTITLE" => "menu item", +"HOMEPAGE_SUBTITLE" => "homepage", +"PRIVATE_SUBTITLE" => "private", +"EDITPAGE_TITLE" => "Edit Page", +"VIEWPAGE_TITLE" => "View Page", +"DELETEPAGE_TITLE" => "Delete Page", +"PAGE_MANAGEMENT" => "Page Management", +"TOGGLE_STATUS" => "Toggle Status", +"TOTAL_PAGES" => "total pages", +"ALL_PAGES" => "Pages", + +/* + * For: edit.php +*/ +"PAGE_NOTEXIST" => "The requested page does not exist", +"BTN_SAVEPAGE" => "Save Page", +"BTN_SAVEUPDATES" => "Save Updates", +"DEFAULT_TEMPLATE" => "Default Template", +"NONE" => "None", +"PAGE" => "Page", +"NEW_PAGE" => "New Page", +"PAGE_EDIT_MODE" => "Edit Page", +"CREATE_NEW_PAGE" => "Add New Page", +"VIEW" => "View", +"PAGE_OPTIONS" => "Page Options", +"SLUG_URL" => "Custom URL (Slug)", +"TAG_KEYWORDS" => "Tags & Keywords", +"PARENT_PAGE" => "Page Parent", +"TEMPLATE" => "Page Template", +"KEEP_PRIVATE" => "Page Visibility", +"ADD_TO_MENU" => "Add this page to the menu", +"PRIORITY" => "Priority", +"MENU_TEXT" => "Menu Text", +"LABEL_PAGEBODY" => "Page Body", +"CANCEL" => "Cancel", +"BACKUP_AVAILABLE" => "Backup Available", +"MAX_FILE_SIZE" => "Max file size", +"LAST_SAVED" => "Page last saved by %s on", +"FILE_UPLOAD" => "File Upload", +"OR" => "or", +"SAVE_AND_CLOSE" => "Save & Close", +"PAGE_UNSAVED" => "Page has unsaved changes", + +/* + * For: upload.php +*/ +"ERROR_UPLOAD" => "There was a problem with the file upload", +"FILE_SUCCESS_MSG" => "Success! File location", +"FILE_MANAGEMENT" => "File Management", +"UPLOADED_FILES" => "Uploaded Files", +"SHOW_ALL" => "Show All", +"VIEW_FILE" => "View File", +"DELETE_FILE" => "Delete File", +"TOTAL_FILES" => "total files & folders", + +/* + * For: logout.php +*/ +"MSG_LOGGEDOUT" => "You are now logged out.", + +/* + * For: index.php +*/ +"LOGIN" => "Login", +"USERNAME" => "Username", +"PASSWORD" => "Password", +"FORGOT_PWD" => "Forgot your password?", +"CONTROL_PANEL" => "Control Panel Login", + +/* + * For: navigation.php +*/ +"CURRENT_MENU" => "Current Menu", +"NO_MENU_PAGES" => "There are no pages that are set to appear within the main menu", + +/* + * For: theme-edit.php +*/ +"TEMPLATE_FILE" => "Template file %s has successfully been updated!", +"THEME_MANAGEMENT" => "Theme Management", +"EDIT_THEME" => "Theme Editor", +"EDITING_FILE" => "Editing File", +"BTN_SAVECHANGES" => "Save Changes", +"EDIT" => "Edit", + +/* + * For: support.php +*/ +"SETTINGS_UPDATED" => "Your settings have been updated", +"UNDO" => "Undo", +"SUPPORT" => "Support", +"SETTINGS" => "Settings", +"ERROR" => "Error", +"BTN_SAVESETTINGS" => "Save Settings", +"VIEW_FAILED_LOGIN" => "View Failed Login Attempts", + + +/* + * For: log.php +*/ +"MSG_HAS_BEEN_CLR" => " has been cleared", +"LOGS" => "Logs", +"VIEWING" => "Viewing", +"LOG_FILE" => "Log File", +"CLEAR_ALL_DATA" => "Clear all data from", +"CLEAR_THIS_LOG" => "Clear This Log", +"LOG_FILE_ENTRY" => "LOG FILE ENTRY", +"THIS_COMPUTER" => "This Computer", + +/* + * For: backup-edit.php +*/ +"BAK_MANAGEMENT" => "Backup Management", +"ASK_CANCEL" => "Cancel", // 'c' is the accesskey identifier +"ASK_RESTORE" => "Restore", // 'r' is the accesskey identifier +"ASK_DELETE" => "Delete", // 'd' is the accesskey identifier +"BACKUP_OF" => "Backup of", +"PAGE_TITLE" => "Page Title", +"YES" => "Yes", +"NO" => "No", +"DATE" => "Date", +"PERMS" => "Perms", + +/* + * For: components.php +*/ +"COMPONENTS" => "Components", +"DELETE_COMPONENT" => "Delete Component", +"EDIT" => "Edit", +"ADD_COMPONENT" => "Add Component", // 'a' is the accesskey identifier +"SAVE_COMPONENTS" => "Save Components", + +/* + * For: sitemap.php +*/ +"SITEMAP_CREATED" => "Sitemap Created! We also successfully pinged 4 search engines of the update", +"SITEMAP_ERRORPING" => "Sitemap Created, however there was an error pinging one or more of the search engines", +"SITEMAP_ERROR" => "Your sitemap could not be generated", +"SITEMAP_WAIT" => "Please Wait: Creating website sitemap", + +/* + * For: theme.php +*/ +"THEME_CHANGED" => "Your theme has been changed successfully", +"CHOOSE_THEME" => "Choose Your Theme", +"ACTIVATE_THEME" => "Activate Theme", +"THEME_SCREENSHOT" => "Theme Screenshot", +"THEME_PATH" => "Theme Folder Location", + +/* + * For: resetpassword.php +*/ +"RESET_PASSWORD" => "Reset Password", +"YOUR_NEW" => "Your new", +"PASSWORD_IS" => "password is", +"ATTEMPT" => "Attempt", +"MSG_PLEASE_EMAIL" => "Please enter the username registered on this system, and a new password will be sent to its email address.", +"SEND_NEW_PWD" => "Send New Password", + +/* + * For: settings.php +*/ +"GENERAL_SETTINGS" => "General Settings", +"WEBSITE_SETTINGS" => "Website Settings", +"LOCAL_TIMEZONE" => "Local Timezone", +"LANGUAGE" => "Language", +"USE_FANCY_URLS" => "Use Fancy URLs - Requires that your host has mod_rewrite enabled", +"ENABLE_HTML_ED" => "Enable the HTML editor", +"WARN_EMAILINVALID" => "WARNING: This email address does not look valid!", +"ONLY_NEW_PASSWORD" => "Only provide a password below if you want to change your current one", +"NEW_PASSWORD" => "New Password", +"CONFIRM_PASSWORD" => "Confirm Password", +"PASSWORD_NO_MATCH" => "Passwords do not match", +"PERMALINK" => "Custom Permalink Structure", +"MORE" => "more", +"HELP" => "help", +"FLUSHCACHE" => "Flush All Caches", +"FLUSHCACHE-SUCCESS"=> "Caches Flushed Successfully", +"DISPLAY_NAME" => "A name for public display that is not your username", + +/* + * For: health-check.php +*/ +"WEB_HEALTH_CHECK" => "Website Health Check", +"VERSION" => "Version", +"UPG_NEEDED" => "Upgrade Recommended", +"CANNOT_CHECK" => "Upgrade Check Failed !", +"LATEST_VERSION" => "Latest version installed", +"SERVER_SETUP" => "Server Setup", +"OR_GREATER_REQ" => "or greater is required", +"OK" => "OK", +"INSTALLED" => "Installed", +"NOT_INSTALLED" => "Not Installed", +"WARNING" => "Warning", +"DATA_FILE_CHECK" => "Data File Integrity Check", +"DIR_PERMISSIONS" => "Directory Permissions", +"EXISTANCE" => "%s Existence", +"MISSING_FILE" => "Missing file", +"BAD_FILE" => "Bad file", +"NO_FILE" => "No file", +"GOOD_D_FILE" => "Good 'Deny' file", +"GOOD_A_FILE" => "Good 'Allow' file", +"CANNOT_DEL_FILE" => "Cannot Delete File", +"DOWNLOAD" => "Download", +"WRITABLE" => "Writable", +"NOT_WRITABLE" => "Not Writable", + +/* + * For: footer.php +*/ +"POWERED_BY" => "Powered by", + +/* + * For: backups.php +*/ +"PAGE_BACKUPS" => "Page Backups", +"ASK_DELETE_ALL" => "Delete All", +"DELETE_ALL_BAK" => "Delete all backups?", +"TOTAL_BACKUPS" => "total backups", + +/* + * For: archive.php +*/ +"SUCC_WEB_ARCHIVE" => "An archive of your website has been successfully created", +"SUCC_WEB_ARC_DEL" => "The seleted archive has been successfully deleted", +"WEBSITE_ARCHIVES" => "Website Archives", +"ARCHIVE_DELETED" => "Archive deleted successfully", +"CREATE_NEW_ARC" => "Create a New Archive", +"ASK_CREATE_ARC" => "Create New Archive Now", +"CREATE_ARC_WAIT" => "Please Wait: Creating website archive...", +"DOWNLOAD_ARCHIVES" => "Download Archive", +"DELETE_ARCHIVE" => "Delete Archive", +"TOTAL_ARCHIVES" => "total archives", + +/* + * For: include-nav.php +*/ +"WELCOME" => "Welcome", // used as 'Welcome USERNAME!' +"TAB_PAGES" => "Pages", +"TAB_FILES" => "Files", +"TAB_THEME" => "Theme", +"TAB_BACKUPS" => "Backups", +"PLUGINS_NAV" => "Plugins", +"TAB_SETTINGS" => "Settings", +"TAB_SUPPORT" => "Support", +"TAB_LOGOUT" => "Logout", + +/* + * For: sidebar-files.php +*/ +"BROWSE_COMPUTER" => "Browse Your Computer", +"UPLOAD" => "Upload", + +/* + * For: sidebar-support.php +*/ +"SIDE_SUPPORT_LOG" => "Support", +"SIDE_HEALTH_CHK" => "Website Health Check", +"SIDE_DOCUMENTATION"=> "Wiki Documentation", +"SIDE_VIEW_LOG"=> "View Log", + +/* + * For: sidebar-theme.php +*/ +"SIDE_VIEW_SITEMAP" => "View Sitemap", +"SIDE_GEN_SITEMAP" => "Generate Sitemap", +"SIDE_COMPONENTS" => "Edit Components", +"SIDE_EDIT_THEME" => "Edit Theme", +"SIDE_CHOOSE_THEME" => "Choose Theme", + +/* + * For: sidebar-pages.php +*/ +"SIDE_CREATE_NEW" => "Create New Page", +"SIDE_VIEW_PAGES" => "View All Pages", + +/* + * For: sidebar-settings.php +*/ +"SIDE_GEN_SETTINGS" => "General Settings", +"SIDE_USER_PROFILE" => "User Profile", + +/* + * For: sidebar-backups.php +*/ +"SIDE_VIEW_BAK" => "View Page Backup", +"SIDE_WEB_ARCHIVES" => "Website Archives", +"SIDE_PAGE_BAK" => "Page Backups", + +/* + * For: error_checking.php +*/ +"ER_PWD_CHANGE" => "Don't forget to change your password from that random generated one you have now...", +"ER_BAKUP_DELETED" => "The backup has been deleted for %s", +"ER_REQ_PROC_FAIL" => "The requested process failed", +"ER_YOUR_CHANGES" => "Your changes to %s have been saved", +"ER_HASBEEN_REST" => "%s has been restored", +"ER_HASBEEN_DEL" => "%s has been deleted", +"ER_CANNOT_INDEX" => "You cannot change the URL of the index page", +"ER_SETTINGS_UPD" => "Your settings have been updated", +"ER_OLD_RESTORED" => "Your old settings have been restored", +"ER_NEW_PWD_SENT" => "A new password has been sent to the email address provided", +"ER_SENDMAIL_ERR" => "There was a problem sending the email. Please try again", +"ER_FILE_DEL_SUC" => "File deleted successfully", +"ER_PROBLEM_DEL" => "There was a problem deleting the file", +"ER_COMPONENT_SAVE" => "Your components have been saved", +"ER_COMPONENT_REST" => "Your components have been restored", +"ER_CANCELLED_FAIL" => "Cancelled: This update has been cancelled", + +/* + * For: changedata.php +*/ +"CANNOT_SAVE_EMPTY" => "You cannot save a page with an empty title", +"META_DESC" => "Meta Description", + +/* + * For: template_functions.php +*/ +"FTYPE_COMPRESSED" => "Compressed", //a file-type +"FTYPE_VECTOR" => "Vector", //a file-type +"FTYPE_FLASH" => "Flash", //a file-type +"FTYPE_VIDEO" => "Video", //a file-type +"FTYPE_AUDIO" => "Audio", //a file-type +"FTYPE_WEB" => "Web", //a file-type +"FTYPE_DOCUMENTS" => "Documents", //a file-type +"FTYPE_SYSTEM" => "System", //a file-type +"FTYPE_MISC" => "Misc", //a file-type +"IMAGES" => "Images", + +/* + * For: login_functions.php +*/ +"FILL_IN_REQ_FIELD" => "Please fill in all the required fields", +"LOGIN_FAILED" => "Login failed. Please double check your Username and Password", + +/* + * For: Date Format +*/ +"DATE_FORMAT" => "M j, Y", //please keep short +"DATE_AND_TIME_FORMAT" => "F jS, Y - g:i A", //date and time + +/* + * For: support.php +*/ +"WELCOME_MSG" => "Thank you for choosing GetSimple as your content management system!", +"WELCOME_P" => "GetSimple makes managing a website as simple as possible with its best-in-class user interface. We strive to keep the system easy enough for anyone to use, yet powerful enough for a developer to enable all the features that are needed.

    Some first steps that might be useful:

    ", +"GETTING_STARTED" => "Getting Started", + +/* + * For: image.php +*/ + +"CURRENT_THUMBNAIL" => "Current Thumbnail", +"RECREATE" => "recreate", +"CREATE_ONE" => "create one", +"IMG_CONTROl_PANEL" => "Image Control Panel", +"ORIGINAL_IMG" => "Original Image", +"CLIPBOARD_INSTR" => "Select All", +"CREATE_THUMBNAIL" => "Create Thumbnail", +"CROP_INSTR_NEW" => "ctrl-B or command-B for square", +"SELECT_DIMENTIONS" => "Selection Dimentions", +"HTML_ORIG_IMG" => "Original Image HTML", +"LINK_ORIG_IMG" => "Original Image Link", +"HTML_THUMBNAIL" => "Thumbnail HTML", +"LINK_THUMBNAIL" => "Thumbnail Link", +"HTML_THUMB_ORIG" => "Thumbnail-to-Image HTML", + +/* + * For: plugins.php +*/ + +"PLUGINS_MANAGEMENT"=> "Plugin Management", +"PLUGINS_INSTALLED" => "plugins installed", +"PLUGIN_DISABLED" => "Disabled Plugin", +"SHOW_PLUGINS" => "Installed Plugins", +"PLUGIN_NAME" => "Plugin", +"PLUGIN_DESC" => "Description", +"PLUGIN_VER" => "Version", +"PLUGIN_UPDATED" => "Plugin Updated", + + + +/*********************************************************************************** + * SINCE Version 3.0 +***********************************************************************************/ + +/* + * For: setup.php + */ + +"ROOT_HTACCESS_ERROR" => "Failed to create .htaccess in root! Please copy %s to .htaccess and change %s to %s", +"REMOVE_TEMPCONFIG_ERROR" => "Failed to remove %s! Please do it manually.", +"MOVE_TEMPCONFIG_ERROR" => "Failed to rename %s to %s! Please do it manually.", +"KILL_CANT_CONTINUE" => "Cannot continue. Please fix errors and try again.", +"REFRESH" => "Refresh", +"BETA"=> "Beta / Bleeding Edge", + +/* + * Misc Cleanup Work + */ + +# new to 3.0 +"HOMEPAGE_DELETE_ERROR" => "You cannot delete your homepage", //deletefile +"NO_ZIPARCHIVE" => "ZipArchive extension is not installed. Unable to continue", //zip +"REDIRECT_MSG"=> "If your browser does not redirect you, click here", //basic +"REDIRECT"=> "Redirect", //basic +"DENIED"=> "Denied", //sitemap +"DEBUG_MODE"=> "DEBUG MODE", //nav-include +"DOUBLE_CLICK_EDIT"=> "Double Click to Edit", //components +"THUMB_SAVED"=> "Thumbnail Saved", //image +"EDIT_COMPONENTS" => "Edit Components", //components +"REQS_MORE_INFO"=> "For more information on the required modules, visit the requirements page.", //install & health-check +"SYSTEM_UPDATE" => "System Update", // update.php +"AUTHOR" => "Author", //plugins.php +"ENABLE" => "Activate", //plugins.php +"DISABLE" => "Deactivate", //plugins.php +"NO_THEME_SCREENSHOT" => "Your theme does not have a screenshot preview", //theme.php +"UNSAVED_INFORMATION" => "You are about to leave this page and will lose any unsaved information.", //edit.php +"BACK_TO_WEBSITE" => "Back to Website", //index & resetpassword +"SUPPORT_FORUM" => "Support Forum", //support.php +"FILTER" => "Filter", //pages.php +"UPLOADIFY_BUTTON" => "Upload files and/or images...", //upload.php +"FILE_BROWSER" => "File Browser", //filebrowser.php +"SELECT_FILE" => "Select file", //filebrowser.php +"CREATE_FOLDER" => "Create Folder", //upload.php +"THUMBNAIL" => "Thumbnail", //filebrowser.php +"ERROR_FOLDER_EXISTS" => "The folder you are trying to create already exists", //upload.php +"FOLDER_CREATED" => "The new folder was successfully created: %s", //upload.php +"ERROR_CREATING_FOLDER" => "There was an error creating the new folder", //upload.php +"DELETE_FOLDER" => "Delete Folder", //upload.php +"FILE_NAME" => "File Name", //multiple tr header rows +"FILE_SIZE" => "Size", //multiple tr header rows +"ARCHIVE_DATE" => "Archive Date", //archive.php +"CKEDITOR_LANG" => "en", // edit.php ; set CKEditor language, don't forget to include CKEditor language file in translation zip + +# new to 3.1 +"XML_INVALID" => "XML Invalid", //template-functions.php +"XML_VALID" => "XML Valid", +"UPDATE_AVAILABLE" => "Update to", //plugins.php +"STATUS" => "Status", //plugins.php +"CLONE" => "Clone", //edit.php +"CLONE_SUCCESS" => "Successfully created %s", //pages.php +"COPY" => "Copy", //pages.php +"CLONE_ERROR" => "There was a problem trying to clone %s", //pages.php +"AUTOSAVE_NOTIFY" => 'Page autosaved at', //edit.php +"MENU_MANAGER" => 'Menu Manager', //edit.php +"GET_PLUGINS_LINK" => 'Download More Plugins', +"SITEMAP_REFRESHED" => "Your sitemap has been refreshed", //edit.php +"LOG_FILE_EMPTY" => "This log file is empty", //log.php +"SHARE" => "Share", //footer.php +"NO_PARENT" => "No Parent", //edit.php +"REMAINING" => "characters remaining", //edit.php +"NORMAL" => "Normal", //edit.php +"ERR_CANNOT_DELETE" => "Cannot delete %s. Please do this manually.", //common.php +"ADDITIONAL_ACTIONS" => "Other Actions", //edit.php +"ITEMS" => "items", //upload.php +"SAVE_MENU_ORDER" => "Save Menu Order", //menu-manager.php +"MENU_MANAGER_DESC" => "Drag-and-drop the menu items around until you have the order you want, then click the 'Save Menu Order' button.", //menu-manager.php +"MENU_MANAGER_SUCCESS" => "The new menu order has been saved", //menu-manager.php + + +/* + * For: api related pages + */ +"API_ERR_MISSINGPARAM" => 'parameter data does not exist', +"API_ERR_BADMETHOD" => 'method %s does not exist', +"API_ERR_AUTHFAILED" => 'authentication failed', +"API_ERR_AUTHDISABLED" => 'authentication disabled', +"API_ERR_NOPAGE" => 'requested page %s does not exist', +"API_CONFIGURATION" => 'API Configuration', +"API_ENABLE" => 'Enable the API', +"API_REGENKEY" => 'Regenerate Key', +"API_DISCLAIMER" => "By enabling this API you are allowing any external application that has a copy of your key to have access to your website's data. Only share this key with applications you trust.", +"API_REGEN_DISCLAIMER" => "When you regenerate your API Key, you will need to enter the new key into any external application using this API to connect to your website.", +"API_CONFIRM" => "ARE YOU SURE?", + + +"X" => "not translated", + + +/* + * Additions for 3.1 + */ +"DEBUG_CONSOLE" => 'Debug Console' + +); + +?> diff --git a/admin/load-ajax.php b/admin/load-ajax.php new file mode 100644 index 0000000..c5e1289 --- /dev/null +++ b/admin/load-ajax.php @@ -0,0 +1,3 @@ + + + + +
    + +
    +
    + + + +
    +
    + + + +
    + \ No newline at end of file diff --git a/admin/loadtab.php b/admin/loadtab.php new file mode 100644 index 0000000..c5e1289 --- /dev/null +++ b/admin/loadtab.php @@ -0,0 +1,3 @@ +0) { + // check for csrf + if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { + $nonce = $_GET['nonce']; + if(!check_nonce($nonce, "delete")) { + die("CSRF detected!"); + } + } + unlink($log_file); + exec_action('logfile_delete'); + redirect('support.php?success='.urlencode('Log '.$log_name . i18n_r('MSG_HAS_BEEN_CLR'))); +} + +if (!isset($log_data)) $log_data = getXML($log_file); + +get_template('header', cl($SITENAME).' » '.i18n_r('SUPPORT').' » '.i18n_r('LOGS')); + +?> + + + +
    + +
    +
    +

    : ‘

    + + '.i18n_r('LOG_FILE_EMPTY').'

    '; ?> +
      +

      '.i18n_r('LOG_FILE_ENTRY').'
      '; + foreach($log->children() as $child) { + $name = $child->getName(); + echo ''. stripslashes(ucwords($name)) .': '; + + $d = $log->$name; + $n = lowercase($child->getName()); + $ip_regex = '/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/'; + $url_regex = @"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)"; + + + //check if its an url address + if (do_reg($d, $url_regex)) { + $d = ''.$d.''; + } + + //check if its an ip address + if (do_reg($d, $ip_regex)) { + if ($d == $_SERVER['REMOTE_ADDR']) { + $d = i18n_r('THIS_COMPUTER').' ('.$d.')'; + } else { + $d = ''.$d.''; + } + } + + //check if its an email address + if (check_email_address($d)) { + $d = ''.$d.''; + } + + //check if its a date + if ($n === 'date') { + $d = lngDate($d); + } + + echo stripslashes($d); + echo '
      '; + } + echo "

      "; + $count++; + } + } + + ?> +
    +
    + +
    + + + +
    + \ No newline at end of file diff --git a/admin/logout.php b/admin/logout.php new file mode 100644 index 0000000..2b9e69d --- /dev/null +++ b/admin/logout.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/admin/menu-manager.php b/admin/menu-manager.php new file mode 100644 index 0000000..5878e98 --- /dev/null +++ b/admin/menu-manager.php @@ -0,0 +1,104 @@ +menuOrder) { + unset($data->menuOrder); + $data->addChild('menuOrder')->addCData($priority); + XMLsave($data,$file); + } + } + $priority++; + } + create_pagesxml('true'); + $success = i18n_r('MENU_MANAGER_SUCCESS'); +} + +# get pages +getPagesXmlValues(); +$pagesSorted = subval_sort($pagesArray,'menuOrder'); + +get_template('header', cl($SITENAME).' » '.i18n_r('PAGE_MANAGEMENT').' » '.str_replace(array('',''), '', i18n_r('MENU_MANAGER'))); + +?> + + + +
    + +
    +
    +

    ',''), '', i18n_r('MENU_MANAGER')); ?>

    +

    + '; + echo ''; + echo ''; + echo ''; + } else { + echo '

    '.i18n_r('NO_MENU_PAGES').'.

    '; + } + ?> + + + +
    +
    + + + +
    + diff --git a/admin/navigation.php b/admin/navigation.php new file mode 100644 index 0000000..c1aa629 --- /dev/null +++ b/admin/navigation.php @@ -0,0 +1,74 @@ + + + + + Share GetSimple + + + + + + \ No newline at end of file diff --git a/admin/pages.php b/admin/pages.php new file mode 100644 index 0000000..5ce444d --- /dev/null +++ b/admin/pages.php @@ -0,0 +1,123 @@ +url = $newurl; + $newxml->title = $newxml->title.' ['.i18n_r('COPY').']'; + $newxml->pubDate = date('r'); + $status = XMLsave($newxml, $path.$newurl.'.xml'); + if ($status) { + create_pagesxml('true'); + header('Location: pages.php?upd=clone-success&id='.$newurl); + } else { + $error = sprintf(i18n_r('CLONE_ERROR'), $_GET['id']); + header('Location: pages.php?error='.$error); + } + } else { + $error = sprintf(i18n_r('CLONE_ERROR'), $_GET['id']); + header('Location: pages.php?error='.$error); + } +} + + +getPagesXmlValues(true); + +$count = 0; +foreach ($pagesArray as $page) { + if ($page['parent'] != '') { + $parentTitle = returnPageField($page['parent'], "title"); + $sort = $parentTitle .' '. $page['title']; + $sort = $parentTitle .' '. $page['title']; + } else { + $sort = $page['title']; + } + $page = array_merge($page, array('sort' => $sort)); + $pagesArray_tmp[$count] = $page; + $count++; +} +// $pagesArray = $pagesArray_tmp; +$pagesSorted = subval_sort($pagesArray_tmp,'sort'); +$table = get_pages_menu('','',0); + +get_template('header', cl($SITENAME).' » '.i18n_r('PAGE_MANAGEMENT')); + +?> + + + +
    + +
    + +
    +

    +
    + + +
    + + + + + +
    +

    + +
    +
    + + + + +
    + diff --git a/admin/plugins.php b/admin/plugins.php new file mode 100644 index 0000000..9521bc5 --- /dev/null +++ b/admin/plugins.php @@ -0,0 +1,124 @@ +status == 'successful') { + if ($api_data->version > $plugin_info[$pathName]['version']) { + $updatelink = '
    '.i18n_r('UPDATE_AVAILABLE').' '.$api_data->version.''; + $needsupdate = true; + } + $plugin_title = ''.$api_data->name.''; + } else { + $plugin_title = $plugin_info[$pathName]['name']; + } + $table .= ''; + $table .= ''.$plugin_title.''; + $table .= ''.$plugin_info[$pathName]['description']; + if ($plugin_info[$pathName]['version']!='disabled'){ + $table .= '
    '.i18n_r('PLUGIN_VER') .' '. $plugin_info[$pathName]['version'].' — '.i18n_r('AUTHOR').': '.$plugin_info[$pathName]['author'].'
    '; + } + $table.= $updatelink.' + '.i18n_r('ENABLE').' + '.i18n_r('DISABLE').' + '; + $table .= "\n"; + $counter++; + } +} + +# set trigger for plugin update notification +if ($needsupdate) { + touch(GSCACHEPATH.'plugin-update.trigger'); +} else { + if (file_exists(GSCACHEPATH.'plugin-update.trigger')) { + unlink(GSCACHEPATH.'plugin-update.trigger'); + } +} + +exec_action('plugin-hook'); +get_template('header', cl($SITENAME).' » '.i18n_r('PLUGINS_MANAGEMENT')); + +?> + + + +
    + +
    +
    +

    + + 0) { ?> + + + +
    + + + +

    + '. str_replace(array('',''), '', i18n_r('GET_PLUGINS_LINK')) .''; + } + ?> +

    + +
    +
    + + + +
    + + diff --git a/admin/resetpassword.php b/admin/resetpassword.php new file mode 100644 index 0000000..fc02df4 --- /dev/null +++ b/admin/resetpassword.php @@ -0,0 +1,110 @@ +USR); + $EMAIL = $data->EMAIL; + + if(strtolower($_POST['username']) == $USR) { + # create new random password + $random = createRandomPassword(); + // $random = '1234'; + + # create backup + createBak($file, GSUSERSPATH, GSBACKUSERSPATH); + + # create password change trigger file + $flagfile = GSUSERSPATH . _id($USR).".xml.reset"; + copy(GSUSERSPATH . $file, $flagfile); + + # change password and resave xml file + $data->PWD = passhash($random); + $status = XMLsave($data, GSUSERSPATH . $file); + + # send the email with the new password + $subject = $site_full_name .' '. i18n_r('RESET_PASSWORD') .' '. i18n_r('ATTEMPT'); + $message = "

    ". cl($SITENAME) ." ". i18n_r('RESET_PASSWORD') ." ". i18n_r('ATTEMPT').'

    '; + $message .= "

    ". i18n_r('LABEL_USERNAME').": ". $USR.""; + $message .= "
    ". i18n_r('NEW_PASSWORD').": ". $random.""; + $message .= '
    '. i18n_r('EMAIL_LOGIN') .': '.$SITEURL . $GSADMIN.'/

    '; + exec_action('resetpw-success'); + $status = sendmail($EMAIL,$subject,$message); + # show the result of the reset attempt + usleep($randSleep); + $status = 'success'; + redirect("resetpassword.php?upd=pwd-".$status); + } else{ + # username doesnt match listed xml username + exec_action('resetpw-error'); + usleep($randSleep); + redirect("resetpassword.php?upd=pwd-success"); + } + } else { + # no user exists for this username, but do not show this to the submitter + usleep($randSleep); + redirect("resetpassword.php?upd=pwd-success"); + } + } else { + + # no username was submitted + redirect("resetpassword.php?upd=pwd-error"); + } +} + +get_template('header', cl($SITENAME).' » '.i18n_r('RESET_PASSWORD')); + +?> +
    + +
    + + + +
    +
    + +

    +

    + + +

    «   |   »

    +
    + +
    + + \ No newline at end of file diff --git a/admin/settings.php b/admin/settings.php new file mode 100644 index 0000000..923170e --- /dev/null +++ b/admin/settings.php @@ -0,0 +1,297 @@ +USR); +$PASSWD = $data->PWD; +$EMAIL = $data->EMAIL; +$NAME = $data->NAME; + +$lang_array = getFiles(GSLANGPATH); + +# initialize these all as null +$pwd1 = $error = $success = $pwd2 = $editorchck = $prettychck = null; + +# if the flush cache command was invoked +if (isset($_GET['flushcache'])) { + delete_cache(); + $update = 'flushcache-success'; +} + +# if the undo command was invoked +if (isset($_GET['undo'])) { + + # first check for csrf + if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { + $nonce = $_GET['nonce']; + if(!check_nonce($nonce, "undo")) { + die("CSRF detected!"); + } + } + # perform undo + undo($file, GSUSERSPATH, GSBACKUSERSPATH); + undo($wfile, GSDATAOTHERPATH, GSBACKUPSPATH.'other/'); + generate_sitemap(); + + # redirect back to yourself to show the new restored data + redirect('settings.php?restored=true'); +} + +# was this page restored? +if (isset($_GET['restored'])) { + $restored = 'true'; +} else { + $restored = 'false'; +} + +# was the form submitted? +if(isset($_POST['submitted'])) { + + # first check for csrf + if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { + $nonce = $_POST['nonce']; + if(!check_nonce($nonce, "save_settings")) { + die("CSRF detected!"); + } + } + + # website-specific fields + if(isset($_POST['sitename'])) { + $SITENAME = htmlentities($_POST['sitename'], ENT_QUOTES, 'UTF-8'); + } + if(isset($_POST['siteurl'])) { + $SITEURL = tsl($_POST['siteurl']); + } + if(isset($_POST['permalink'])) { + $PERMALINK = var_out(trim($_POST['permalink'])); + } + if(isset($_POST['template'])) { + $TEMPLATE = $_POST['template']; + } + if(isset($_POST['prettyurls'])) { + $PRETTYURLS = $_POST['prettyurls']; + } else { + $PRETTYURLS = ''; + } + + # user-specific fields + if(isset($_POST['user'])) { + $USR = strtolower($_POST['user']); + } + if(isset($_POST['name'])) { + $NAME = var_out($_POST['name']); + } + if(isset($_POST['email'])) { + $EMAIL = var_out($_POST['email'],'email'); + } + if(isset($_POST['timezone'])) { + $TIMEZONE = var_out($_POST['timezone']); + } + if(isset($_POST['lang'])) { + $LANG = var_out($_POST['lang']); + } + if(isset($_POST['show_htmleditor'])) { + $HTMLEDITOR = var_out($_POST['show_htmleditor']); + } else { + $HTMLEDITOR = ''; + } + + + # check to see if passwords are changing + if(isset($_POST['sitepwd'])) { $pwd1 = $_POST['sitepwd']; } + if(isset($_POST['sitepwd_confirm'])) { $pwd2 = $_POST['sitepwd_confirm']; } + if ($pwd1 != $pwd2) { + #passwords do not match + $error = i18n_r('PASSWORD_NO_MATCH'); + } else { + # password cannot be null + if ( $pwd1 != '' ) { + $PASSWD = passhash($pwd1); + } + + // check valid lang files + if(!in_array($LANG.'.php', $lang_array) and !in_array($LANG.'.PHP', $lang_array)) die(); + + # create user xml file + createBak($file, GSUSERSPATH, GSBACKUSERSPATH); + if (file_exists(GSUSERSPATH . _id($USR).'.xml.reset')) { unlink(GSUSERSPATH . _id($USR).'.xml.reset'); } + $xml = new SimpleXMLElement(''); + $xml->addChild('USR', $USR); + $xml->addChild('NAME', $NAME); + $xml->addChild('PWD', $PASSWD); + $xml->addChild('EMAIL', $EMAIL); + $xml->addChild('HTMLEDITOR', $HTMLEDITOR); + $xml->addChild('TIMEZONE', $TIMEZONE); + $xml->addChild('LANG', $LANG); + + exec_action('settings-user'); + + if (! XMLsave($xml, GSUSERSPATH . $file) ) { + $error = i18n_r('CHMOD_ERROR'); + } + + # create website xml file + createBak($wfile, GSDATAOTHERPATH, GSBACKUPSPATH.'other/'); + $xmls = new SimpleXMLExtended(''); + $note = $xmls->addChild('SITENAME'); + $note->addCData($SITENAME); + $note = $xmls->addChild('SITEURL'); + $note->addCData($SITEURL); + $note = $xmls->addChild('TEMPLATE'); + $note->addCData($TEMPLATE); + $xmls->addChild('PRETTYURLS', $PRETTYURLS); + $xmls->addChild('PERMALINK', $PERMALINK); + + exec_action('settings-website'); + + if (! XMLsave($xmls, GSDATAOTHERPATH . $wfile) ) { + $error = i18n_r('CHMOD_ERROR'); + } + + # see new language file immediately + include(GSLANGPATH.$LANG.'.php'); + + if (!$error) { + $success = i18n_r('ER_SETTINGS_UPD').'. '.i18n_r('UNDO').''; + generate_sitemap(); + } + + } +} + +# are any of the control panel checkboxes checked? +if ($HTMLEDITOR != '' ) { $editorchck = 'checked'; } +if ($PRETTYURLS != '' ) { $prettychck = 'checked'; } + +# get all available language files +if ($LANG == ''){ $LANG = 'en_US'; } + +if (count($lang_array) != 0) { + sort($lang_array); + $sel = ''; $langs = ''; + foreach ($lang_array as $lfile){ + $lfile = basename($lfile,".php"); + if ($LANG == $lfile) { $sel="selected"; } + $langs .= ''; + $sel = ''; + } +} else { + $langs = ''; +} + +get_template('header', cl($SITENAME).' » '.i18n_r('GENERAL_SETTINGS')); + +?> + + + +
    + +
    +
    + " /> + +
    +

    + +
    +

    +
    +
    +

    + '.i18n_r('LABEL_SUGGESTION').':   '.$fullpath.'

    '; } ?> +
    +
    + +

    />  

    + +
    +

    + +
    +
    + + + + + +
    +

    +
    +

    +
    +
    +

    + '.i18n_r('WARN_EMAILINVALID').'

    '; + }?> +
    +
    +
    +

    + +

    +
    +
    +
    +

    + + +

    +
    +
    +

    + +

    +
    +
    +

    />  

    + + + +

    :

    +
    +

    +
    +
    +

    +
    +
    + +

    +      +

    + +
    +
    +
    + +
    + + + +
    + \ No newline at end of file diff --git a/admin/share.php b/admin/share.php new file mode 100644 index 0000000..ad62a3d --- /dev/null +++ b/admin/share.php @@ -0,0 +1,53 @@ + + + + + Share GetSimple + + + + + + \ No newline at end of file diff --git a/admin/sitemap.php b/admin/sitemap.php new file mode 100644 index 0000000..d81db62 --- /dev/null +++ b/admin/sitemap.php @@ -0,0 +1,54 @@ + + + + +
    +
    +
    +

    +
    + + +
    + +
    + +
    +
    + + + +
    + diff --git a/admin/support.php b/admin/support.php new file mode 100644 index 0000000..c0ae330 --- /dev/null +++ b/admin/support.php @@ -0,0 +1,61 @@ + + + + +
    + +
    +
    + +

    + + + +

    + +
      +
    • +
    • +
    • +
    • +
    • + + +
    + +

    +
      +
    • + +
    + +
    +
    + + + +
    + diff --git a/admin/template/css-wide.php b/admin/template/css-wide.php new file mode 100644 index 0000000..3208b1f --- /dev/null +++ b/admin/template/css-wide.php @@ -0,0 +1,43 @@ +/** CSS **/ + +/* + * CSS wide + * + */ + + +.wrapper{ + /* main wrapper */ + width:99%; +} + +.wrapper .nav{ + /* top header nav wrapper */ + width:99%; +} + +.wrapper .nav li:first-child { + /* breathing space for tabs */ + margin-left: 35px; +} + +.wrapper table { + /* tables in wrapper, eg page management lists */ + width:99%; +} + +#maincontent{ + /* wrapper for admin inputs */ + width:80%; +} + +textarea, form input.title{ + /* resize backend textareas */ + /* outline backend administrative input fields for emphasis */ + width:99% ; +} + +form.manyinputs textarea{ + /* resize backend textareas for components */ + width:100% ; +} diff --git a/admin/template/css.php b/admin/template/css.php new file mode 100644 index 0000000..bd575b2 --- /dev/null +++ b/admin/template/css.php @@ -0,0 +1,2091 @@ +/** CSS **/ + +/* + * CSS php dynamic + * DO NOT TIDY! + * @uses color variables $primary0 - $primary6, $secondary_0-$secondary_1 + * + */ + +/** GLOBAL RESETS **/ +:link,:visited { + text-decoration: none} + +h1,h2,h3,h4,h5,h6,pre,code { + font-size: 1em; + font-weight: 400; + word-wrap: break-word; +} + +ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input { + margin: 0; + padding: 0; +} + +body { + height: 100%; + font-family: Arial, Helvetica Neue, Helvetica, sans-serif; + font-size: 12px; + background: #f6f6f6; +} + +a img, +:link img, +:visited img { + border: none; +} + +.clear { + clear: both; +} + +.unformatted { + white-space: pre; + font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; + line-height: 15px; + font-size: 11px; + display: block; + padding-bottom: 15px; + color: #555; + overflow: auto; +} + +#help { + display: none; +} + +.imgthumb { + display: none; + width: 70px; +} + +.imgthumb img { + border: 1px solid #555; +} + +.hidden { + display: none; +} + +html { + overflow-y: scroll; +} + +.clearfix:before, .clearfix:after { + content: "\0020"; + display: block; + height: 0; + visibility: hidden; +} + +.clearfix:after { + clear: both; +} + +.clearfix { + zoom: 1; +} + +:: selection { + text-shadow: none !important; + background: #a8d1ff; + color: #111; +} + +:: -moz-selection { + text-shadow: none !important; + background: #a8d1ff; + color: #111; +} + +:: -webkit-input-placeholder { + color: #c3c3c3; +} + +: -moz-placeholder { + color: #c3c3c3; +} + +/** HEADER / NAVIGATION **/ +.header { + color: #FFF; + border-top: 1px solid ; + background: ; /* old browsers */ + background: -moz-linear-gradient(top, 0%, 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,), color-stop(100%,)); /* webkit */ + filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='', endColorstr='',GradientType=0 ); /* ie */ + margin: 0 0 25px 0; +} + +.header .wrapper { + height: 95px; + position: relative; + border: none; +} + +.wrapper .nav { + list-style: none; + font-size: 13px; + position: absolute; + bottom: 0px; + left: 0; + width: 960px; +} + +.wrapper .nav li a { + padding: 7px 13px; + font-weight: 100 !important; + text-decoration: none !important; + display: block; + border-radius: 5px 5px 0 0; +} + +.wrapper .nav li a:link, +.wrapper .nav li a:visited, +.wrapper #pill li a:link, +.wrapper #pill li a:visited { + color: ; + background: ; + text-shadow: 1px 1px 0px rgba(0,0,0,.3); +} + +.wrapper #pill li.debug a:link, +.wrapper #pill li.debug a:visited, +.wrapper #pill li.debug a:hover { + color: #fff; + background: #cc0000; + padding: 4px 10px; + font-weight: 700 !important; + text-decoration: none !important; + display: block; + border-left: 1px solid ; +} + +#edit .wrapper .nav li a.pages, +#pages .wrapper .nav li a.pages, +#menu-manager .wrapper .nav li a.pages, +#plugins .wrapper .nav li a.plugins, +#settings .wrapper .nav li a.settings, +#components .wrapper .nav li a.theme, +#theme .wrapper .nav li a.theme, +#sitemap .wrapper .nav li a.theme, +#theme-edit .wrapper .nav li a.theme, +#navigation .wrapper .nav li a.theme, +#upload .wrapper .nav li a.files, +#image .wrapper .nav li a.files, +#backups .wrapper .nav li a.backups, +#support .wrapper .nav li a.support, +#log .wrapper .nav li a.support, +#health-check .wrapper .nav li a.support, +#backup-edit .wrapper .nav li a.backups, +#archive .wrapper .nav li a.backups, +#load .wrapper .pages li a.pages, +#load .wrapper .plugins li a.plugins, +#load .wrapper .settings li a.settings, +#load .wrapper .theme li a.theme, +#load .wrapper .files li a.files, +#load .wrapper .backups li a.backups, +#load .wrapper .support li a.support, +#load .wrapper .nav li a.current, +#loadtab .wrapper .nav li a.current { + color: ; + background: #f6f6f6; + background: -moz-linear-gradient(top, #FFF 3%, #F6F6F6 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#FFF), color-stop(100%,#F6F6F6)); /* webkit */ + font-weight: bold !important; + text-shadow: 1px 1px 0px rgba(255,244,255,.2); + box-shadow: rgba(0,0,0, 0.10) 2px -2px 2px; + -moz-box-shadow: rgba(0,0,0, 0.10) 2px -2px 2px; + -webkit-box-shadow: rgba(0,0,0, 0.10) 2px -2px 2px; +} + +.wrapper .nav li a:active, +.wrapper .nav li a:focus, +.wrapper .nav li a:hover, +.wrapper #pill li a:hover, +.wrapper #pill li a:focus { + color: #FFF; + background: ; + text-shadow: 1px 1px 0px rgba(0,0,0,.4); +} + +.wrapper .nav li { + float: left; + margin: 0 8px 0 0; + position: relative; +} + +.wrapper .nav li.rightnav { + float: right; + margin: 0 0 0 0; + font-size: 11px; + } + +.wrapper .nav li.rightnav a.first { + padding: 4px 10px; + font-weight: 100 !important; + text-decoration: none !important; + display: block; + border-radius: 0 3px 3px 0; + border-left: 1px solid ; +} + +.wrapper .nav li.rightnav a.last { + padding: 4px 10px; + font-weight: 100; + text-decoration: none !important; + display: block; + border-radius: 3px 0 0 3px; +} + +/* warning alert on tab */ +.nav li.rightnav .warning, .nav li.rightnav .info { + position: absolute; + top: -5px; + left: -5px; +} + +.nav li .warning, .nav li .info { + position: absolute; + top: -5px; + right: -5px; + font-size: 10px; + color: #000; + text-shadow: 1px 1px 0px rgba(255,255,255,.5); + font-weight: bold; + text-align: center; + border-radius: 2px; + display: block; + width: 11px; + border: 1px solid #FFCC33; + background: #FFFF66; + background: -moz-linear-gradient(top, #FFFF66 0%, #FFCC33 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFF66), color-stop(100%,#FFCC33)); +} + +.nav li .info { + font-family: serif; + border: 1px solid #2DB1FF; + background: #6FCCFF; + background: -moz-linear-gradient(top, #BDF2FF 0%, #6FCCFF 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#BDF2FF), color-stop(100%,#6FCCFF)); +} + +.wrapper .nav li a em, .wrapper #pill li a em { + font-style: normal; +} + +.wrapper .nav li a:hover em, .wrapper .nav li a:focus em { + border-bottom: 1px dotted #666; +} + +.wrapper #pill { + list-style: none; + position: absolute; + top: 0px; + right: 0; + font-size: 11px; +} + +.wrapper #pill li { + float: right; +} + +.wrapper #pill li.leftnav a { + padding: 4px 10px; + font-weight: 100 !important; + text-decoration: none !important; + display: block; + border-radius: 0 0 3px 0; + border-left: 1px solid ; +} + +.wrapper #pill li.rightnav a { + padding: 4px 10px; + font-weight: 100 !important; + text-decoration: none !important; + display: block; + border-radius: 0 0 0 3px; +} + +.wrapper { + margin-left: auto; + margin-right: auto; + width: 960px; + text-align: left; + padding-top: 1px; +} + +.wrapper p { + line-height: 18px; + margin: 0 0 20px 0; +} + +.wrapper #maincontent ul, +.wrapper #maincontent ol { + line-height: 18px; + margin: 0 0 20px 30px; +} + +.wrapper a:link, +.wrapper a:visited { + color: ; + text-decoration: underline; + font-weight: bold; +} + +.wrapper a:hover { + color: #333; + text-decoration: underline; + font-weight: bold; +} + +.inner { + padding: 20px; +} + +.header h1 { + font-size: 25px; + font-family: Georgia, Times, Times New Roman, serif; + position: absolute; + text-shadow: 1px 1px 0px ; + top: 17px; + left: 0; +} + +.header h1 a:link, +.header h1 a:visited, +.header h1 a:hover { + font-weight: normal; + color: ; + text-decoration: none; +} + +.header h1 a:hover { + color: #FFF; +} + +.wrapper h2 { + font-size: 18px; + font-family: Georgia, Times, Times New Roman, serif; + color: #777; + margin: 0 0 20px 0; +} + +.wrapper h2 span { + color: #bbb; + font-style: italic; +} + +h3 { + font-size: 19px; + font-family: Georgia, Times, Times New Roman, serif; + font-weight: normal; + font-style: italic; + color: ; + margin: 0 0 20px 0; + text-shadow: 1px 1px 0 #fff; +} + +h3.floated { + font-size: 18px; + font-weight: normal; + font-family: Georgia, Times, Times New Roman, serif ; + padding: 2px 0 0 0; + color: ; + float: left; + display: block; + margin: 0 0 5px 0; +} + +h5, +div.h5 { + margin: 10px 0 10px 0; + font-size: 14px; + line-height: 28px; + display: block; + padding: 3px 10px; + background: #EEEEEE; + background: -moz-linear-gradient(top, #f6f6f6 3%, #EEEEEE 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#f6f6f6), color-stop(100%,#EEEEEE)); /* webkit */ + border: 1px solid #cccccc; + text-shadow: 1px 1px 0 rgba(255,255,255,0.5); + color: #999; +} + +h5 a { + text-decoration: none !important; +} + +h5 img, +tr.folder img { + vertical-align: middle; + margin: 0 5px 0 0; + opacity: .5; +} + +h5:hover img { + opacity: 1; +} + +.bodycontent ul, +.bodycontent ol { + margin: 0 0 20px 30px; +} + +.bodycontent ul p, +.bodycontent ol p { + margin: 0 0 10px 0; +} + +#maincontent { + width: 690px; + float: left; + text-align: left; +} + +#sidebar { + width: 225px; + float: right; +} + +#sidebar.fixed{ + -transition: top .02s ease-out; + -webkit-transition: all .2s ease-in-out; + -moz-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; +} + +#sidebar .section { + background: #fff; + border: 1px solid #ccc; + padding: 20px; + margin: 0 0 30px 0; + line-height: 18px; +} + +#sidebar .section p.small { + font-size: 11px; + margin: 15px 0 0 0; +} + +#sidebar .section input.text { + width: 175px; + font-size: 11px; + padding: 4px; + border: 1px solid #666; +} + +#sidebar .snav { + list-style: none; + margin: 0 0 30px 0; +} + +#sidebar .snav ul { + list-style: none; + margin: 0; +} + +#sidebar .snav li { + margin: 0 0 3px 0; +} + +#sidebar .snav li ul li { + margin: 0 0 3px 0; +} + +#submit_line { + margin: 15px 0 15px 0; +} + +#sidebar #js_submit_line { + margin: 0 0 0 12px; +} + +#sidebar .snav li a { + font-weight: bold; + display: block; + padding: 5px 15px 5px 15px; + text-decoration: none; + border-radius: 3px; +} + +#sidebar .snav li a:link, +#sidebar .snav li a:visited { + margin-left: 13px; + color: ; + background: ; + text-shadow: 1px 1px 0px ; + transition: all .2s ease-in-out; + -webkit-transition: all .2s ease-in-out; + -moz-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; +} + +#sidebar .snav li a.current { + margin-left: 0px; + cursor: default; + color: #FFF; + background: url('images/active.png') center left no-repeat !important; + text-shadow: 1px 1px 0px ; + padding-left: 28px; + border-radius: 0 3px 3px 0; +} + +#sidebar .snav li a.current:hover { + text-shadow: 1px 1px 0px ; + margin-left: 0px; + cursor: default; + color: #FFF; + background: url('images/active.png') center left no-repeat !important; + padding-left: 28px; +} + +#sidebar .snav li a:hover { + color: #FFF; + background: ; + margin-left: 13px; + text-shadow: 1px 1px 0px rgba(0,0,0,.25); +} + +#sidebar .snav li a em { + font-style: normal; +} + +#sidebar .snav li a:hover em, +#sidebar .snav li a:focus em { + border-bottom: 1px dotted #666; +} + +#sidebar .snav li a.current:hover em, +#sidebar .snav li a.current:focus em { + border-bottom: 1px dotted #fff; +} + +#sidebar .snav small { + color: #666; +} + +.edit-nav { + margin: 0 0 15px 0; +} + +.edit-nav a { + font-size: 10px; + text-transform: uppercase; + display: block; + padding: 3px 10px; + float: right; + margin: 0 0 0 5px; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + background-repeat: no-repeat; + background-position: 94% center; +} + +.edit-nav select { + margin-top: -3px; + float: right; + padding: 1px; + border: 1px solid #999; + font-size: 11px; + border-radius: 2px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; +} + +.edit-nav p { + float: right; + font-size: 11px; + margin: 0; +} + +.edit-nav label { + font-weight: 100; + display: inline; + font-size: 11px; + color: #666; + margin: 0; + padding: 0; +} + +.edit-nav a#metadata_toggle { + background-image: url('images/plus.png'); + padding-right: 20px; +} + +.edit-nav a#metadata_toggle.current { + background-image: url('images/minus.png'); + padding-right: 20px; +} + +.edit-nav { + height: 1%; +} + +.edit-nav a:link, +.edit-nav a:visited { + line-height: 14px !important; + background-color: ; + color: #ccc; + font-weight: bold; + text-decoration: none; + text-shadow: 1px 1px 0px rgba(0,0,0,.2); + transition: all .10s ease-in-out; + -webkit-transition: all .10s ease-in-out; + -moz-transition: all .10s ease-in-out; + -o-transition: all .10s ease-in-out; +} + +.edit-nav a:hover, +#sidebar .edit-nav a:hover, +.edit-nav a.current { + background-color: ; + color: #FFF; + font-weight: bold; + text-decoration: none; + line-height: 14px !important; + text-shadow: 1px 1px 0px rgba(0,0,0,.2); +} + +.edit-nav a:link em, +.edit-nav a:visited em { + font-style: normal; +} + +.edit-nav a.current em, +.edit-nav a:hover em, +.edit-nav a:focus em { + font-style: normal; + border-bottom: 1px dotted #FFF; +} + +/* basic default table style */ +.wrapper table { + border-collapse: collapse; + margin: 0 0 20px 0; + width: 645px; +} + +.wrapper table td { + vertical-align: top; + padding: 4px; + border-bottom: 1px solid #eee; + border-top: 1px solid #eee; + line-height: 20px !important; +} + +.wrapper table th { + background: #FFF !important; + padding: 2px 4px; + font-size: 11px; + border-top: 1px solid #FFF; + color: #222; + font-weight: bold; + text-transform: uppercase; + line-height: 20px !important; + text-align: left; +} + +.wrapper table tr.head { +} + +.wrapper table td span { + font-size: 12px; + color: #777; +} + +.wrapper table.highlight { + text-shadow: 1px 1px 0 #fff; +} + +.wrapper table.highlight tr:nth-child(odd) { + background: #f7f7f7; +} + +.wrapper table tr#tr-index a { + font-weight: bold !important; +} + +.wrapper table.highlight tr:hover { + background: #FFFFD5 !important; + text-shadow: none; +} + +.wrapper table tr.currentpage{ + background: #FFFFD1; +} + +.wrapper table tr { + border-bottom: 1px solid #eee; + border-top: 1px solid #eee; + transition: background-color .1s ease-in-out; + -webkit-transition: background-color .1s ease-in-out; + -moz-transition: background-color .1s ease-in-out; + -o-transition: background-color .1s ease-in-out; +} + +table td a { + font-weight: normal !important; +} + +.wrapper table.healthcheck tr td { + font-size: 12px; +} + +.popup table td { + padding: 4px; +} + +.popup table a:link, +.popup table a:visited { + color: ; + text-decoration: underline; +} + +.popup table a:hover { + color: #333; + text-decoration: underline; +} + +sup { + color: #666; + font-weight: 100 !important; + vertical-align: baseline; + font-size: 0.8em; + position: relative; + top: -0.4em; +} + + +/* default form css */ +#maincontent .main { + padding: 20px; + background: #fff; + border: 1px solid #c8c8c8; + margin: 0 0 30px 0; + box-shadow: rgba(0,0,0, 0.06) 0px 0px 4px; + -moz-box-shadow: rgba(0,0,0, 0.06) 0px 0px 4px; + -webkit-box-shadow: rgba(0,0,0, 0.06) 0px 0px 4px; +} + +#maincontent .main .section { + padding-top: 40px; +} + +#themecontent{ + /* replaces #maincontent on theme editor page, fix for the above style interferring with codemirror for now */ + padding: 20px; + background: white; + border: 1px solid #C8C8C8; + margin: 0 0 30px 0; + box-shadow: rgba(0,0,0, 0.06) 0px 0px 4px; + -moz-box-shadow: rgba(0,0,0, 0.06) 0px 0px 4px; + -webkit-box-shadow: rgba(0,0,0, 0.06) 0px 0px 4px; + border-image: initial; +} + +form p { + margin: 0 0 10px 0; +} + +form input.text, +form select.text { + color: #333; + border: 1px solid #aaa; + padding: 5px; + font-family: Arial, Helvetica Neue, Helvetica, sans-serif; + font-size: 12px; + width: 510px; + border-radius: 2px; +} + +form select.text { + width: 521px; + padding: 4px 5px; +} + +input.text:focus, +select.text:focus, +textarea.text:focus { + outline: none; + border: 1px solid #666 !important; + box-shadow: rgba(0,0,0, 0.10) 0px 0px 6px; + -moz-box-shadow: rgba(0,0,0, 0.10) 0px 0px 6px; + -webkit-box-shadow: rgba(0,0,0, 0.10) 0px 0px 6px; +} + +form textarea { + width: 635px; + height: 420px; + line-height: 18px; + text-align: left; + color: #333; + border: 1px solid #aaa; + padding: 5px; + font-family: Arial, Helvetica Neue, Helvetica, sans-serif; + font-size: 12px; + border-radius: 2px; + tab-size:4; + -moz-tab-size:4; + -o-tab-size:4; +} + +form input[readonly], form select[readonly], form textarea[readonly] { + background: #eeeeee; + border: 1px solid #999; + color: #666; + cursor: default; +} + +form input.capslock { + background-image: url('images/capslock.png'); + background-position: right center; + background-repeat: no-repeat; +} + +textarea#codetext { + height: 660px; + width: 99%; + font-family: Consolas, Monaco, "Courier New", Courier, monospace; + font-size: 12px; + line-height: 18px; + overflow: scroll; + overflow-y: scroll; + overflow-x: scroll; + +} + +#menu-items span { + text-transform: lowercase; +} + +label { + padding: 0; + margin: 0; + color: #222; + display: block; + font-size: 12px; + font-weight: bold; + font-family: arial, helvetica, sans-serif +} + +label span.right { + float: right; + color: #999; + display: inline-block; + margin-right: 15px; + font-weight: 100 !important; + font-size: 11px !important; +} + +label span.right a:link, +label span.right a:visited { + font-size: 11px; + color: #999; + text-decoration: none; + font-weight: 100 !important; +} + +label span.right a:focus, +label span.right a:hover { + font-size: 11px; + color: #333; + text-decoration: underline; + font-weight: 100 !important; +} + +.inline label { + display: inline-block; + padding-top: 3px; +} + +/* meta dropdown style */ +#metadata_window { + margin: 0 2px 20px 0; + background: #f9f9f9; + border: 1px solid #e8e8e8; + padding: 15px 10px 5px 10px; + border-radius: 2px; + text-shadow: 1px 1px 0 rgba(255,255,255,.3); +} + +#metadata_window .rightopt { + float: right; + width: 48%; +} + +#metadata_window .leftopt { + float: left; + width: 48%; +} + +#metadata_window .wideopt { + clear:both; + width: 100%; +} + +#metadata_window p { + margin: 0 0 15px 0; +} + +#metadata_window input, +#metadata_window select, +#metadata_window textarea { + width: 97%; + font-size: 11px; + padding: 3px; + margin: 0 !important; +} + +#metadata_window .wideopt input, +#metadata_window .wideopt select, +#metadata_window .wideopt textarea { + width: 99%; +} + +#metadata_window input#post-menu-enable { + width: 20px; + padding: 0; + margin: 0; +} + +#metadata_window textarea { + height: 62px; + margin-bottom: 0; + line-height: 15px; +} + +#metadata_window select { + width: 100%; +} + +#metadata_window select.text.autowidth { + width: 155px; + float: right; +} + +#metadata_window p.post-menu { + margin-bottom: 5px; +} + +#metadata_window a.viewlink img { + vertical-align: baseline; + margin-left: 15px; + opacity: .5; +} + +#metadata_window a.viewlink:hover img { + opacity: 1; +} + +#metadata_window #menu-items { + height: 50px; + background: #222; + padding: 5px 10px 0 10px; + position: relative; +} + +#metadata_window #menu-items #tick { + margin-top: -10px; + left: 5px; + position: absolute; +} + +#metadata_window #menu-items input, +#metadata_window #menu-items select { + border: 1px solid #000; + border-radius: 0; +} + +#metadata_window #menu-items span label { + text-shadow: none; + display: inline-block; + font-size: 11px; + line-height: 16px; + color: #e3e3e3; + font-weight: normal; + margin: 0; + padding: 0; +} + +#metadata_window #menu-items select { + padding: 2px 3px; +} + +#countdownwrap { + display: inline-block; + color: #999; + font-size: 11px; + font-weight: normal; + float: right; +} + +#countdownwrap strong { + color: #555; + font-weight: normal; +} + +form table.formtable select { + width: 275px; + padding: 3px 4px; +} + +table.cleantable { + border-collapse: collapse; + margin: 0 0 0 0; +} + +table.cleantable tr { + border: none; +} + +table.cleantable tr td { + border: none; +} + +#autosavenotify { + padding: 15px 0 0 13px; + color: #666; + text-shadow: 1px 1px 0 #fff; + font-size: 11px; +} + +#pagechangednotify { + margin: 0px; + padding: 15px 0 0 13px; + color: #CC0000; + text-shadow: 1px 1px 0 #fff; + font-size: 11px; +} + +p.backuplink { + text-shadow: 1px 1px 0 rgba(255,255,255,.3); + color: #888; + font-size: 11px; + margin: 20px -20px -20px -20px; + padding: 10px 8px 10px 40px; + background: #f9f9f9 url('images/clock.png') 20px center no-repeat; + border-top: 1px solid #eee; +} + +p.backuplink a { + font-weight: 100 !important; +} + +.editing { + font-size: 10px; + padding: 3px; + display: block; + margin-top: -13px; + margin-bottom: -10px; + color: #888; + font-style: italic; +} + +/* form submit button style */ +/* +input.submit { + padding: 5px 12px; + font-family: Arial, Helvetica Neue, Helvetica, sans-serif; + font-weight: bold; + cursor: pointer; +}*/ + +input.submit, .button { + font: bold 13px Helvetica, Arial, sans-serif; + text-decoration: none !important; + padding: 7px 15px; + text-shadow: 0 1px 0 rgba(255,255,255,.5); + transition: all .218s; + -webkit-transition: all .218s; + -moz-transition: all .218s; + -o-transition: all .218s; + color: #333333 !important; + background: #dddddd; + background: -webkit-gradient(linear,0% 40%,0% 70%,from(#eeeeee),to(#e1e1e1)); + background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(#eeeeee),to(#e1e1e1)); + border: solid 1px #acacac; + border-radius: 2px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + cursor: pointer; + box-shadow: rgba(0,0,0, 0.06) 0px 0px 3px; + -moz-box-shadow: rgba(0,0,0, 0.06) 0px 0px 3px; + -webkit-box-shadow: rgba(0,0,0, 0.06) 0px 0px 3px; +} + +input.submit:focus, input.submit:hover, .button:hover { + color: #111111; + background: #eeeeee; + background: -webkit-gradient(linear,0% 40%,0% 70%,from(#eeeeee),to(#dddddd)); + background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(#eeeeee),to(#dddddd)); + border: solid 1px #aaaaaa; + box-shadow: rgba(0,0,0, 0.15) 0px 0px 4px; + -moz-box-shadow: rgba(0,0,0, 0.15) 0px 0px 4px; + -webkit-box-shadow: rgba(0,0,0, 0.15) 0px 0px 4px; +} + +.button { + padding: 3px 7px; +} + +.leftsec { + float: left; + width: 50%; + padding-bottom: 5px; +} + +.rightsec { + float: left; + width: 50%; + padding-bottom: 5px; +} + +.widesec { + clear: both; + width: 100%; + padding-bottom: 5px; +} + +.widesec input.text, .rightsec input.text, .leftsec input.text { + width: 92%; +} + +.widesec input.text, .rightsec select.text, .leftsec select.text { + width: 96%; +} + +/* edit css */ +form input.title { + font-size: 19px; + border-color: #999; + width: 635px; + padding: 3px 4px; +} + +form input.secondary { + width: 280px; +} + +/* components css */ +form.manyinputs input.text { + width: 230px; +} + +form.manyinputs textarea { + width: 632px; + height: 200px; +} + +form.manyinputs p { + margin: 0 0 25px 0; +} + +.compdiv { + padding: 10px 0 35px 0; +} + +table.comptable { + margin: 0px !important; + width: 645px; + background: #fff; + border: none; + padding: 0; +} + +table.comptable tr td { + font-size: 12px; + border: none; + padding: 0; +} + +table.comptable tr td code { + font-size: 11px; + color: #666; + padding: 0 4px 0 0; + display: block; + font-family: Consolas, Monaco, "Courier New", Courier, monospace; +} + +table.comptable tr { + border: none; + border: none !important; +} + +table.comptable tr td input.newtitle { + margin-bottom: 2px !important; +} + +.wrapper a.component { + float: left; + font-weight: bold; + margin: 0 5px 5px 0; + padding: 3px 10px; + text-decoration: none; + border-radius: 3px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; +} + +.wrapper a.component:link, .wrapper a.component:visited { + color: #666; + background: #fff; + border: 1px solid #999; + text-decoration: none; +} + +.wrapper a.component:hover { + color: ; + background: ; + border: 1px solid ; + text-decoration: none; +} + +.compdivlist { + padding: 30px 0; + text-align: center; + margin: 0 0 0 15px; + overflow: auto; +} + +/* Notification styles + * + * alerts are now notifications + * use notify and notify_type + * .error and .upddated are still supported for legacy alerts + * + */ + +.updated, .error, .notify { + border: 1px solid #E6DB55; + border-radius: 2px; + background: #FFFBCC; + background: -moz-linear-gradient(top, #FFFBCC 0%, #FFFBC1 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFBCC), color-stop(100%,#FFFBC1)); /* webkit */ + line-height: 22px; + padding: 5px 10px; + margin-bottom: 20px; +} + +.updated p, .error p, .notify p { + margin: 0; + line-height: 22px; +} + +.error, .notify_error { + color: #990000; + border-color: #cc0000; + background: #F9DFDD; + background: -moz-linear-gradient(top, #FCF0EF 0%, #F9DFDD 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FCF0EF), color-stop(100%,#F9DFDD)); /* webkit */ +} + +.notify_ok { + border-color: #258815; + color: #258815; + background: #f0ffed; /* Old browsers */ + background: -moz-linear-gradient(top, #f0ffed 0%, #dfffd7 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0ffed), color-stop(100%,#dfffd7)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #f0ffed 0%,#dfffd7 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #f0ffed 0%,#dfffd7 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #f0ffed 0%,#dfffd7 100%); /* IE10+ */ + background: linear-gradient(to bottom, #f0ffed 0%,#dfffd7 100%); /* W3C */ + filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#f0ffed', endColorstr='#dfffd7',GradientType=0 ); /* IE6-9 */ +} + +.notify_info { + border-color: #2850C1; + color: #2850C1; + background: #edf4ff; /* Old browsers */ + background: -moz-linear-gradient(top, #edf4ff 0%, #d7e7ff 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#edf4ff), color-stop(100%,#d7e7ff)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #edf4ff 0%,#d7e7ff 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #edf4ff 0%,#d7e7ff 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #edf4ff 0%,#d7e7ff 100%); /* IE10+ */ + background: linear-gradient(to bottom, #edf4ff 0%,#d7e7ff 100%); /* W3C */ + filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#edf4ff', endColorstr='#d7e7ff',GradientType=0 ); /* IE6-9 */ +} + +.notify_warning { + border-color: #878314; + color: #878314; + background: #fffed5; /* Old browsers */ + background: -moz-linear-gradient(top, #fffed5 0%, #fffdbf 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fffed5), color-stop(100%,#fffdbf)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #fffed5 0%,#fffdbf 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #fffed5 0%,#fffdbf 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #fffed5 0%,#fffdbf 100%); /* IE10+ */ + background: linear-gradient(to bottom, #fffed5 0%,#fffdbf 100%); /* W3C */ + filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#fffed5', endColorstr='#fffdbf',GradientType=0 ); /* IE6-9 */ +} + +.deletedrow { + background-color: #FFB19B; +} + +.error code, +.notify code { + color: #990000; + font-size: 11px; + font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; + + line-height: 14px; + background: #fff; + opacity: .8; + padding: 1px; +} + +.updated, +#temp_good_flash { + color: #308000; +} + +.hint { + color: #777; + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; +} + +/* file listing table style */ +#filetypetoggle { + color: #999; + font-size: 12px; +} + +table td.delete { + width: 20px; + text-align: center; +} + +table td.delete a { + font-size: 18px !important; + line-height: 16px; +} + +.view { + width: 48px; + text-align: center; +} + +.editl { + width: 40px; + text-align: center; +} + +.editlw { + width: 220px; + text-align: left; +} + +.delete a:link, +.delete a:visited { + color: #999 !important; + text-decoration: none !important; + padding: 1px; + display: block; + line-height: 16px; + font-size: 12px; + font-weight: normal; + -webkit-transition: all .02s ease-in-out; + -moz-transition: all .02s ease-in-out; + -o-transition: all .02s ease-in-out; + transition: all .02s ease-in-out; + font-style:normal; +} + +.delete a:hover { + background: #D94136 !important; + color: #fff !important; + text-decoration: none !important; + padding: 1px; + line-height: 16px; + display: block; + font-size: 12px; + font-weight: normal; +} + +a.cancel:link, +a.cancel:visited { + font-weight: 100; + color: #D94136 !important; + text-decoration: underline; + padding: 1px 3px; + background: none !important; + line-height: 16px; + -webkit-transition: all .02s ease-in-out; + -moz-transition: all .02s ease-in-out; + -o-transition: all .02s ease-in-out; + transition: all .02s ease-in-out; +} + +a.cancel:hover { + font-weight: 100; + background: #D94136 !important; + color: #fff !important; + text-decoration: none !important; + padding: 1px 3px; + line-height: 16px; +} + +a.cancel em { + font-style: normal; +} + +.wrapper .secondarylink { + width: 20px; + text-align: center; + font-size: 12px; + line-height: 14px; +} + +.wrapper .secondarylink a:link, +.wrapper .secondarylink a:visited { + color: #aaa; + text-decoration: none; + font-weight: normal; + padding: 1px; + display: block; + line-height: 16px; + -webkit-transition: all .15s ease-in-out; + -moz-transition: all .15s ease-in-out; + -o-transition: all .15s ease-in-out; + transition: all .15s ease-in-out; +} + +.wrapper .secondarylink a:hover { + background: ; + color: #FFF; + text-decoration: none; + font-weight: normal; + padding: 1px; + display: block; + line-height: 16px; +} + +.delete a:link, .delete a:visited, .wrapper .secondarylink a:link, .wrapper .secondarylink a:visited, a.cancel:link, a.updatelink:link{ + border-radius:3px; +} + +/* backup info display */ +table.simple td { + border: 1px solid #eee; + border-collapse: collapse; + color: #555; + font-size: 12px; + padding: 4px 10px 4px 4px; +} + +table.simple { + width: 100%; + border: 1px solid #aaa; +} + +table.simple td.title { + width: 125px; + color: #222; + font-weight: bold; +} + + +/* footer */ +#footer { + border-top: 1px solid #e3e3e3; + text-shadow: 1px 1px 0 rgba(255,255,255,.4); + margin: 40px 0 0 0; + padding: 10px 0; + font-size: 11px; + color: #888; +} + +#footer p { + margin: 0 0 8px 0; +} + +#footer a:link, +#footer a:visited { + font-weight: 100; + color: #888; +} + +#footer a:focus, +#footer a:hover { + font-weight: 100; + color: #333; +} +#footer .gslogo a { + float: right; + width: 60px; + text-align: right; + opacity: .10; +} + +#footer .footer-left { + float: left; + width: 85%; +} + +#footer .gslogo a:link, +#footer .gslogo a:visited { + transition: opacity .2s ease-in-out; + -webkit-transition: opacity .2s ease-in-out; + -moz-transition: opacity .2s ease-in-out; + -o-transition: opacity .2s ease-in-out; +} + +#footer .gslogo a:hover { + opacity: 1; +} + +.toggle { + display: none; +} + +.editable { + padding: 3px 1px; + cursor: pointer; + transition: background-color .3s ease-in-out; + -webkit-transition: background-color .3s ease-in-out; + -moz-transition: background-color .3s ease-in-out; + -o-transition: background-color .3s ease-in-out; +} + +.editable:hover { + background: #FCFBB8; +} + +.wrapper table td span.ERRmsg { + color: #D94136; + font-color: 12px; +} + +.wrapper table td span.OKmsg { + color: #308000; + font-color: 12px; +} + +.wrapper table td span.WARNmsg { + color: #FFA500; + font-color: 12px; +} + +.wrapper table td span.INFOmsg { + color: #2B5CB3; + font-color: 12px; +} + +.wrapper table.highlight tr.img-highlight { + background: #FFFFD1 !important; +} + +.wrapper table.highlight tr.img-highlight td a.primarylink { + font-weight: bold !important; +} + + +#sidebar .uploadform { + padding: 5px 15px; +} + + +/* JQuery Uploadify Styles */ +.uploadifyQueueItem { + font-size: 10px; + padding: 8px 15px; + width: 190px; +} + +.uploadifyError { + color: #D94136 !important; +} + +.uploadifyError .uploadifyProgressBar { + background-color: #D94136 !important; +} + +#sidebar .snav li .cancel { + float: right; +} + +#sidebar .snav li .cancel a:link, +#sidebar .snav li .cancel a:visited, +#sidebar .snav li .cancel a:hover { + padding: 0 !important; + margin: 0 4px 0 0 !important; + width: 11px !important; + opacity: .8; + background: transaparent !important; +} + +.uploadifyProgress { + background-color: #FFF; + margin-top: 5px; + width: 97%; +} + +.uploadifyProgressBar { + background-color: ; + width: 1px; + height: 4px; +} + +#sidebar .snav li.upload { + display: block; + border-radius: 4px; + -moz-border-radius: 4px; + -khtml-border-radius: 4px; + -webkit-border-radius: 4px; + margin-left: 13px; + color: #FFF; + background: ; + font-weight: 100; +} + +.uploadifyButton { + width: 100%; + border-radius: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + display: block; + font-weight: bold; + color: #AFC5CF; + background: #182227; + text-shadow: 1px 1px 0px #0E1316; + transition: all .3s ease-in-out; + -webkit-transition: all .3s ease-in-out; + -moz-transition: all .3s ease-in-out; + -o-transition: all .3s ease-in-out; +} + +.uploadify:hover .uploadifyButton { + background-color: #0e1316; + color: #ffffff; + text-shadow: 1px 1px 0px #000; +} + +.uploadifyButtonText{ + padding: 5px 15px 5px 15px; + display: block; +} + +#uploadify object { + position: absolute; + left: 0; + right: 0; + cursor: pointer; +} + + +/* Image Editor Styles */ +textarea.copykit { + font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; + font-size: 12px; + outline: none + color: #666; + border: 1px solid #aaa; + line-height: 17px; + padding: 4px; + border-radius: 2px; + -moz-border-radius: 2px; + -khtml-border-radius: 2px; + -webkit-border-radius: 2px; + width: 98%; + height: 70px; + margin-bottom: 10px; +} + +#handw { + z-index: 1; + padding: 8px; + background: #000; + opacity: .80; + color: #fff; + font-size: 11px; + width: 150px; + text-align: center; + margin: -50px 0 0 0; +} + +#handw span { + font-size: 15px; + font-weight: bold; +} + +#jcropform .submit { + margin: 20px 0 0 0; +} + +#jcrop_open { +} + +a.updatelink:link, +a.updatelink:visited { + color: #CF3805; + padding: 1px 3px; +} + +a.updatelink:hover, +a.updatelink:focus { + color: #FFF; + background-color: #2AA206; + padding: 1px 3px; +} + + +/* File Browser Styles */ +#filebrowser { + background: #fff; +} + + +/* plugin styles */ +table tr.enabled { + background: #fff; +} + +#maincontent table tr.enabled td span { + color: #333; +} + +table tr.disabled { + background: #f6f6f6; +} + +table tr.disabled td b { + color: #666; +} + + +/* Logged out specific styles */ +body#index { + background: #f9f9f9; +} + +#index .header, +#resetpassword .header, +#setup .header, +#install .header, +#setup .gslogo, +#install .gslogo, +#index .gslogo, +#resetpassword .gslogo { + display: none; +} + +#index #maincontent, +#resetpassword #maincontent, +#setup #maincontent, +#install #maincontent { + width: 100%; +} + +#index #maincontent .main, +#resetpassword #maincontent .main, +#setup #maincontent .main, +#install #maincontent .main { + margin: 50px auto 0 auto; + float: none; + text-align: left; + border-radius: 5px; + -moz-border-radius: 5px; + -khtml-border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: rgba(0,0,0, 0.05) 0px 0px 10px; + -moz-box-shadow: rgba(0,0,0, 0.05) 0px 0px 10px; + -webkit-box-shadow: rgba(0,0,0, 0.05) 0px 0px 10px; + background: #FFF; + width: 645px; +} + +#setup #maincontent .main { + width: 270px; +} + +#setup input.text { + width: 250px; +} + +#index #maincontent .main, +#resetpassword #maincontent .main { + width: 270px; + border-bottom: 1px solid #999; + border-right: 1px solid #999; + text-shadow: 1px 1px 0 #fff; + background: #FFF; + background: -moz-linear-gradient(top, #f9f9f9 5%, #eeeeee 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(5%,#f9f9f9), color-stop(100%,#eeeeee)); /* webkit */ +} + +#resetpassword form input.text, +#index form input.text { + width: 255px; + font-size: 18px; + padding: 5px; + margin-top: 2px; +} + +#index form input.submit { +} + +#index p.cta, +#resetpassword p.cta { + font-size: 11px; + margin: 0 0 0 0; + color: #999; + text-align: center; +} + +#index form p, +#resetpassword form p { + margin-bottom: 15px; +} + +#index p.cta a, +#resetpassword p.cta a { + font-weight: 100; +} + +#setup .error, +#setup .updated, +#install .error, +#install .updated, +#index .error, +#index .updated, +#resetpassword .error, +#resetpassword .updated { + margin: 25px auto -23px auto; + width: 290px; + line-height: 18px; + padding: 5px 10px; +} + +#setup #footer,#install #footer,#index #footer, #resetpassword #footer { + width: 270px; + border-top: none; + margin: 0 auto 20px auto; + text-align: center; +} + +#index .footer-left,#resetpassword .footer-left { + float: none; + width: 100%; +} + +.desc { + font-size: 12px; + line-height: 17px; + border-bottom: 1px dotted #ccc; + padding: 0 0 15px 0; + margin: 0 0 5px 0; +} + +#filter-search { + margin: 0 0 10px 0; + display: none; +} + +#filter-search input.text { + width: 250px; + font-size: 11px; + padding: 3px; +} + +#createfolder { + font-weight: 100; + font-size: 11px; + text-decoration: underline !important; +} + +h5 .crumbs, div.h5 .crumbs { + float: left; +} + +#new-folder { + float: left; + padding-left: 5px; +} + +#new-folder form { + display: none; +} + +#new-folder .cancel { + font-size: 11px; + text-shadow: none !important; +} + +#new-folder input.submit { + font-size: 11px; + padding: 3px; +} + +#new-folder input.text { + width: 120px; + font-size: 11px; + padding: 3px; +} + +#edit #dropdown { + display: inline-block; + padding: 3px 15px; + position: relative; +} + +#edit #dropdown h6 { + font-weight: bold; + font-size: 11px; + color: #777; + margin-bottom: 5px; + font-weight: 100; + padding-right: 15px; + display: inline-block; + background: transparent url('images/utick.png') right center no-repeat; +} + +#edit #dropdown:hover h6 { + visibility: hidden; +} + +#edit #dropdown ul { + display: none; + text-shadow: 1px 1px 0 #fff; + list-style: none; + margin: 0; + font-size: 11px; + opacity: 0; + background: #f6f6f6; + border: 1px solid #ccc; + position: absolute; + top: -5px; + left: 5px; + min-width: 100px; + border-radius: 2px; + -moz-border-radius: 2px; + -khtml-border-radius: 2px; + -webkit-border-radius: 2px; + transition: opacity .3s ease-in-out; + -webkit-transition: opacity .3s ease-in-out; + -moz-transition: opacity .3s ease-in-out; + -o-transition: opacity .3s ease-in-out; + box-shadow: rgba(0,0,0, 0.2) 1px 1px 3px 0; + -moz-box-shadow: rgba(0,0,0, 0.2) 1px 1px 3px 0; + -webkit-box-shadow: rgba(0,0,0, 0.2) 1px 1px 3px 0; + overflow: hidden; +} + +#edit #dropdown li { + line-height: 22px; + border-bottom: #eee 1px solid; + padding: 0 8px; +} + +#edit #dropdown li:last-child { + border: none; +} + +#edit #dropdown li a:link, +#edit #dropdown li a:visited, +#edit #dropdown li a:hover { + font-weight: 100; + color: #666; + text-decoration: none; + display: block; +} + +#edit #dropdown li:hover { + background: #fff; +} + +#edit #dropdown li:hover a { + color: #cc0000; +} + +#edit #dropdown li.alertme:hover { + background: #cc0000; +} + +#edit #dropdown li.alertme:hover a { + color: #FFF; + text-shadow: none; +} + +#edit #dropdown:hover ul { + display: block; + opacity: 1; +} + +.wrapper #maincontent ul#menu-order { + list-style: none; + margin: 0 0 25px 0; +} + +#menu-order li { + text-shadow: 1px 1px solid rgba(255,255,255,.3); + cursor: move; + display: block; + margin: 2px 0; + border: 1px solid #eee; + background: #fbfbfb; + padding: 5px 10px; +} + +#menu-order li:hover { + border: 1px solid #ccc; + background: #f6f6f6; +} + +#menu-order li em { + float: right; + color: #666; +} + +#menu-order li.placeholder-menu { + height: 18px; + background: #FFB164; + border: 1px solid #FF9933; +} + +#theme-edit #maincontent { + width: 100%; +} + +#theme-edit #sidebar { + display: none; +} + +#gsdebug{ + border: 1px solid #FF9933; + padding: 5px; + background: white; + height: 500px; + overflow: scroll; + margin-bottom: 20px; +} + +.ajaxwait { + background-image: url('images/ajax.gif'); + background-position: center; + background-repeat: no-repeat; +} + +.ajaxwait_dark { + background-image: url('images/ajax_dark.gif'); +} + +.ajaxwait_tint_dark { + background-color: #F6F6F6; +} + +a.disabled:link, +a.disabled:visited { + pointer-events: none; + cursor: default; + text-decoration: none !important; + color: #CCC !important; +} diff --git a/admin/template/error_checking.php b/admin/template/error_checking.php new file mode 100644 index 0000000..88e79ed --- /dev/null +++ b/admin/template/error_checking.php @@ -0,0 +1,100 @@ +

    '.i18n_r('ER_PWD_CHANGE').'

    '; + } + + if ((!defined('GSNOAPACHECHECK') || GSNOAPACHECHECK == false) and !server_is_apache()) { + echo ''; + } + + if(!isset($update)) $update = ''; + $err = ''; + $restored = ''; + if(isset($_GET['upd'])) $update = ( function_exists( "filter_var") ) ? filter_var ( $_GET['upd'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['upd']); + if(isset($_GET['success'])) $success = ( function_exists( "filter_var") ) ? filter_var ( $_GET['success'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['success']); + if(isset($_GET['error'])) $error = ( function_exists( "filter_var") ) ? filter_var ( $_GET['error'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['error']); + if(isset($_GET['err'])) $err = ( function_exists( "filter_var") ) ? filter_var ( $_GET['err'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['err']); + if(isset($_GET['id'])) $errid = ( function_exists( "filter_var") ) ? filter_var ( $_GET['id'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['id']); + if(isset($_GET['updated']) && $_GET['updated'] ==1) $success = i18n_r('SITE_UPDATED'); + + switch ( $update ) { + case 'bak-success': + echo '

    '. sprintf(i18n_r('ER_BAKUP_DELETED'), $errid) .'

    '; + break; + case 'bak-err': + echo '

    '.i18n_r('ERROR').': '.i18n_r('ER_REQ_PROC_FAIL').'

    '; + break; + case 'edit-success': + echo '

    '; + if ($ptype == 'edit') { + echo sprintf(i18n_r('ER_YOUR_CHANGES'), $id) .'. '.i18n_r('UNDO').''; + } elseif ($ptype == 'restore') { + echo sprintf(i18n_r('ER_HASBEEN_REST'), $id); + } elseif ($ptype == 'delete') { + echo sprintf(i18n_r('ER_HASBEEN_DEL'), $errid) .'. '.i18n_r('UNDO').''; + } + echo '

    '; + break; + case 'clone-success': + echo '

    '.sprintf(i18n_r('CLONE_SUCCESS'), ''.$errid.'').'.

    '; + break; + case 'edit-index': + echo '

    '.i18n_r('ERROR').': '.i18n_r('ER_CANNOT_INDEX').'.

    '; + break; + case 'edit-error': + echo '

    '.i18n_r('ERROR').': '. var_out($ptype) .'.

    '; + break; + case 'pwd-success': + echo '

    '.i18n_r('ER_NEW_PWD_SENT').'. '.i18n_r('LOGIN').'

    '; + break; + case 'pwd-error': + echo '

    '.i18n_r('ERROR').': '.i18n_r('ER_SENDMAIL_ERR').'.

    '; + break; + case 'del-success': + echo '

    '.i18n_r('ER_FILE_DEL_SUC').': '.$errid.'

    '; + break; + case 'flushcache-success': + echo '

    '.i18n_r('FLUSHCACHE-SUCCESS').'

    '; + break; + case 'del-error': + echo '

    '.i18n_r('ERROR').': '.i18n_r('ER_PROBLEM_DEL').'.

    '; + break; + case 'comp-success': + echo '

    '.i18n_r('ER_COMPONENT_SAVE').'. '.i18n_r('UNDO').'

    '; + break; + case 'comp-restored': + echo '

    '.i18n_r('ER_COMPONENT_REST').'. '.i18n_r('UNDO').'

    '; + break; + + /**/ + default: + if ( isset( $error ) ) echo '

    '.i18n_r('ERROR').': '. $error .'

    '; + else if ($restored == 'true') echo '

    '.i18n_r('ER_OLD_RESTORED').'. '.i18n_r('UNDO').'

    '; + else if ( isset($_GET['rest']) && $_GET['rest']=='true' ) + echo '

    '.i18n_r('ER_OLD_RESTORED').'. '.i18n_r('UNDO').'

    '; + elseif (isset($_GET['cancel'])) echo '

    '.i18n_r('ER_CANCELLED_FAIL').'

    '; + elseif (isset($error)) echo '

    '.$error.'

    '; + elseif (!empty($err)) echo '

    '.i18n_r('ERROR').': '.$err.'

    '; + elseif (isset($success)) echo '

    '.$success.'

    '; + elseif ( $restored == 'true') + echo '

    '.i18n_r('ER_OLD_RESTORED').'. '.i18n_r('UNDO').'

    '; + break; + /**/ + + } + ?> + \ No newline at end of file diff --git a/admin/template/footer.php b/admin/template/footer.php new file mode 100644 index 0000000..4a85d2a --- /dev/null +++ b/admin/template/footer.php @@ -0,0 +1,53 @@ + + + '.i18n_r('DEBUG_CONSOLE').'
    '; + echo '
    ';
    +				foreach ($GS_debug as $log){
    +					if(is_array($log)) print_r($log).'
    '; + else print($log.'
    '); + } + echo '
    '; + echo '
    '; + } + } + ?> + + + + + + \ No newline at end of file diff --git a/admin/template/header.php b/admin/template/header.php new file mode 100644 index 0000000..1fbc508 --- /dev/null +++ b/admin/template/header.php @@ -0,0 +1,92 @@ + + + + + + <?php echo $title ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + +
    + + diff --git a/admin/template/js/ckeditor/.htaccess b/admin/template/js/ckeditor/.htaccess new file mode 100644 index 0000000..1427d97 --- /dev/null +++ b/admin/template/js/ckeditor/.htaccess @@ -0,0 +1,24 @@ +# +# Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +# For licensing, see LICENSE.html or http://ckeditor.com/license +# + +# +# On some specific Linux installations you could face problems with Firefox. +# It could give you errors when loading the editor saying that some illegal +# characters were found (three strange chars in the beginning of the file). +# This could happen if you map the .js or .css files to PHP, for example. +# +# Those characters are the Byte Order Mask (BOM) of the Unicode encoded files. +# All FCKeditor files are Unicode encoded. +# + +AddType application/x-javascript .js +AddType text/css .css + +# +# If PHP is mapped to handle XML files, you could have some issues. The +# following will disable it. +# + +AddType text/xml .xml diff --git a/admin/template/js/ckeditor/ckeditor.js b/admin/template/js/ckeditor/ckeditor.js new file mode 100644 index 0000000..d923bbd --- /dev/null +++ b/admin/template/js/ckeditor/ckeditor.js @@ -0,0 +1,153 @@ +/* +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'D03G5XL',version:'3.6.6',revision:'7689',rnd:Math.floor(Math.random()*900)+100,_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f=0?'&':'?')+'t='+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b){var c=a.event.prototype;for(var d in c){if(b[d]==undefined)b[d]=c[d];}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={});},c=function(d){this.name=d;this.listeners=[];};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return;}}k.unshift(m);}},fire:(function(){var d=false,e=function(){d=true;},f=false,g=function(){f=true;};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o=0)f.listeners.splice(g,1);}},hasListeners:function(d){var e=b(this)[d];return e&&e.listeners.length>0;}};})();}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._init();};a.editor.replace=function(b,c){var d=b;if(typeof d!='object'){d=document.getElementById(b);if(d&&d.tagName.toLowerCase() in {style:1,script:1,base:1,link:1,meta:1,title:1})d=null;if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}}if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';}d.style.visibility='hidden';return new a.editor(c,d,1);};a.editor.appendTo=function(b,c,d){var e=b;if(typeof e!='object'){e=document.getElementById(b);if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';}return new a.editor(c,e,2,d);};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this);},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this);},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this);}};a.event.implementOn(a.editor.prototype,true);}if(!a.env)a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:/*@cc_on!@*/false,opera:!!c&&c.version,webkit:b.indexOf(' applewebkit/')>-1,air:b.indexOf(' adobeair/')>-1,mac:b.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',mobile:b.indexOf('mobile')>-1,iOS:/(ipad|iphone|ipod)/.test(b),isCustomDomain:function(){if(!this.ie)return false;var g=document.domain,h=window.location.hostname;return g!=h&&g!='['+h+']';},secure:location.protocol=='https:'};d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie9Compat=document.documentMode==9;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks;}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split('.');e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);}}if(d.opera)e=parseFloat(c.version());if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);d.version=e;d.isCompatible=d.iOS&&e>=534||!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.webkit?'webkit':'unknown'); +if(d.quirks)d.cssClass+=' cke_browser_quirks';if(d.ie){d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?document.documentMode:'7');if(d.quirks)d.cssClass+=' cke_browser_iequirks';if(document.documentMode&&document.documentMode>=9)d.cssClass+=' cke_browser_ie9plus';}if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18';if(d.air)d.cssClass+=' cke_browser_air';return d;})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=1;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=1;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f'+g+'');else h.push('');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='
    '?function(k){return g(k).replace(/
    /gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'>');}:h,j=g(' ')=='  '?function(k){return i(k).replace(/ /g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'"').replace(//g,'>');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),getNextId:function(){return 'cke_'+this.getNextNumber();},override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h
    ',a.document);a.document.getBody().append(f);}if(!/%$/.test(g)){f.setStyle('width',g);return f.$.clientWidth;}return g;};})(),repeat:function(f,g){return new Array(g+1).join(f);},tryThese:function(){var f;for(var g=0,h=arguments.length;g8))&&i)h=i+':'+h;return new d.nodeList(this.$.getElementsByTagName(h));},getHead:function(){var h=this.$.getElementsByTagName('head')[0];if(!h)h=this.getDocumentElement().append(new d.element('head'),true);else h=new d.element(h);return(this.getHead=function(){return h;})();},getBody:function(){var h=new d.element(this.$.body);return(this.getBody=function(){return h;})();},getDocumentElement:function(){var h=new d.element(this.$.documentElement);return(this.getDocumentElement=function(){return h;})();},getWindow:function(){var h=new d.window(this.$.parentWindow||this.$.defaultView);return(this.getWindow=function(){return h;})();},write:function(h){var i=this;i.$.open('text/html','replace');b.isCustomDomain()&&(i.$.domain=document.domain);i.$.write(h);i.$.close();}});d.node=function(h){if(h){var i=h.nodeType==9?'document':h.nodeType==1?'element':h.nodeType==3?'text':h.nodeType==8?'comment':'domObject';return new d[i](h);}return this;};d.node.prototype=new d.domObject();a.NODE_ELEMENT=1; +a.NODE_DOCUMENT=9;a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h),k=function(l){if(l.nodeType!=1)return;if(!i)l.removeAttribute('id',false);l['data-cke-expando']=undefined;if(h){var m=l.childNodes;for(var n=0;n]*>/g,''):l;},getOuterHtml:function(){var m=this;if(m.$.outerHTML)return m.$.outerHTML.replace(/<\?[^>]*>/,'');var l=m.$.ownerDocument.createElement('div');l.appendChild(m.$.cloneNode(true));return l.innerHTML;},setHtml:function(l){return this.$.innerHTML=l;},setText:function(l){h.prototype.setText=this.$.innerText!=undefined?function(m){return this.$.innerText=m;}:function(m){return this.$.textContent=m;};return this.setText(l);},getAttribute:(function(){var l=function(m){return this.$.getAttribute(m,2);};if(c&&(b.ie7Compat||b.ie6Compat))return function(m){var q=this;switch(m){case 'class':m='className';break;case 'http-equiv':m='httpEquiv';break;case 'name':return q.$.name;case 'tabindex':var n=l.call(q,m);if(n!==0&&q.$.tabIndex===0)n=null;return n;break;case 'checked':var o=q.$.attributes.getNamedItem(m),p=o.specified?o.nodeValue:q.$.checked;return p?'checked':null;case 'hspace':case 'value':return q.$[m];case 'style':return q.$.style.cssText;case 'contenteditable':case 'contentEditable':return q.$.attributes.getNamedItem('contentEditable').specified?q.$.getAttribute('contentEditable'):null;}return l.call(q,m);};else return l;})(),getChildren:function(){return new d.nodeList(this.$.childNodes);},getComputedStyle:c?function(l){return this.$.currentStyle[e.cssStyleToDomStyle(l)];}:function(l){var m=this.getWindow().$.getComputedStyle(this.$,null);return m?m.getPropertyValue(l):'';},getDtd:function(){var l=f[this.getName()];this.getDtd=function(){return l;};return l;},getElementsByTag:g.prototype.getElementsByTag,getTabIndex:c?function(){var l=this.$.tabIndex;if(l===0&&!f.$tabIndex[this.getName()]&&parseInt(this.getAttribute('tabindex'),10)!==0)l=-1;return l;}:b.webkit?function(){var l=this.$.tabIndex;if(l==undefined){l=parseInt(this.getAttribute('tabindex'),10);if(isNaN(l))l=-1;}return l;}:function(){return this.$.tabIndex;},getText:function(){return this.$.textContent||this.$.innerText||'';},getWindow:function(){return this.getDocument().getWindow();},getId:function(){return this.$.id||null;},getNameAtt:function(){return this.$.name||null;},getName:function(){var l=this.$.nodeName.toLowerCase();if(c&&!(document.documentMode>8)){var m=this.$.scopeName;if(m!='HTML')l=m.toLowerCase()+':'+l;}return(this.getName=function(){return l; +})();},getValue:function(){return this.$.value;},getFirst:function(l){var m=this.$.firstChild,n=m&&new d.node(m);if(n&&l&&!l(n))n=n.getNext(l);return n;},getLast:function(l){var m=this.$.lastChild,n=m&&new d.node(m);if(n&&l&&!l(n))n=n.getPrevious(l);return n;},getStyle:function(l){return this.$.style[e.cssStyleToDomStyle(l)];},is:function(){var l=this.getName();for(var m=0;m0&&(m>2||!n[l[0].nodeName]||m==2&&!n[l[1].nodeName]);},hasAttribute:(function(){function l(m){var n=this.$.attributes.getNamedItem(m);return!!(n&&n.specified);};return c&&b.version<8?function(m){if(m=='name')return!!this.$.name;return l.call(this,m);}:l;})(),hide:function(){this.setStyle('display','none');},moveChildren:function(l,m){var n=this.$; +l=l.$;if(n==l)return;var o;if(m)while(o=n.lastChild)l.insertBefore(n.removeChild(o),l.firstChild);else while(o=n.firstChild)l.appendChild(n.removeChild(o));},mergeSiblings:(function(){function l(m,n,o){if(n&&n.type==1){var p=[];while(n.data('cke-bookmark')||n.isEmptyInlineRemoveable()){p.push(n);n=o?n.getNext():n.getPrevious();if(!n||n.type!=1)return;}if(m.isIdentical(n)){var q=o?m.getLast():m.getFirst();while(p.length)p.shift().move(m,!o);n.moveChildren(m,!o);n.remove();if(q&&q.type==1)q.mergeSiblings();}}};return function(m){var n=this;if(!(m===false||f.$removeEmpty[n.getName()]||n.is('a')))return;l(n,n.getNext(),true);l(n,n.getPrevious());};})(),show:function(){this.setStyles({display:'',visibility:''});},setAttribute:(function(){var l=function(m,n){this.$.setAttribute(m,n);return this;};if(c&&(b.ie7Compat||b.ie6Compat))return function(m,n){var o=this;if(m=='class')o.$.className=n;else if(m=='style')o.$.style.cssText=n;else if(m=='tabindex')o.$.tabIndex=n;else if(m=='checked')o.$.checked=n;else if(m=='contenteditable')l.call(o,'contentEditable',n);else l.apply(o,arguments);return o;};else if(b.ie8Compat&&b.secure)return function(m,n){if(m=='src'&&n.match(/^http:\/\//))try{l.apply(this,arguments);}catch(o){}else l.apply(this,arguments);return this;};else return l;})(),setAttributes:function(l){for(var m in l)this.setAttribute(m,l[m]);return this;},setValue:function(l){this.$.value=l;return this;},removeAttribute:(function(){var l=function(m){this.$.removeAttribute(m);};if(c&&(b.ie7Compat||b.ie6Compat))return function(m){if(m=='class')m='className';else if(m=='tabindex')m='tabIndex';else if(m=='contenteditable')m='contentEditable';l.call(this,m);};else return l;})(),removeAttributes:function(l){if(e.isArray(l))for(var m=0;m=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+l+')');}else this.setStyle('opacity',l); +},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';this.on('dragstart',function(l){l.data.preventDefault();});}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';this.on('dragstart',function(l){l.data.preventDefault();});}:function(){if(c||b.opera){var l=this.$,m=l.getElementsByTagName('*'),n,o=0;l.unselectable='on';while(n=m[o++])switch(n.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:n.unselectable='on';}}},getPositionedAncestor:function(){var l=this;while(l.getName()!='html'){if(l.getComputedStyle('position')!='static')return l;l=l.getParent();}return null;},getDocumentPosition:function(l){var G=this;var m=0,n=0,o=G.getDocument(),p=o.getBody(),q=o.$.compatMode=='BackCompat';if(document.documentElement.getBoundingClientRect){var r=G.$.getBoundingClientRect(),s=o.$,t=s.documentElement,u=t.clientTop||p.$.clientTop||0,v=t.clientLeft||p.$.clientLeft||0,w=true;if(c){var x=o.getDocumentElement().contains(G),y=o.getBody().contains(G);w=q&&y||!q&&x;}if(w){m=r.left+(!q&&t.scrollLeft||p.$.scrollLeft);m-=v;n=r.top+(!q&&t.scrollTop||p.$.scrollTop);n-=u;}}else{var z=G,A=null,B;while(z&&!(z.getName()=='body'||z.getName()=='html')){m+=z.$.offsetLeft-z.$.scrollLeft;n+=z.$.offsetTop-z.$.scrollTop;if(!z.equals(G)){m+=z.$.clientLeft||0;n+=z.$.clientTop||0;}var C=A;while(C&&!C.equals(z)){m-=C.$.scrollLeft;n-=C.$.scrollTop;C=C.getParent();}A=z;z=(B=z.$.offsetParent)?new h(B):null;}}if(l){var D=G.getWindow(),E=l.getWindow();if(!D.equals(E)&&D.$.frameElement){var F=new h(D.$.frameElement).getDocumentPosition(l);m+=F.x;n+=F.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!q){m+=G.$.clientLeft?1:0;n+=G.$.clientTop?1:0;}return{x:m,y:n};},scrollIntoView:function(l){var m=this.getParent();if(!m)return;do{var n=m.$.clientWidth&&m.$.clientWidth0)q(0,m===true?A.y:m===false?B.y:A.y<0?A.y:B.y);if(n&&(A.x<0||B.x>0))q(A.x<0?A.x:B.x,0);},setState:function(l){var m=this;switch(l){case 1:m.addClass('cke_on');m.removeClass('cke_off');m.removeClass('cke_disabled');break;case 0:m.addClass('cke_disabled');m.removeClass('cke_off');m.removeClass('cke_on');break;default:m.addClass('cke_off');m.removeClass('cke_on');m.removeClass('cke_disabled');break;}},getFrameDocument:function(){var l=this.$;try{l.contentWindow.document;}catch(m){l.src=l.src;if(c&&b.version<7)window.showModalDialog('javascript:document.write("")');}return l&&new g(l.contentWindow.document);},copyAttributes:function(l,m){var s=this;var n=s.$.attributes;m=m||{};for(var o=0;o0&&m)m=m.childNodes[l.shift()];return m?new d.node(m):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(l){if(!l.data.getTarget().hasClass('cke_enable_context_menu'))l.data.preventDefault();});},getDirection:function(l){var m=this;return l?m.getComputedStyle('direction')||m.getDirection()||m.getDocument().$.dir||m.getDocument().getBody().getDirection(1):m.getStyle('direction')||m.getAttribute('dir');},data:function(l,m){l='data-'+l;if(m===undefined)return this.getAttribute(l);else if(m===false)this.removeAttribute(l);else this.setAttribute(l,m);return null;}});var i={width:['border-left-width','border-right-width','padding-left','padding-right'],height:['border-top-width','border-bottom-width','padding-top','padding-bottom']}; +function j(l){var m=['top','left','right','bottom'],n;if(l=='border')n=['color','style','width'];var o=[];for(var p=0;p',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,a11yhelp,basicstyles,bidi,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,dialogadvtab,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,iframe,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,showblocks,showborders,smiley,sourcearea,specialchar,stylescombo,tab,table,tabletools,templates,toolbar,undo,wsc,wysiwygarea',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000}; +var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer;j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,ug:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language||k;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o){var p=typeof l=='string';if(p)l=[l];if(!n)n=a;var q=l.length,r=[],s=[],t=function(y){if(m)if(p)m.call(n,y);else m.call(n,r,s);};if(q===0){t(true);return;}var u=function(y,z){(z?r:s).push(y);if(--q<=0){o&&a.document.getDocumentElement().removeStyle('cursor');t(z);}},v=function(y,z){j[y]=1;var A=k[y];delete k[y];for(var B=0;B1)return;var A=new h('script');A.setAttributes({type:'text/javascript',src:y});if(m)if(c)A.$.onreadystatechange=function(){if(A.$.readyState=='loaded'||A.$.readyState=='complete'){A.$.onreadystatechange=null;v(y,true);}};else{A.$.onload=function(){setTimeout(function(){v(y,true);},0);};A.$.onerror=function(){v(y,false);};}A.appendTo(a.document.getHead());};o&&a.document.getDocumentElement().setStyle('cursor','wait');for(var x=0;x1)return;var w=!p.css||!p.css.length,x=!p.js||!p.js.length,y=function(){if(w&&x){p._isLoaded=1;for(var B=0;B=0?x.langCode:J[0];if(!I.langEntries||!I.langEntries[L])G.push(a.getUrl(K+'lang/'+L+'.js'));else{e.extend(x.lang,I.langEntries[L]);L=null;}}F.push(L);E.push(I);}a.scriptLoader.load(G,function(){var M=['beforeInit','init','afterInit'];for(var N=0;N]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))",'g')};};(function(){var l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,m={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};a.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){var A=this;var o,p,q=0,r;while(o=A._.htmlPartsRegex.exec(n)){var s=o.index;if(s>q){var t=n.substring(q,s);if(r)r.push(t);else A.onText(t);}q=A._.htmlPartsRegex.lastIndex;if(p=o[1]){p=p.toLowerCase();if(r&&f.$cdata[p]){A.onCDATA(r.join(''));r=null;}if(!r){A.onTagClose(p);continue;}}if(r){r.push(o[0]);continue;}if(p=o[3]){p=p.toLowerCase();if(/="/.test(p))continue; +var u={},v,w=o[4],x=!!(w&&w.charAt(w.length-1)=='/');if(w)while(v=l.exec(w)){var y=v[1].toLowerCase(),z=v[2]||v[3]||v[4]||'';if(!z&&m[y])u[y]=y;else u[y]=z;}A.onTagOpen(p,u,x);if(!r&&f.$cdata[p])r=[];continue;}if(p=o[2])A.onComment(p);}if(n.length>q)A.onText(n.substring(q,n.length));}};})();a.htmlParser.comment=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.comment.prototype={type:8,writeHtml:function(l,m){var n=this.value;if(m){if(!(n=m.onComment(n,this)))return;if(typeof n!='string'){n.parent=this.parent;n.writeHtml(l,m);return;}}l.comment(n);}};(function(){a.htmlParser.text=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.text.prototype={type:3,writeHtml:function(l,m){var n=this.value;if(m&&!(n=m.onText(n,this)))return;l.text(n);}};})();(function(){a.htmlParser.cdata=function(l){this.value=l;};a.htmlParser.cdata.prototype={type:3,writeHtml:function(l){l.write(this.value);}};})();a.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false};};(function(){var l=e.extend({table:1,ul:1,ol:1,dl:1},f.table,f.ul,f.ol,f.dl),m=c&&b.version<8?{dd:1,dt:1}:{},n={ol:1,ul:1},o=e.extend({},{html:1},f.html,f.body,f.head,{style:1,script:1});function p(q){return q.name=='a'&&q.attributes.href||f.$removeEmpty[q.name];};a.htmlParser.fragment.fromHtml=function(q,r,s){var t=new a.htmlParser(),u=s||new a.htmlParser.fragment(),v=[],w=[],x=u,y=false,z=false;function A(D){var E;if(v.length>0)for(var F=0;F=0;E--){if(D==v[E].name){v.splice(E,1);return;}}var F=[],G=[],H=x;while(H!=u&&H.name!=D){if(!H._.isBlockLike)G.unshift(H);F.push(H);H=H.returnPoint||H.parent;}if(H!=u){for(E=0;E0?t.children[r-1]:null;if(s){if(q._.isBlockLike&&s.type==3){s.value=e.rtrim(s.value);if(s.value.length===0){t.children.pop();t.add(q);return;}}s.next=q;}q.previous=s;q.parent=t;t.children.splice(r,0,q);t._.hasInlineStarted=q.type==3||q.type==1&&!q._.isBlockLike;},writeHtml:function(q,r){var s;this.filterChildren=function(){var t=new a.htmlParser.basicWriter();this.writeChildrenHtml.call(this,t,r,true);var u=t.getHtml();this.children=new a.htmlParser.fragment.fromHtml(u).children;s=1;};!this.name&&r&&r.onFragment(this);this.writeChildrenHtml(q,s?null:r);},writeChildrenHtml:function(q,r){for(var s=0;sn?1:0;};a.htmlParser.element.prototype={type:1,add:a.htmlParser.fragment.prototype.add,clone:function(){return new a.htmlParser.element(this.name,this.attributes);},writeHtml:function(m,n){var o=this.attributes,p=this,q=p.name,r,s,t,u;p.filterChildren=function(){if(!u){var B=new a.htmlParser.basicWriter();a.htmlParser.fragment.prototype.writeChildrenHtml.call(p,B,n);p.children=new a.htmlParser.fragment.fromHtml(B.getHtml(),0,p.clone()).children;u=1;}};if(n){for(;;){if(!(q=n.onElementName(q)))return;p.name=q;if(!(p=n.onElement(p)))return;p.parent=this.parent;if(p.name==q)break;if(p.type!=1){p.writeHtml(m,n);return;}q=p.name;if(!q){for(var v=0,w=this.children.length;v=0;u--){var x=r[u];if(x){x.pri=s;q.splice(t,0,x);}}}};function n(q,r,s){if(r)for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u)q.$length++;}};function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s)q=[r,q];else q=[q,r];q.filter=p;}else m(q,r,s);return q;}else{r.filter=r;return r;}}};function p(q){var r=q.type||q instanceof a.htmlParser.fragment;for(var s=0;s');else this._.output.push('>');},attribute:function(l,m){if(typeof m=='string')m=e.htmlEncodeAttr(m);this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){this._.output.push('');},text:function(l){this._.output.push(l);},comment:function(l){this._.output.push('');},write:function(l){this._.output.push(l); +},reset:function(){this._.output=[];this._.indent=false;},getHtml:function(l){var m=this._.output.join('');if(l)this.reset();return m;}}});delete a.loadFullCore;a.instances={};a.document=new g(document);a.add=function(l){a.instances[l.name]=l;l.on('focus',function(){if(a.currentInstance!=l){a.currentInstance=l;a.fire('currentInstance');}});l.on('blur',function(){if(a.currentInstance==l){a.currentInstance=null;a.fire('currentInstance');}});};a.remove=function(l){delete a.instances[l.name];};a.on('instanceDestroyed',function(){if(e.isEmpty(this.instances))a.fire('reset');});a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;d.comment=function(l,m){if(typeof l=='string')l=(m?m.$:document).createComment(l);d.domObject.call(this,l);};d.comment.prototype=new d.node();e.extend(d.comment.prototype,{type:8,getOuterHtml:function(){return '';}});(function(){var l={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1,legend:1,caption:1},m={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,form:1,fieldset:1},n=function(o){var p=o.getChildren();for(var q=0,r=p.count();q0)v=v.getChild(z-1);else v=A(v,true)===false?null:v.getPreviousSourceNode(true,C,A);}else{v=w;if(v.type==1)if(!(v=v.getChild(y)))v=A(w,true)===false?null:w.getNextSourceNode(true,C,A);}if(v&&A(v)===false)v=null;}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!t)return v;}else if(t&&this.evaluator)return false;v=v[D](false,C,A);}this.end();return this.current=null;};function m(s){var t,u=null;while(t=l.call(this,s))u=t;return u;};d.walker=e.createClass({$:function(s){this.range=s;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,1);},checkForward:function(){return l.call(this,0,1)!==false;},checkBackward:function(){return l.call(this,1,1)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,1);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1};h.prototype.isBlockBoundary=function(s){var t=s?e.extend({},f.$block,s||{}):f.$block; +return this.getComputedStyle('float')=='none'&&n[this.getComputedStyle('display')]||t[this.getName()];};d.walker.blockBoundary=function(s){return function(t,u){return!(t.type==1&&t.isBlockBoundary(s));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmark=function(s,t){function u(v){return v&&v.getName&&v.getName()=='span'&&v.data('cke-bookmark');};return function(v){var w,x;w=v&&!v.getName&&(x=v.getParent())&&u(x);w=s?w:w||u(v);return!!(t^w);};};d.walker.whitespaces=function(s){return function(t){var u;if(t&&t.type==3)u=!e.trim(t.getText())||b.webkit&&t.getText()=='​';return!!(s^u);};};d.walker.invisible=function(s){var t=d.walker.whitespaces();return function(u){var v;if(t(u))v=1;else{if(u.type==3)u=u.getParent();v=!u.$.offsetHeight;}return!!(s^v);};};d.walker.nodeType=function(s,t){return function(u){return!!(t^u.type==s);};};d.walker.bogus=function(s){function t(u){return!p(u)&&!q(u);};return function(u){var v=!c?u.is&&u.is('br'):u.getText&&o.test(u.getText());if(v){var w=u.getParent(),x=u.getNext(t);v=w.isBlockBoundary()&&(!x||x.type==1&&x.isBlockBoundary());}return!!(s^v);};};var o=/^[\t\r\n ]*(?: |\xa0)$/,p=d.walker.whitespaces(),q=d.walker.bookmark(),r=function(s){return q(s)||p(s)||s.type==1&&s.getName() in f.$inline&&!(s.getName() in f.$empty);};h.prototype.getBogus=function(){var s=this;do s=s.getPreviousSourceNode();while(r(s));if(s&&(!c?s.is&&s.is('br'):s.getText&&o.test(s.getText())))return s;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(v){v.collapsed=v.startContainer&&v.endContainer&&v.startContainer.equals(v.endContainer)&&v.startOffset==v.endOffset;},m=function(v,w,x,y){v.optimizeBookmark();var z=v.startContainer,A=v.endContainer,B=v.startOffset,C=v.endOffset,D,E;if(A.type==3)A=A.split(C);else if(A.getChildCount()>0)if(C>=A.getChildCount()){A=A.append(v.document.createText(''));E=true;}else A=A.getChild(C);if(z.type==3){z.split(B);if(z.equals(A))A=z.getNext();}else if(!B){z=z.getFirst().insertBeforeMe(v.document.createText(''));D=true;}else if(B>=z.getChildCount()){z=z.append(v.document.createText(''));D=true;}else z=z.getChild(B).getPrevious();var F=z.getParents(),G=A.getParents(),H,I,J;for(H=0;H0&&!L.equals(A))M=K.append(L.clone());if(!F[Q]||L.$.parentNode!=F[Q].$.parentNode){N=L.getPrevious();while(N){if(N.equals(F[Q])||N.equals(z))break;O=N.getPrevious();if(w==2)K.$.insertBefore(N.$.cloneNode(true),K.$.firstChild);else{N.remove();if(w==1)K.$.insertBefore(N.$,K.$.firstChild);}N=O;}}if(K)K=M;}if(w==2){var R=v.startContainer;if(R.type==3){R.$.data+=R.$.nextSibling.data;R.$.parentNode.removeChild(R.$.nextSibling);}var S=v.endContainer;if(S.type==3&&S.$.nextSibling){S.$.data+=S.$.nextSibling.data;S.$.parentNode.removeChild(S.$.nextSibling);}}else{if(I&&J&&(z.$.parentNode!=I.$.parentNode||A.$.parentNode!=J.$.parentNode)){var T=J.getIndex();if(D&&J.$.parentNode==z.$.parentNode)T--;if(y&&I.type==1){var U=h.createFromHtml(' ',v.document);U.insertAfter(I);I.mergeSiblings(false);v.moveToBookmark({startNode:U});}else v.setStart(J.getParent(),T);}v.collapse(true);}if(D)z.remove();if(E&&A.$.parentNode)A.remove();},n={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1};function o(){var v=false,w=d.walker.whitespaces(),x=d.walker.bookmark(true),y=d.walker.bogus();return function(z){if(x(z)||w(z))return true;if(y(z)&&!v){v=true;return true;}if(z.type==3&&(z.hasAscendant('pre')||e.trim(z.getText()).length))return false;if(z.type==1&&!n[z.getName()])return false;return true;};};var p=d.walker.bogus();function q(v){var w=d.walker.whitespaces(),x=d.walker.bookmark(1);return function(y){if(x(y)||w(y))return true;return!v&&p(y)||y.type==1&&y.getName() in f.$removeEmpty;};};var r=new d.walker.whitespaces(),s=new d.walker.bookmark(),t=/^[\t\r\n ]*(?: |\xa0)$/;function u(v){return!r(v)&&!s(v);};d.range.prototype={clone:function(){var w=this;var v=new d.range(w.document);v.startContainer=w.startContainer;v.startOffset=w.startOffset;v.endContainer=w.endContainer;v.endOffset=w.endOffset;v.collapsed=w.collapsed;return v;},collapse:function(v){var w=this;if(v){w.endContainer=w.startContainer;w.endOffset=w.startOffset;}else{w.startContainer=w.endContainer;w.startOffset=w.endOffset;}w.collapsed=true;},cloneContents:function(){var v=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,v);return v;},deleteContents:function(v){if(this.collapsed)return; +m(this,0,null,v);},extractContents:function(v){var w=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,w,v);return w;},createBookmark:function(v){var B=this;var w,x,y,z,A=B.collapsed;w=B.document.createElement('span');w.data('cke-bookmark',1);w.setStyle('display','none');w.setHtml(' ');if(v){y='cke_bm_'+e.getNextNumber();w.setAttribute('id',y+(A?'C':'S'));}if(!A){x=w.clone();x.setHtml(' ');if(v)x.setAttribute('id',y+'E');z=B.clone();z.collapse();z.insertNode(x);}z=B.clone();z.collapse(true);z.insertNode(w);if(x){B.setStartAfter(w);B.setEndBefore(x);}else B.moveToPosition(w,4);return{startNode:v?y+(A?'C':'S'):w,endNode:v?y+'E':x,serializable:v,collapsed:A};},createBookmark2:function(v){var D=this;var w=D.startContainer,x=D.endContainer,y=D.startOffset,z=D.endOffset,A=D.collapsed,B,C;if(!w||!x)return{start:0,end:0};if(v){if(w.type==1){B=w.getChild(y);if(B&&B.type==3&&y>0&&B.getPrevious().type==3){w=B;y=0;}if(B&&B.type==1)y=B.getIndex(1);}while(w.type==3&&(C=w.getPrevious())&&C.type==3){w=C;y+=C.getLength();}if(!A){if(x.type==1){B=x.getChild(z);if(B&&B.type==3&&z>0&&B.getPrevious().type==3){x=B;z=0;}if(B&&B.type==1)z=B.getIndex(1);}while(x.type==3&&(C=x.getPrevious())&&C.type==3){x=C;z+=C.getLength();}}}return{start:w.getAddress(v),end:A?null:x.getAddress(v),startOffset:y,endOffset:z,normalized:v,collapsed:A,is2:true};},moveToBookmark:function(v){var D=this;if(v.is2){var w=D.document.getByAddress(v.start,v.normalized),x=v.startOffset,y=v.end&&D.document.getByAddress(v.end,v.normalized),z=v.endOffset;D.setStart(w,x);if(y)D.setEnd(y,z);else D.collapse(true);}else{var A=v.serializable,B=A?D.document.getById(v.startNode):v.startNode,C=A?D.document.getById(v.endNode):v.endNode;D.setStartBefore(B);B.remove();if(C){D.setEndBefore(C);C.remove();}else D.collapse(true);}},getBoundaryNodes:function(){var A=this;var v=A.startContainer,w=A.endContainer,x=A.startOffset,y=A.endOffset,z;if(v.type==1){z=v.getChildCount();if(z>x)v=v.getChild(x);else if(z<1)v=v.getPreviousSourceNode();else{v=v.$;while(v.lastChild)v=v.lastChild;v=new d.node(v);v=v.getNextSourceNode()||v;}}if(w.type==1){z=w.getChildCount();if(z>y)w=w.getChild(y).getPreviousSourceNode(true);else if(z<1)w=w.getPreviousSourceNode();else{w=w.$;while(w.lastChild)w=w.lastChild;w=new d.node(w);}}if(v.getPosition(w)&2)v=w;return{startNode:v,endNode:w};},getCommonAncestor:function(v,w){var A=this;var x=A.startContainer,y=A.endContainer,z;if(x.equals(y)){if(v&&x.type==1&&A.startOffset==A.endOffset-1)z=x.getChild(A.startOffset); +else z=x;}else z=x.getCommonAncestor(y);return w&&!z.is?z.getParent():z;},optimize:function(){var x=this;var v=x.startContainer,w=x.startOffset;if(v.type!=1)if(!w)x.setStartBefore(v);else if(w>=v.getLength())x.setStartAfter(v);v=x.endContainer;w=x.endOffset;if(v.type!=1)if(!w)x.setEndBefore(v);else if(w>=v.getLength())x.setEndAfter(v);},optimizeBookmark:function(){var x=this;var v=x.startContainer,w=x.endContainer;if(v.is&&v.is('span')&&v.data('cke-bookmark'))x.setStartAt(v,3);if(w&&w.is&&w.is('span')&&w.data('cke-bookmark'))x.setEndAt(w,4);},trim:function(v,w){var D=this;var x=D.startContainer,y=D.startOffset,z=D.collapsed;if((!v||z)&&x&&x.type==3){if(!y){y=x.getIndex();x=x.getParent();}else if(y>=x.getLength()){y=x.getIndex()+1;x=x.getParent();}else{var A=x.split(y);y=x.getIndex()+1;x=x.getParent();if(D.startContainer.equals(D.endContainer))D.setEnd(A,D.endOffset-D.startOffset);else if(x.equals(D.endContainer))D.endOffset+=1;}D.setStart(x,y);if(z){D.collapse(true);return;}}var B=D.endContainer,C=D.endOffset;if(!(w||z)&&B&&B.type==3){if(!C){C=B.getIndex();B=B.getParent();}else if(C>=B.getLength()){C=B.getIndex()+1;B=B.getParent();}else{B.split(C);C=B.getIndex()+1;B=B.getParent();}D.setEnd(B,C);}},enlarge:function(v,w){switch(v){case 1:if(this.collapsed)return;var x=this.getCommonAncestor(),y=this.document.getBody(),z,A,B,C,D,E=false,F,G,H=this.startContainer,I=this.startOffset;if(H.type==3){if(I){H=!e.trim(H.substring(0,I)).length&&H;E=!!H;}if(H)if(!(C=H.getPrevious()))B=H.getParent();}else{if(I)C=H.getChild(I-1)||H.getLast();if(!C)B=H;}while(B||C){if(B&&!C){if(!D&&B.equals(x))D=true;if(!y.contains(B))break;if(!E||B.getComputedStyle('display')!='inline'){E=false;if(D)z=B;else this.setStartBefore(B);}C=B.getPrevious();}while(C){F=false;if(C.type==8){C=C.getPrevious();continue;}else if(C.type==3){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;F=/[\s\ufeff]$/.test(G);}else if((C.$.offsetWidth>0||w&&C.is('br'))&&!C.data('cke-bookmark'))if(E&&f.$removeEmpty[C.getName()]){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;else{var J=C.$.getElementsByTagName('*');for(var K=0,L;L=J[K++];){if(!f.$removeEmpty[L.nodeName.toLowerCase()]){C=null;break;}}}if(C)F=!!G.length;}else C=null;if(F)if(E){if(D)z=B;else if(B)this.setStartBefore(B);}else E=true;if(C){var M=C.getPrevious();if(!B&&!M){B=C;C=null;break;}C=M;}else B=null;}if(B)B=B.getParent();}H=this.endContainer;I=this.endOffset;B=C=null;D=E=false;if(H.type==3){H=!e.trim(H.substring(I)).length&&H;E=!(H&&H.getLength());if(H)if(!(C=H.getNext()))B=H.getParent(); +}else{C=H.getChild(I);if(!C)B=H;}while(B||C){if(B&&!C){if(!D&&B.equals(x))D=true;if(!y.contains(B))break;if(!E||B.getComputedStyle('display')!='inline'){E=false;if(D)A=B;else if(B)this.setEndAfter(B);}C=B.getNext();}while(C){F=false;if(C.type==3){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;F=/^[\s\ufeff]/.test(G);}else if(C.type==1){if((C.$.offsetWidth>0||w&&C.is('br'))&&!C.data('cke-bookmark'))if(E&&f.$removeEmpty[C.getName()]){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;else{J=C.$.getElementsByTagName('*');for(K=0;L=J[K++];){if(!f.$removeEmpty[L.nodeName.toLowerCase()]){C=null;break;}}}if(C)F=!!G.length;}else C=null;}else F=1;if(F)if(E)if(D)A=B;else this.setEndAfter(B);if(C){M=C.getNext();if(!B&&!M){B=C;C=null;break;}C=M;}else B=null;}if(B)B=B.getParent();}if(z&&A){x=z.contains(A)?A:z;this.setStartBefore(x);this.setEndAfter(x);}break;case 2:case 3:var N=new d.range(this.document);y=this.document.getBody();N.setStartAt(y,1);N.setEnd(this.startContainer,this.startOffset);var O=new d.walker(N),P,Q,R=d.walker.blockBoundary(v==3?{br:1}:null),S=function(Y){var Z=R(Y);if(!Z)P=Y;return Z;},T=function(Y){var Z=S(Y);if(!Z&&Y.is&&Y.is('br'))Q=Y;return Z;};O.guard=S;B=O.lastBackward();P=P||y;this.setStartAt(P,!P.is('br')&&(!B&&this.checkStartOfBlock()||B&&P.contains(B))?1:4);if(v==3){var U=this.clone();O=new d.walker(U);var V=d.walker.whitespaces(),W=d.walker.bookmark();O.evaluator=function(Y){return!V(Y)&&!W(Y);};var X=O.previous();if(X&&X.type==1&&X.is('br'))return;}N=this.clone();N.collapse();N.setEndAt(y,2);O=new d.walker(N);O.guard=v==3?T:S;P=null;B=O.lastForward();P=P||y;this.setEndAt(P,!B&&this.checkEndOfBlock()||B&&P.contains(B)?2:3);if(Q)this.setEndAfter(Q);}},shrink:function(v,w){if(!this.collapsed){v=v||2;var x=this.clone(),y=this.startContainer,z=this.endContainer,A=this.startOffset,B=this.endOffset,C=this.collapsed,D=1,E=1;if(y&&y.type==3)if(!A)x.setStartBefore(y);else if(A>=y.getLength())x.setStartAfter(y);else{x.setStartBefore(y);D=0;}if(z&&z.type==3)if(!B)x.setEndBefore(z);else if(B>=z.getLength())x.setEndAfter(z);else{x.setEndAfter(z);E=0;}var F=new d.walker(x),G=d.walker.bookmark();F.evaluator=function(K){return K.type==(v==1?1:3);};var H;F.guard=function(K,L){if(G(K))return true;if(v==1&&K.type==3)return false;if(L&&K.equals(H))return false;if(!L&&K.type==1)H=K;return true;};if(D){var I=F[v==1?'lastForward':'next']();I&&this.setStartAt(I,w?1:3);}if(E){F.reset();var J=F[v==1?'lastBackward':'previous']();J&&this.setEndAt(J,w?2:4);}return!!(D||E); +}},insertNode:function(v){var z=this;z.optimizeBookmark();z.trim(false,true);var w=z.startContainer,x=z.startOffset,y=w.getChild(x);if(y)v.insertBefore(y);else w.append(v);if(v.getParent().equals(z.endContainer))z.endOffset++;z.setStartBefore(v);},moveToPosition:function(v,w){this.setStartAt(v,w);this.collapse(true);},selectNodeContents:function(v){this.setStart(v,0);this.setEnd(v,v.type==3?v.getLength():v.getChildCount());},setStart:function(v,w){var x=this;if(v.type==1&&f.$empty[v.getName()])w=v.getIndex(),v=v.getParent();x.startContainer=v;x.startOffset=w;if(!x.endContainer){x.endContainer=v;x.endOffset=w;}l(x);},setEnd:function(v,w){var x=this;if(v.type==1&&f.$empty[v.getName()])w=v.getIndex()+1,v=v.getParent();x.endContainer=v;x.endOffset=w;if(!x.startContainer){x.startContainer=v;x.startOffset=w;}l(x);},setStartAfter:function(v){this.setStart(v.getParent(),v.getIndex()+1);},setStartBefore:function(v){this.setStart(v.getParent(),v.getIndex());},setEndAfter:function(v){this.setEnd(v.getParent(),v.getIndex()+1);},setEndBefore:function(v){this.setEnd(v.getParent(),v.getIndex());},setStartAt:function(v,w){var x=this;switch(w){case 1:x.setStart(v,0);break;case 2:if(v.type==3)x.setStart(v,v.getLength());else x.setStart(v,v.getChildCount());break;case 3:x.setStartBefore(v);break;case 4:x.setStartAfter(v);}l(x);},setEndAt:function(v,w){var x=this;switch(w){case 1:x.setEnd(v,0);break;case 2:if(v.type==3)x.setEnd(v,v.getLength());else x.setEnd(v,v.getChildCount());break;case 3:x.setEndBefore(v);break;case 4:x.setEndAfter(v);}l(x);},fixBlock:function(v,w){var z=this;var x=z.createBookmark(),y=z.document.createElement(w);z.collapse(v);z.enlarge(2);z.extractContents().appendTo(y);y.trim();if(!c)y.appendBogus();z.insertNode(y);z.moveToBookmark(x);return y;},splitBlock:function(v){var F=this;var w=new d.elementPath(F.startContainer),x=new d.elementPath(F.endContainer),y=w.blockLimit,z=x.blockLimit,A=w.block,B=x.block,C=null;if(!y.equals(z))return null;if(v!='br'){if(!A){A=F.fixBlock(true,v);B=new d.elementPath(F.endContainer).block;}if(!B)B=F.fixBlock(false,v);}var D=A&&F.checkStartOfBlock(),E=B&&F.checkEndOfBlock();F.deleteContents();if(A&&A.equals(B))if(E){C=new d.elementPath(F.startContainer);F.moveToPosition(B,4);B=null;}else if(D){C=new d.elementPath(F.startContainer);F.moveToPosition(A,3);A=null;}else{B=F.splitElement(A);if(!c&&!A.is('ul','ol'))A.appendBogus();}return{previousBlock:A,nextBlock:B,wasStartOfBlock:D,wasEndOfBlock:E,elementPath:C};},splitElement:function(v){var y=this; +if(!y.collapsed)return null;y.setEndAt(v,2);var w=y.extractContents(),x=v.clone(false);w.appendTo(x);x.insertAfter(v);y.moveToPosition(v,4);return x;},checkBoundaryOfElement:function(v,w){var x=w==1,y=this.clone();y.collapse(x);y[x?'setStartAt':'setEndAt'](v,x?1:2);var z=new d.walker(y);z.evaluator=q(x);return z[x?'checkBackward':'checkForward']();},checkStartOfBlock:function(){var B=this;var v=B.startContainer,w=B.startOffset;if(c&&w&&v.type==3){var x=e.ltrim(v.substring(0,w));if(t.test(x))B.trim(0,1);}var y=new d.elementPath(B.startContainer),z=B.clone();z.collapse(true);z.setStartAt(y.block||y.blockLimit,1);var A=new d.walker(z);A.evaluator=o();return A.checkBackward();},checkEndOfBlock:function(){var B=this;var v=B.endContainer,w=B.endOffset;if(c&&v.type==3){var x=e.rtrim(v.substring(w));if(t.test(x))B.trim(1,0);}var y=new d.elementPath(B.endContainer),z=B.clone();z.collapse(false);z.setEndAt(y.block||y.blockLimit,2);var A=new d.walker(z);A.evaluator=o();return A.checkForward();},getPreviousNode:function(v,w,x){var y=this.clone();y.collapse(1);y.setStartAt(x||this.document.getBody(),1);var z=new d.walker(y);z.evaluator=v;z.guard=w;return z.previous();},getNextNode:function(v,w,x){var y=this.clone();y.collapse();y.setEndAt(x||this.document.getBody(),2);var z=new d.walker(y);z.evaluator=v;z.guard=w;return z.next();},checkReadOnly:(function(){function v(w,x){while(w){if(w.type==1)if(w.getAttribute('contentEditable')=='false'&&!w.data('cke-editable'))return 0;else if(w.is('html')||w.getAttribute('contentEditable')=='true'&&(w.contains(x)||w.equals(x)))break;w=w.getParent();}return 1;};return function(){var w=this.startContainer,x=this.endContainer;return!(v(w,x)&&v(x,w));};})(),moveToElementEditablePosition:function(v,w){function x(z,A){var B;if(z.type==1&&z.isEditable(false))B=z[w?'getLast':'getFirst'](u);if(!A&&!B)B=z[w?'getPrevious':'getNext'](u);return B;};if(v.type==1&&!v.isEditable(false)){this.moveToPosition(v,w?4:3);return true;}var y=0;while(v){if(v.type==3){if(w&&this.checkEndOfBlock()&&t.test(v.getText()))this.moveToPosition(v,3);else this.moveToPosition(v,w?4:3);y=1;break;}if(v.type==1)if(v.isEditable()){this.moveToPosition(v,w?2:1);y=1;}else if(w&&v.is('br')&&this.checkEndOfBlock())this.moveToPosition(v,3);v=x(v,y);}return!!y;},moveToElementEditStart:function(v){return this.moveToElementEditablePosition(v);},moveToElementEditEnd:function(v){return this.moveToElementEditablePosition(v,true);},getEnclosedNode:function(){var v=this.clone();v.optimize(); +if(v.startContainer.type!=1||v.endContainer.type!=1)return null;var w=new d.walker(v),x=d.walker.bookmark(true),y=d.walker.whitespaces(true),z=function(B){return y(B)&&x(B);};v.evaluator=z;var A=w.next();w.reset();return A&&A.equals(w.previous())?A:null;},getTouchedStartNode:function(){var v=this.startContainer;if(this.collapsed||v.type!=1)return v;return v.getChild(this.startOffset)||v;},getTouchedEndNode:function(){var v=this.endContainer;if(this.collapsed||v.type!=1)return v;return v.getChild(this.endOffset-1)||v;}};})();a.POSITION_AFTER_START=1;a.POSITION_BEFORE_END=2;a.POSITION_BEFORE_START=3;a.POSITION_AFTER_END=4;a.ENLARGE_ELEMENT=1;a.ENLARGE_BLOCK_CONTENTS=2;a.ENLARGE_LIST_ITEM_CONTENTS=3;a.START=1;a.END=2;a.STARTEND=3;a.SHRINK_ELEMENT=1;a.SHRINK_TEXT=2;(function(){d.rangeList=function(n){if(n instanceof d.rangeList)return n;if(!n)n=[];else if(n instanceof d.range)n=[n];return e.extend(n,l);};var l={createIterator:function(){var n=this,o=d.walker.bookmark(),p=function(s){return!(s.is&&s.is('tr'));},q=[],r;return{getNextRange:function(s){r=r==undefined?0:r+1;var t=n[r];if(t&&n.length>1){if(!r)for(var u=n.length-1;u>=0;u--)q.unshift(n[u].createBookmark(true));if(s){var v=0;while(n[r+v+1]){var w=t.document,x=0,y=w.getById(q[v].endNode),z=w.getById(q[v+1].startNode),A;while(1){A=y.getNextSourceNode(false);if(!z.equals(A)){if(o(A)||A.type==1&&A.isBlockBoundary()){y=A;continue;}}else x=1;break;}if(!x)break;v++;}}t.moveToBookmark(q.shift());while(v--){A=n[++r];A.moveToBookmark(q.shift());t.setEnd(A.endContainer,A.endOffset);}}return t;}};},createBookmarks:function(n){var s=this;var o=[],p;for(var q=0;q',a.document);l.appendTo(a.document.getHead());try{b.hc=l.getComputedStyle('border-top-color')==l.getComputedStyle('border-right-color');}catch(m){b.hc=false;}if(b.hc)b.cssClass+=' cke_hc';l.remove();})();j.load(i.corePlugins.split(','),function(){a.status='loaded';a.fire('loaded');var l=a._.pending;if(l){delete a._.pending;for(var m=0;m0){z=A.shift();while(!z.getParent().equals(D))z=z.getParent();if(!z.equals(H))E.push(z);H=z;}while(E.length>0){z=E.shift();if(z.getName()=='blockquote'){var I=new d.documentFragment(q.document);while(z.getFirst()){I.append(z.getFirst().remove());A.push(I.getLast());}I.replace(z);}else A.push(z);}var J=q.document.createElement('blockquote');J.insertBefore(A[0]);while(A.length>0){z=A.shift();J.append(z);}}else if(r==1){var K=[],L={};while(z=y.getNextParagraph()){var M=null,N=null;while(z.getParent()){if(z.getParent().getName()=='blockquote'){M=z.getParent();N=z;break;}z=z.getParent();}if(M&&N&&!N.getCustomData('blockquote_moveout')){K.push(N);h.setMarker(L,N,'blockquote_moveout',true);}}h.clearAllMarkers(L);var O=[],P=[];L={};while(K.length>0){var Q=K.shift();J=Q.getParent();if(!Q.getPrevious())Q.remove().insertBefore(J);else if(!Q.getNext())Q.remove().insertAfter(J);else{Q.breakParent(Q.getParent());P.push(Q.getNext());}if(!J.getCustomData('blockquote_processed')){P.push(J);h.setMarker(L,J,'blockquote_processed',true);}O.push(Q);}h.clearAllMarkers(L);for(F=P.length-1;F>=0;F--){J=P[F];if(o(J))J.remove();}if(q.config.enterMode==2){var R=true;while(O.length){Q=O.shift();if(Q.getName()=='div'){I=new d.documentFragment(q.document);var S=R&&Q.getPrevious()&&!(Q.getPrevious().type==1&&Q.getPrevious().isBlockBoundary());if(S)I.append(q.document.createElement('br'));var T=Q.getNext()&&!(Q.getNext().type==1&&Q.getNext().isBlockBoundary());while(Q.getFirst())Q.getFirst().remove().appendTo(I);if(T)I.append(q.document.createElement('br'));I.replace(Q);R=false;}}}}s.selectBookmarks(u);q.focus();}};j.add('blockquote',{init:function(q){q.addCommand('blockquote',p);q.ui.addButton('Blockquote',{label:q.lang.blockquote,command:'blockquote'});q.on('selectionChange',n);},requires:['domiterator']});})();j.add('button',{beforeInit:function(m){m.ui.addHandler('button',k.button.handler);}});a.UI_BUTTON='button';k.button=function(m){e.extend(this,m,{title:m.label,className:m.className||m.command&&'cke_button_'+m.command||'',click:m.click||(function(n){n.execCommand(m.command); +})});this._={};};k.button.handler={create:function(m){return new k.button(m);}};(function(){k.button.prototype={render:function(m,n){var o=b,p=this._.id=e.getNextId(),q='',r=this.command,s;this._.editor=m;var t={id:p,button:this,editor:m,focus:function(){var z=a.document.getById(p);z.focus();},execute:function(){if(c&&b.version<7)e.setTimeout(function(){this.button.click(m);},0,this);else this.button.click(m);}},u=e.addFunction(function(z){if(t.onkey){z=new d.event(z);return t.onkey(t,z.getKeystroke())!==false;}}),v=e.addFunction(function(z){var A;if(t.onfocus)A=t.onfocus(t,new d.event(z))!==false;if(b.gecko&&b.version<10900)z.preventBubble();return A;});t.clickFn=s=e.addFunction(t.execute,t);if(this.modes){var w={};function x(){var z=m.mode;if(z){var A=this.modes[z]?w[z]!=undefined?w[z]:2:0;this.setState(m.readOnly&&!this.readOnly?0:A);}};m.on('beforeModeUnload',function(){if(m.mode&&this._.state!=0)w[m.mode]=this._.state;},this);m.on('mode',x,this);!this.readOnly&&m.on('readOnly',x,this);}else if(r){r=m.getCommand(r);if(r){r.on('state',function(){this.setState(r.state);},this);q+='cke_'+(r.state==1?'on':r.state==0?'disabled':'off');}}if(!r)q+='cke_off';if(this.className)q+=' '+this.className;n.push('','=10900&&!o.hc?'':'" href="javascript:void(\''+(this.title||'').replace("'",'')+"')\"",' title="',this.title,'" tabindex="-1" hidefocus="true" role="button" aria-labelledby="'+p+'_label"'+(this.hasArrow?' aria-haspopup="true"':''));if(o.opera||o.gecko&&o.mac)n.push(' onkeypress="return false;"');if(o.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="return CKEDITOR.tools.callFunction(',u,', event);" onfocus="return CKEDITOR.tools.callFunction(',v,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',s,', this); return false;"> ',this.label,'');if(this.hasArrow)n.push(''+(b.hc?'▼':' ')+'');n.push('','');if(this.onRender)this.onRender();return t;},setState:function(m){if(this._.state==m)return false;this._.state=m;var n=a.document.getById(this._.id);if(n){n.setState(m); +m==0?n.setAttribute('aria-disabled',true):n.removeAttribute('aria-disabled');m==1?n.setAttribute('aria-pressed',true):n.removeAttribute('aria-pressed');return true;}else return false;}};})();k.prototype.addButton=function(m,n){this.add(m,'button',n);};(function(){var m=function(y,z){var A=y.document,B=A.getBody(),C=false,D=function(){C=true;};B.on(z,D);(b.version>7?A.$:A.$.selection.createRange()).execCommand(z);B.removeListener(z,D);return C;},n=c?function(y,z){return m(y,z);}:function(y,z){try{return y.document.$.execCommand(z,false,null);}catch(A){return false;}},o=function(y){var z=this;z.type=y;z.canUndo=z.type=='cut';z.startDisabled=true;};o.prototype={exec:function(y,z){this.type=='cut'&&t(y);var A=n(y,this.type);if(!A)alert(y.lang.clipboard[this.type+'Error']);return A;}};var p={canUndo:false,exec:c?function(y){y.focus();if(!y.document.getBody().fire('beforepaste')&&!m(y,'paste')){y.fire('pasteDialog');return false;}}:function(y){try{if(!y.document.getBody().fire('beforepaste')&&!y.document.$.execCommand('Paste',false,null))throw 0;}catch(z){setTimeout(function(){y.fire('pasteDialog');},0);return false;}}},q=function(y){if(this.mode!='wysiwyg')return;switch(y.data.keyCode){case 1114112+86:case 2228224+45:var z=this.document.getBody();if(b.opera||b.gecko)z.fire('paste');return;case 1114112+88:case 2228224+46:var A=this;this.fire('saveSnapshot');setTimeout(function(){A.fire('saveSnapshot');},0);}};function r(y){y.cancel();};function s(y,z,A){var B=this.document;if(B.getById('cke_pastebin'))return;if(z=='text'&&y.data&&y.data.$.clipboardData){var C=y.data.$.clipboardData.getData('text/plain');if(C){y.data.preventDefault();A(C);return;}}var D=this.getSelection(),E=new d.range(B),F=new h(z=='text'?'textarea':b.webkit?'body':'div',B);F.setAttribute('id','cke_pastebin');b.webkit&&F.append(B.createText('\xa0'));B.getBody().append(F);F.setStyles({position:'absolute',top:D.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});F.setStyle(this.config.contentsLangDirection=='ltr'?'left':'right','-1000px');var G=D.createBookmarks();this.on('selectionChange',r,null,null,0);if(z=='text')F.$.focus();else{E.setStartAt(F,1);E.setEndAt(F,2);E.select(true);}var H=this;window.setTimeout(function(){H.document.getBody().focus();H.removeListener('selectionChange',r);if(b.ie7Compat){D.selectBookmarks(G);F.remove();}else{F.remove();D.selectBookmarks(G);}var I;F=b.webkit&&(I=F.getFirst())&&I.is&&I.hasClass('Apple-style-span')?I:F;A(F['get'+(z=='text'?'Value':'Html')]()); +},0);};function t(y){if(!c||b.quirks)return;var z=y.getSelection(),A;if(z.getType()==3&&(A=z.getSelectedElement())){var B=z.getRanges()[0],C=y.document.createText('');C.insertBefore(A);B.setStartBefore(C);B.setEndAfter(A);z.selectRanges([B]);setTimeout(function(){if(A.getParent()){C.remove();z.selectElement(A);}},0);}};var u,v;function w(y,z){var A;if(v&&y in {Paste:1,Cut:1})return 0;if(y=='Paste'){c&&(u=1);try{A=z.document.$.queryCommandEnabled(y)||b.webkit;}catch(D){}u=0;}else{var B=z.getSelection(),C=B&&B.getRanges();A=B&&!(C.length==1&&C[0].collapsed);}return A?2:0;};function x(){var z=this;if(z.mode!='wysiwyg')return;var y=w('Paste',z);z.getCommand('cut').setState(w('Cut',z));z.getCommand('copy').setState(w('Copy',z));z.getCommand('paste').setState(y);z.fire('pasteState',y);};j.add('clipboard',{requires:['dialog','htmldataprocessor'],init:function(y){y.on('paste',function(A){var B=A.data;if(B.html)y.insertHtml(B.html);else if(B.text)y.insertText(B.text);setTimeout(function(){y.fire('afterPaste');},0);},null,null,1000);y.on('pasteDialog',function(A){setTimeout(function(){y.openDialog('paste');},0);});y.on('pasteState',function(A){y.getCommand('paste').setState(A.data);});function z(A,B,C,D){var E=y.lang[B];y.addCommand(B,C);y.ui.addButton(A,{label:E,command:B});if(y.addMenuItems)y.addMenuItem(B,{label:E,command:B,group:'clipboard',order:D});};z('Cut','cut',new o('cut'),1);z('Copy','copy',new o('copy'),4);z('Paste','paste',p,8);a.dialog.add('paste',a.getUrl(this.path+'dialogs/paste.js'));y.on('key',q,y);y.on('contentDom',function(){var A=y.document.getBody();A.on(!c?'paste':'beforepaste',function(B){if(u)return;var C=B.data&&B.data.$;if(c&&C&&!C.ctrlKey)return;var D={mode:'html'};y.fire('beforePaste',D);s.call(y,B,D.mode,function(E){if(!(E=e.trim(E.replace(/]+data-cke-bookmark[^<]*?<\/span>/ig,''))))return;var F={};F[D.mode]=E;y.fire('paste',F);});});if(c){A.on('contextmenu',function(){u=1;setTimeout(function(){u=0;},0);});A.on('paste',function(B){if(!y.document.getById('cke_pastebin')){B.data.preventDefault();u=0;p.exec(y);}});}A.on('beforecut',function(){!u&&t(y);});A.on('mouseup',function(){setTimeout(function(){x.call(y);},0);},y);A.on('keyup',x,y);});y.on('selectionChange',function(A){v=A.data.selection.getRanges()[0].checkReadOnly();x.call(y);});if(y.contextMenu)y.contextMenu.addListener(function(A,B){var C=B.getRanges()[0].checkReadOnly();return{cut:w('Cut',y),copy:w('Copy',y),paste:w('Paste',y)};});}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(m){var n=m.config,o=m.lang.colorButton,p; +if(!b.hc){q('TextColor','fore',o.textColorTitle);q('BGColor','back',o.bgColorTitle);}function q(t,u,v){var w=e.getNextId()+'_colorBox';m.ui.add(t,'panelbutton',{label:v,title:v,className:'cke_button_'+t.toLowerCase(),modes:{wysiwyg:1},panel:{css:m.skin.editor.css,attributes:{role:'listbox','aria-label':o.panelTitle}},onBlock:function(x,y){y.autoSize=true;y.element.addClass('cke_colorblock');y.element.setHtml(r(x,u,w));y.element.getDocument().getBody().setStyle('overflow','hidden');k.fire('ready',this);var z=y.keys,A=m.lang.dir=='rtl';z[A?37:39]='next';z[40]='next';z[9]='next';z[A?39:37]='prev';z[38]='prev';z[2228224+9]='prev';z[32]='click';},onOpen:function(){var x=m.getSelection(),y=x&&x.getStartElement(),z=new d.elementPath(y),A;y=z.block||z.blockLimit||m.document.getBody();do A=y&&y.getComputedStyle(u=='back'?'background-color':'color')||'transparent';while(u=='back'&&A=='transparent'&&y&&(y=y.getParent()));if(!A||A=='transparent')A='#ffffff';this._.panel._.iframe.getFrameDocument().getById(w).setStyle('background-color',A);}});};function r(t,u,v){var w=[],x=n.colorButton_colors.split(','),y=e.addFunction(function(E,F){if(E=='?'){var G=arguments.callee;function H(J){this.removeListener('ok',H);this.removeListener('cancel',H);J.name=='ok'&&G(this.getContentElement('picker','selectedColor').getValue(),F);};m.openDialog('colordialog',function(){this.on('ok',H);this.on('cancel',H);});return;}m.focus();t.hide(false);m.fire('saveSnapshot');new a.style(n['colorButton_'+F+'Style'],{color:'inherit'}).remove(m.document);if(E){var I=n['colorButton_'+F+'Style'];I.childRule=F=='back'?function(J){return s(J);}:function(J){return!(J.is('a')||J.getElementsByTag('a').count())||s(J);};new a.style(I,{color:E}).apply(m.document);}m.fire('saveSnapshot');});w.push('
    ',o.auto,'
    ');for(var z=0;z');var A=x[z].split('/'),B=A[0],C=A[1]||B;if(!A[1])B='#'+B.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var D=m.lang.colors[C]||C;w.push(''); +}if(n.colorButton_enableMore===undefined||n.colorButton_enableMore)w.push('');w.push('
    ',o.more,'
    ');return w.join('');};function s(t){return t.getAttribute('contentEditable')=='false'||t.getAttribute('data-nostyle');};}});i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};j.colordialog={requires:['dialog'],init:function(m){m.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);j.add('contextmenu',{requires:['menu'],onLoad:function(){j.contextMenu=e.createClass({base:a.menu,$:function(m){this.base.call(this,m,{panel:{className:m.skinClass+' cke_contextmenu',attributes:{'aria-label':m.lang.contextmenu.options}}});},proto:{addTarget:function(m,n){if(b.opera&&!('oncontextmenu' in document.body)){var o;m.on('mousedown',function(s){s=s.data;if(s.$.button!=2){if(s.getKeystroke()==1114112+1)m.fire('contextmenu',s);return;}if(n&&(b.mac?s.$.metaKey:s.$.ctrlKey))return;var t=s.getTarget();if(!o){var u=t.getDocument();o=u.createElement('input');o.$.type='button';u.getBody().append(o);}o.setAttribute('style','position:absolute;top:'+(s.$.clientY-2)+'px;left:'+(s.$.clientX-2)+'px;width:5px;height:5px;opacity:0.01');});m.on('mouseup',function(s){if(o){o.remove();o=undefined;m.fire('contextmenu',s.data);}});}m.on('contextmenu',function(s){var t=s.data;if(n&&(b.webkit?p:b.mac?t.$.metaKey:t.$.ctrlKey))return;t.preventDefault();var u=t.getTarget().getDocument().getDocumentElement(),v=t.$.clientX,w=t.$.clientY;e.setTimeout(function(){this.open(u,null,v,w);},c?200:0,this);},this);if(b.opera)m.on('keypress',function(s){var t=s.data;if(t.$.keyCode===0)t.preventDefault();});if(b.webkit){var p,q=function(s){p=b.mac?s.data.$.metaKey:s.data.$.ctrlKey;},r=function(){p=0;};m.on('keydown',q);m.on('keyup',r); +m.on('contextmenu',r);}},open:function(m,n,o,p){this.editor.focus();m=m||a.document.getDocumentElement();this.show(m,n,o,p);}}});},beforeInit:function(m){m.contextMenu=new j.contextMenu(m);m.addCommand('contextMenu',{exec:function(){m.contextMenu.open(m.document.getBody());}});}});(function(){function m(o){var p=this.att,q=o&&o.hasAttribute(p)&&o.getAttribute(p)||'';if(q!==undefined)this.setValue(q);};function n(){var o;for(var p=0;p ';j.add('elementspath',{requires:['selection'],init:function(o){var p='cke_path_'+o.name,q,r=function(){if(!q)q=a.document.getById(p);return q;},s='cke_elementspath_'+e.getNextNumber()+'_';o._.elementsPath={idBase:s,filters:[]};o.on('themeSpace',function(x){if(x.data.space=='bottom')x.data.html+=''+o.lang.elementsPath.eleLabel+''+'
    '+n+'
    ';});function t(x){o.focus();var y=o._.elementsPath.list[x];if(y.is('body')){var z=new d.range(o.document);z.selectNodeContents(y);z.select();}else o.getSelection().selectElement(y);};var u=e.addFunction(t),v=e.addFunction(function(x,y){var z=o._.elementsPath.idBase,A;y=new d.event(y);var B=o.lang.dir=='rtl';switch(y.getKeystroke()){case B?39:37:case 9:A=a.document.getById(z+(x+1));if(!A)A=a.document.getById(z+'0');A.focus();return false;case B?37:39:case 2228224+9:A=a.document.getById(z+(x-1));if(!A)A=a.document.getById(z+(o._.elementsPath.list.length-1));A.focus();return false;case 27:o.focus();return false;case 13:case 32:t(x);return false;}return true;});o.on('selectionChange',function(x){var y=b,z=x.data.selection,A=z.getStartElement(),B=[],C=x.editor,D=C._.elementsPath.list=[],E=C._.elementsPath.filters;while(A){var F=0,G;if(A.data('cke-display-name'))G=A.data('cke-display-name');else if(A.data('cke-real-element-type'))G=A.data('cke-real-element-type');else G=A.getName();for(var H=0;H',G,''+L+'','');}if(G=='body')break;A=A.getParent();}var M=r();M.setHtml(B.join('')+n);C.fire('elementsPathUpdate',{space:M});});function w(){q&&q.setHtml(n);delete o._.elementsPath.list;};o.on('readOnly',w);o.on('contentDomUnload',w);o.addCommand('elementsPathFocus',m.toolbarFocus);}});})();(function(){j.add('enterkey',{requires:['keystrokes','indent'],init:function(t){t.addCommand('enter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){r(v);}});t.addCommand('shiftEnter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){q(v);}});var u=t.keystrokeHandler.keystrokes;u[13]='enter';u[2228224+13]='shiftEnter';}});j.enterkey={enterBlock:function(t,u,v,w){v=v||s(t);if(!v)return;var x=v.document,y=v.checkStartOfBlock(),z=v.checkEndOfBlock(),A=new d.elementPath(v.startContainer),B=A.block;if(y&&z){if(B&&(B.is('li')||B.getParent().is('li'))){t.execCommand('outdent');return;}if(B&&B.getParent().is('blockquote')){B.breakParent(B.getParent());if(!B.getPrevious().getFirst(d.walker.invisible(1)))B.getPrevious().remove();if(!B.getNext().getFirst(d.walker.invisible(1)))B.getNext().remove();v.moveToElementEditStart(B);v.select();return;}}else if(B&&B.is('pre')){if(!z){n(t,u,v,w);return;}}else if(B&&f.$captionBlock[B.getName()]){n(t,u,v,w);return;}var C=u==3?'div':'p',D=v.splitBlock(C);if(!D)return;var E=D.previousBlock,F=D.nextBlock,G=D.wasStartOfBlock,H=D.wasEndOfBlock,I;if(F){I=F.getParent();if(I.is('li')){F.breakParent(I);F.move(F.getNext(),1);}}else if(E&&(I=E.getParent())&&I.is('li')){E.breakParent(I);I=E.getNext();v.moveToElementEditStart(I);E.move(E.getPrevious());}if(!G&&!H){if(F.is('li')&&(I=F.getFirst(d.walker.invisible(true)))&&I.is&&I.is('ul','ol'))(c?x.createText('\xa0'):x.createElement('br')).insertBefore(I);if(F)v.moveToElementEditStart(F);}else{var J,K;if(E){if(E.is('li')||!(p.test(E.getName())||E.is('pre')))J=E.clone();}else if(F)J=F.clone();if(!J){if(I&&I.is('li'))J=I; +else{J=x.createElement(C);if(E&&(K=E.getDirection()))J.setAttribute('dir',K);}}else if(w&&!J.is('li'))J.renameNode(C);var L=D.elementPath;if(L)for(var M=0,N=L.elements.length;M0;v--)u[v].deleteContents();return u[0];};})();(function(){var m='nbsp,gt,lt,amp',n='quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',o='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',p='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv'; +function q(r,s){var t={},u=[],v={nbsp:'\xa0',shy:'­',gt:'>',lt:'<',amp:'&',apos:"'",quot:'"'};r=r.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(A,B){var C=s?'&'+B+';':v[B],D=s?v[B]:'&'+B+';';t[C]=D;u.push(C);return '';});if(!s&&r){r=r.split(',');var w=document.createElement('div'),x;w.innerHTML='&'+r.join(';&')+';';x=w.innerHTML;w=null;for(var y=0;y0;case 'checked':return!!q.$.checked;case 'value':var p=q.getAttribute('type');return p=='checkbox'||p=='radio'?q.$.value!='on':q.$.value;}return m.apply(q,arguments);};});(function(){var m={canUndo:false,exec:function(o){var p=o.document.createElement('hr');o.insertElement(p);}},n='horizontalrule';j.add(n,{init:function(o){o.addCommand(n,m);o.ui.addButton('HorizontalRule',{label:o.lang.horizontalrule,command:n});}});})();(function(){var m=/^[\t\r\n ]*(?: |\xa0)$/,n='{cke_protected}';function o(U){var V=U.children.length,W=U.children[V-1];while(W&&W.type==3&&!e.trim(W.value))W=U.children[--V];return W;};function p(U){var V=U.parent;return V?e.indexOf(V.children,U):-1;};function q(U,V){var W=U.children,X=o(U);if(X){if((V||!c)&&X.type==1&&X.name=='br')W.pop();if(X.type==3&&m.test(X.value))W.pop();}};function r(U,V,W){if(!V&&(!W||typeof W=='function'&&W(U)===false))return false;if(V&&c&&(document.documentMode>7||U.name in f.tr||U.name in f.$listItem))return false;var X=o(U);return!X||X&&(X.type==1&&X.name=='br'||U.name=='form'&&X.name=='input');};function s(U,V){return function(W){q(W,!U);if(r(W,!U,V))if(U||c)W.add(new a.htmlParser.text('\xa0'));else W.add(new a.htmlParser.element('br',{}));};};var t=f,u=['caption','colgroup','col','thead','tfoot','tbody'],v=e.extend({},t.$block,t.$listItem,t.$tableContent);for(var w in v){if(!('br' in t[w]))delete v[w];}delete v.pre;var x={elements:{},attributeNames:[[/^on/,'data-cke-pa-on']]},y={elements:{}};for(w in v)y.elements[w]=s();var z={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^data-cke-(saved|pa)-/,''],[/^data-cke-.*/,''],['hidefocus','']],elements:{$:function(U){var V=U.attributes; +if(V){if(V['data-cke-temp'])return false;var W=['name','href','src'],X;for(var Y=0;Y-1&&Z>-1&&Y!=Z)){Y=p(W);Z=p(X);}return Y>Z?1:-1;});},embed:function(U){var V=U.parent;if(V&&V.name=='object'){var W=V.attributes.width,X=V.attributes.height;W&&(U.attributes.width=W);X&&(U.attributes.height=X);}},param:function(U){U.children=[];U.isEmpty=true;return U;},a:function(U){if(!(U.children.length||U.attributes.name||U.attributes['data-cke-saved-name']))return false;},span:function(U){if(U.attributes['class']=='Apple-style-span')delete U.name;},pre:function(U){c&&q(U);},html:function(U){delete U.attributes.contenteditable;delete U.attributes['class'];},body:function(U){delete U.attributes.spellcheck;delete U.attributes.contenteditable;},style:function(U){var V=U.children[0];V&&V.value&&(V.value=e.trim(V.value));if(!U.attributes.type)U.attributes.type='text/css';},title:function(U){var V=U.children[0];V&&(V.value=U.attributes['data-cke-title']||'');}},attributes:{'class':function(U,V){return e.ltrim(U.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}}};if(c)z.attributes.style=function(U,V){return U.replace(/(^|;)([^\:]+)/g,function(W){return W.toLowerCase();});};function A(U){var V=U.attributes;if(V.contenteditable!='false')V['data-cke-editable']=V.contenteditable?'true':1;V.contenteditable='false';};function B(U){var V=U.attributes;switch(V['data-cke-editable']){case 'true':V.contenteditable='true';break;case '1':delete V.contenteditable;break;}};for(w in {input:1,textarea:1}){x.elements[w]=A;z.elements[w]=B;}var C=/<(a|area|img|input|source)\b([^>]*)>/gi,D=/\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,E=/(?:])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,F=/([^<]*)<\/cke:encoded>/gi,G=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,H=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,I=/]*?)\/?>(?!\s*<\/cke:\1)/gi;function J(U){return U.replace(C,function(V,W,X){return '<'+W+X.replace(D,function(Y,Z){if(!/^on/.test(Z)&&X.indexOf('data-cke-saved-'+Z)==-1)return ' data-cke-saved-'+Y+' data-cke-'+a.rnd+'-'+Y;return Y;})+'>';});};function K(U){return U.replace(E,function(V){return ''+encodeURIComponent(V)+'';});};function L(U){return U.replace(F,function(V,W){return decodeURIComponent(W); +});};function M(U){return U.replace(G,'$1cke:$2');};function N(U){return U.replace(H,'$1$2');};function O(U){return U.replace(I,'');};function P(U){return U.replace(/(]*>)(\r\n|\n)/g,'$1$2$2');};function Q(U){return U.replace(//g,function(V){return '';});};function R(U){return U.replace(//g,function(V,W){return decodeURIComponent(W);});};function S(U,V){var W=V._.dataStore;return U.replace(//g,function(X,Y){return decodeURIComponent(Y);}).replace(/\{cke_protected_(\d+)\}/g,function(X,Y){return W&&W[Y]||'';});};function T(U,V){var W=[],X=V.config.protectedSource,Y=V._.dataStore||(V._.dataStore={id:1}),Z=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,aa=[//gi,//gi].concat(X);U=U.replace(//g,function(ac){return '';});for(var ab=0;ab';});U=U.replace(Z,function(ac,ad,ae){return '';});return U.replace(/(['"]).*?\1/g,function(ac){return ac.replace(//g,function(ad,ae){Y[Y.id]=decodeURIComponent(ae);return '{cke_protected_'+Y.id++ +'}';});});};j.add('htmldataprocessor',{requires:['htmlwriter'],init:function(U){var V=U.dataProcessor=new a.htmlDataProcessor(U);V.writer.forceSimpleAmpersand=U.config.forceSimpleAmpersand;V.dataFilter.addRules(x);V.dataFilter.addRules(y);V.htmlFilter.addRules(z);var W={elements:{}};for(w in v)W.elements[w]=s(true,U.config.fillEmptyBlocks);V.htmlFilter.addRules(W);},onLoad:function(){!('fillEmptyBlocks' in i)&&(i.fillEmptyBlocks=1);}});a.htmlDataProcessor=function(U){var V=this;V.editor=U;V.writer=new a.htmlWriter();V.dataFilter=new a.htmlParser.filter();V.htmlFilter=new a.htmlParser.filter();};a.htmlDataProcessor.prototype={toHtml:function(U,V){U=T(U,this.editor);U=J(U);U=K(U);U=M(U);U=O(U);U=P(U);var W=new h('div');W.setHtml('a'+U);U=W.getHtml().substr(1);U=U.replace(new RegExp(' data-cke-'+a.rnd+'-','ig'),' ');U=N(U);U=L(U);U=R(U);var X=a.htmlParser.fragment.fromHtml(U,V),Y=new a.htmlParser.basicWriter();X.writeHtml(Y,this.dataFilter);U=Y.getHtml(true);U=Q(U); +return U;},toDataFormat:function(U,V){var W=this.writer,X=a.htmlParser.fragment.fromHtml(U,V);W.reset();X.writeHtml(W,this.htmlFilter);var Y=W.getHtml(true);Y=R(Y);Y=S(Y,this.editor);return Y;}};})();(function(){j.add('iframe',{requires:['dialog','fakeobjects'],init:function(m){var n='iframe',o=m.lang.iframe;a.dialog.add(n,this.path+'dialogs/iframe.js');m.addCommand(n,new a.dialogCommand(n));m.addCss('img.cke_iframe{background-image: url('+a.getUrl(this.path+'images/placeholder.png')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 80px;'+'height: 80px;'+'}');m.ui.addButton('Iframe',{label:o.toolbar,command:n});m.on('doubleclick',function(p){var q=p.data.element;if(q.is('img')&&q.data('cke-real-element-type')=='iframe')p.data.dialog='iframe';});if(m.addMenuItems)m.addMenuItems({iframe:{label:o.title,command:'iframe',group:'image'}});if(m.contextMenu)m.contextMenu.addListener(function(p,q){if(p&&p.is('img')&&p.data('cke-real-element-type')=='iframe')return{iframe:2};});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter;if(o)o.addRules({elements:{iframe:function(p){return m.createFakeParserElement(p,'cke_iframe','iframe',true);}}});}});})();(function(){j.add('image',{requires:['dialog'],init:function(o){var p='image';a.dialog.add(p,this.path+'dialogs/image.js');o.addCommand(p,new a.dialogCommand(p));o.ui.addButton('Image',{label:o.lang.common.image,command:p});o.on('doubleclick',function(q){var r=q.data.element;if(r.is('img')&&!r.data('cke-realelement')&&!r.isReadOnly())q.data.dialog='image';});if(o.addMenuItems)o.addMenuItems({image:{label:o.lang.image.menu,command:'image',group:'image'}});if(o.contextMenu)o.contextMenu.addListener(function(q,r){if(m(o,q))return{image:2};});},afterInit:function(o){p('left');p('right');p('center');p('block');function p(q){var r=o.getCommand('justify'+q);if(r){if(q=='left'||q=='right')r.on('exec',function(s){var t=m(o),u;if(t){u=n(t);if(u==q){t.removeStyle('float');if(q==n(t))t.removeAttribute('align');}else t.setStyle('float',q);s.cancel();}});r.on('refresh',function(s){var t=m(o),u;if(t){u=n(t);this.setState(u==q?1:q=='right'||q=='left'?2:0);s.cancel();}});}};}});function m(o,p){if(!p){var q=o.getSelection();p=q.getType()==3&&q.getSelectedElement();}if(p&&p.is('img')&&!p.data('cke-realelement')&&!p.isReadOnly())return p;};function n(o){var p=o.getStyle('float');if(p=='inherit'||p=='none')p=0;if(!p)p=o.getAttribute('align');return p;};})();i.image_removeLinkByEmptyURL=true; +(function(){var m={ol:1,ul:1},n=d.walker.whitespaces(true),o=d.walker.bookmark(false,true);function p(t){var B=this;if(t.editor.readOnly)return null;var u=t.editor,v=t.data.path,w=v&&v.contains(m),x=v.block||v.blockLimit;if(w)return B.setState(2);if(!B.useIndentClasses&&B.name=='indent')return B.setState(2);if(!x)return B.setState(0);if(B.useIndentClasses){var y=x.$.className.match(B.classNameRegex),z=0;if(y){y=y[1];z=B.indentClassMap[y];}if(B.name=='outdent'&&!z||B.name=='indent'&&z==u.config.indentClasses.length)return B.setState(0);return B.setState(2);}else{var A=parseInt(x.getStyle(r(x)),10);if(isNaN(A))A=0;if(A<=0)return B.setState(0);return B.setState(2);}};function q(t,u){var w=this;w.name=u;w.useIndentClasses=t.config.indentClasses&&t.config.indentClasses.length>0;if(w.useIndentClasses){w.classNameRegex=new RegExp('(?:^|\\s+)('+t.config.indentClasses.join('|')+')(?=$|\\s)');w.indentClassMap={};for(var v=0;v0){var Z=X[T].parent;X[T].parent=new h(Z.getName(),Z.getDocument());}}for(T=W.getCustomData('listarray_index')+1;TY;T++)X[T].indent+=U;var aa=j.list.arrayToList(X,v,null,t.config.enterMode,M.getDirection());if(u.name=='outdent'){var ab;if((ab=M.getParent())&&ab.is('li')){var ac=aa.listNode.getChildren(),ad=[],ae=ac.count(),af;for(T=ae-1;T>=0;T--){if((af=ac.getItem(T))&&af.is&&af.is('li'))ad.push(af);}}}if(aa)aa.listNode.replace(M);if(ad&&ad.length)for(T=0;T0)M.addClass(t.config.indentClasses[P-1]);}else{var Q=r(M,N),R=parseInt(M.getStyle(Q),10);if(isNaN(R))R=0;var S=t.config.indentOffset||40;R+=(u.name=='indent'?1:-1)*S;if(R<0)return false;R=Math.max(R,0);R=Math.ceil(R/S)*S;M.setStyle(Q,R?R+(t.config.indentUnit||'px'):'');if(M.getAttribute('style')==='')M.removeAttribute('style');}h.setMarker(v,M,'indent_processed',1);return true;};var z=t.getSelection(),A=z.createBookmarks(1),B=z&&z.getRanges(1),C,D=B.createIterator();while(C=D.getNextRange()){var E=C.getCommonAncestor(),F=E;while(F&&!(F.type==1&&m[F.getName()]))F=F.getParent();if(!F){var G=C.getEnclosedNode();if(G&&G.type==1&&G.getName() in m){C.setStartAt(G,1);C.setEndAt(G,2);F=G;}}if(F&&C.startContainer.type==1&&C.startContainer.getName() in m){var H=new d.walker(C);H.evaluator=s;C.startContainer=H.next();}if(F&&C.endContainer.type==1&&C.endContainer.getName() in m){H=new d.walker(C);H.evaluator=s;C.endContainer=H.previous();}if(F){var I=F.getFirst(s),J=!!I.getNext(s),K=C.startContainer,L=I.equals(K)||I.contains(K);if(!(L&&(u.name=='indent'||u.useIndentClasses||parseInt(F.getStyle(r(F)),10))&&y(F,!J&&I.getDirection())))w(F);}else x();}h.clearAllMarkers(v);t.forceNextSelectionCheck();z.selectBookmarks(A);}};j.add('indent',{init:function(t){var u=t.addCommand('indent',new q(t,'indent')),v=t.addCommand('outdent',new q(t,'outdent'));t.ui.addButton('Indent',{label:t.lang.indent,command:'indent'});t.ui.addButton('Outdent',{label:t.lang.outdent,command:'outdent'});t.on('selectionChange',e.bind(p,u));t.on('selectionChange',e.bind(p,v));if(b.ie6Compat||b.ie7Compat)t.addCss('ul,ol{\tmargin-left: 0px;\tpadding-left: 40px;}');t.on('dirChanged',function(w){var x=new d.range(t.document);x.setStartBefore(w.data.node);x.setEndAfter(w.data.node);var y=new d.walker(x),z;while(z=y.next()){if(z.type==1){if(!z.equals(w.data.node)&&z.getDirection()){x.setStartAfter(z);y=new d.walker(x);continue;}var A=t.config.indentClasses;if(A){var B=w.data.dir=='ltr'?['_rtl','']:['','_rtl']; +for(var C=0;C=0;z--){w=u[z].createIterator();w.enlargeBr=s!=2;while(x=w.getNextParagraph(s==1?'p':'div')){x.removeAttribute('align');x.removeStyle('text-align');var A=v&&(x.$.className=e.ltrim(x.$.className.replace(C.cssClassRegex,''))),B=C.state==2&&(!y||m(x,true)!=C.value);if(v){if(B)x.addClass(v);else if(!A)x.removeAttribute('class');}else if(B)x.setStyle('text-align',C.value);}}q.focus();q.forceNextSelectionCheck();r.selectBookmarks(t);},refresh:function(q){var r=q.block||q.blockLimit;this.setState(r.getName()!='body'&&m(r,this.editor.config.useComputedState)==this.value?1:2); +}};j.add('justify',{init:function(q){var r=new o(q,'justifyleft','left'),s=new o(q,'justifycenter','center'),t=new o(q,'justifyright','right'),u=new o(q,'justifyblock','justify');q.addCommand('justifyleft',r);q.addCommand('justifycenter',s);q.addCommand('justifyright',t);q.addCommand('justifyblock',u);q.ui.addButton('JustifyLeft',{label:q.lang.justify.left,command:'justifyleft'});q.ui.addButton('JustifyCenter',{label:q.lang.justify.center,command:'justifycenter'});q.ui.addButton('JustifyRight',{label:q.lang.justify.right,command:'justifyright'});q.ui.addButton('JustifyBlock',{label:q.lang.justify.block,command:'justifyblock'});q.on('selectionChange',e.bind(n,r));q.on('selectionChange',e.bind(n,t));q.on('selectionChange',e.bind(n,s));q.on('selectionChange',e.bind(n,u));q.on('dirChanged',p);},requires:['domiterator']});})();j.add('keystrokes',{beforeInit:function(m){m.keystrokeHandler=new a.keystrokeHandler(m);m.specialKeys={};},init:function(m){var n=m.config.keystrokes,o=m.config.blockedKeystrokes,p=m.keystrokeHandler.keystrokes,q=m.keystrokeHandler.blockedKeystrokes;for(var r=0;r7))Y.append(T.createText('\xa0'));Y.append(af.listNode);W=af.nextIndex;}else if(ac.indent==-1&&!P&&ad){if(m[ad.getName()]){Y=ac.element.clone(false,true);if(Z!=ad.getDirection(1))Y.setAttribute('dir',Z);}else Y=new d.documentFragment(T);var ag=ad.getDirection(1)!=Z,ah=ac.element,ai=ah.getAttribute('class'),aj=ah.getAttribute('style'),ak=Y.type==11&&(Q!=2||ag||aj||ai),al,am=ac.contents.length;for(S=0;SQ[S-1].indent+1){var W=Q[S-1].indent+1-Q[S].indent,X=Q[S].indent;while(Q[S]&&Q[S].indent>=X){Q[S].indent+=W;S++;}S--;}}var Y=j.list.arrayToList(Q,P,null,N.config.enterMode,O.root.getAttribute('dir')),Z=Y.listNode,aa,ab;function ac(ad){if((aa=Z[ad?'getFirst':'getLast']())&&!(aa.is&&aa.isBlockBoundary())&&(ab=O.root[ad?'getPrevious':'getNext'](d.walker.whitespaces(true)))&&!(ab.is&&ab.isBlockBoundary({br:1})))N.document.createElement('br')[ad?'insertBefore':'insertAfter'](aa); +};ac(true);ac();Z.replace(O.root);};function z(N,O){this.name=N;this.type=O;};var A=d.walker.nodeType(1);function B(N,O,P,Q){var R,S;while(R=N[Q?'getLast':'getFirst'](A)){if((S=R.getDirection(1))!==O.getDirection(1))R.setAttribute('dir',S);R.remove();P?R[Q?'insertBefore':'insertAfter'](P):O.append(R,Q);}};z.prototype={exec:function(N){var aq=this;var O=N.document,P=N.config,Q=N.getSelection(),R=Q&&Q.getRanges(true);if(!R||R.length<1)return;if(aq.state==2){var S=O.getBody();if(!S.getFirst(q)){P.enterMode==2?S.appendBogus():R[0].fixBlock(1,P.enterMode==1?'p':'div');Q.selectRanges(R);}else{var T=R.length==1&&R[0],U=T&&T.getEnclosedNode();if(U&&U.is&&aq.type==U.getName())aq.setState(1);}}var V=Q.createBookmarks(true),W=[],X={},Y=R.createIterator(),Z=0;while((T=Y.getNextRange())&&++Z){var aa=T.getBoundaryNodes(),ab=aa.startNode,ac=aa.endNode;if(ab.type==1&&ab.getName()=='td')T.setStartAt(aa.startNode,1);if(ac.type==1&&ac.getName()=='td')T.setEndAt(aa.endNode,2);var ad=T.createIterator(),ae;ad.forceBrBreak=aq.state==2;while(ae=ad.getNextParagraph()){if(ae.getCustomData('list_block'))continue;else h.setMarker(X,ae,'list_block',1);var af=new d.elementPath(ae),ag=af.elements,ah=ag.length,ai=null,aj=0,ak=af.blockLimit,al;for(var am=ah-1;am>=0&&(al=ag[am]);am--){if(m[al.getName()]&&ak.contains(al)){ak.removeCustomData('list_group_object_'+Z);var an=al.getCustomData('list_group_object');if(an)an.contents.push(ae);else{an={root:al,contents:[ae]};W.push(an);h.setMarker(X,al,'list_group_object',an);}aj=1;break;}}if(aj)continue;var ao=ak;if(ao.getCustomData('list_group_object_'+Z))ao.getCustomData('list_group_object_'+Z).contents.push(ae);else{an={root:ao,contents:[ae]};h.setMarker(X,ao,'list_group_object_'+Z,an);W.push(an);}}}var ap=[];while(W.length>0){an=W.shift();if(aq.state==2){if(m[an.root.getName()])v.call(aq,N,an,X,ap);else x.call(aq,N,an,ap);}else if(aq.state==1&&m[an.root.getName()])y.call(aq,N,an,X);}for(am=0;am0)for(var u=t.length-1;u>=0;u--){var v=t[u][0],w=t[u][1];if(w)v.insertBefore(w);else v.appendTo(s);}};function o(s,t){var u=m(s),v={},w=s.$;if(!t){v['class']=w.className||'';w.className='';}v.inline=w.style.cssText||'';if(!t)w.style.cssText='position: static; overflow: visible';n(u);return v;};function p(s,t){var u=m(s),v=s.$;if('class' in t)v.className=t['class'];if('inline' in t)v.style.cssText=t.inline;n(u);};function q(s){var t=a.instances;for(var u in t){var v=t[u];if(v.mode=='wysiwyg'&&!v.readOnly){var w=v.document.getBody();w.setAttribute('contentEditable',false);w.setAttribute('contentEditable',true);}}if(s.focusManager.hasFocus){s.toolbox.focus();s.focus();}};function r(s){if(!c||b.version>6)return null;var t=h.createFromHtml('');return s.append(t,true);};j.add('maximize',{init:function(s){var t=s.lang,u=a.document,v=u.getWindow(),w,x,y,z;function A(){var C=v.getViewPaneSize();z&&z.setStyles({width:C.width+'px',height:C.height+'px'});s.resize(C.width,C.height,null,true);};var B=2;s.addCommand('maximize',{modes:{wysiwyg:!b.iOS,source:!b.iOS},readOnly:1,editorFocus:false,exec:function(){var C=s.container.getChild(1),D=s.getThemeSpace('contents');if(s.mode=='wysiwyg'){var E=s.getSelection();w=E&&E.getRanges();x=v.getScrollPosition();}else{var F=s.textarea.$;w=!c&&[F.selectionStart,F.selectionEnd];x=[F.scrollLeft,F.scrollTop];}if(this.state==2){v.on('resize',A);y=v.getScrollPosition();var G=s.container;while(G=G.getParent()){G.setCustomData('maximize_saved_styles',o(G));G.setStyle('z-index',s.config.baseFloatZIndex-1);}D.setCustomData('maximize_saved_styles',o(D,true));C.setCustomData('maximize_saved_styles',o(C,true));var H={overflow:b.webkit?'':'hidden',width:0,height:0};u.getDocumentElement().setStyles(H);!b.gecko&&u.getDocumentElement().setStyle('position','fixed');!(b.gecko&&b.quirks)&&u.getBody().setStyles(H);c?setTimeout(function(){v.$.scrollTo(0,0);},0):v.$.scrollTo(0,0);C.setStyle('position',b.gecko&&b.quirks?'fixed':'absolute');C.$.offsetLeft;C.setStyles({'z-index':s.config.baseFloatZIndex-1,left:'0px',top:'0px'});z=r(C);C.addClass('cke_maximized');A();var I=C.getDocumentPosition();C.setStyles({left:-1*I.x+'px',top:-1*I.y+'px'}); +b.gecko&&q(s);}else if(this.state==1){v.removeListener('resize',A);var J=[D,C];for(var K=0;K ');s.children.length=0;s.add(u);var v=s.attributes;delete v['aria-label'];delete v.contenteditable;delete v.title;}return t;}}},5);if(p)p.addRules({elements:{div:function(r){var s=r.attributes,t=s&&s.style,u=t&&r.children.length==1&&r.children[0],v=u&&u.name=='span'&&u.attributes.style;if(v&&/page-break-after\s*:\s*always/i.test(t)&&/display\s*:\s*none/i.test(v)){s.contenteditable='false';s['class']='cke_pagebreak';s['data-cke-display-name']='pagebreak';s['aria-label']=n;s.title=n;r.children.length=0;}}}});},requires:['fakeobjects']});j.pagebreakCmd={exec:function(m){var n=m.lang.pagebreakAlt,o=h.createFromHtml('
    '+'
    ',m.document),p=m.getSelection().getRanges(true);m.fire('saveSnapshot');for(var q,r=p.length-1;r>=0;r--){q=p[r];if(r1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.width*parseInt(n,10)/100,10);if(typeof o=='string'&&o.length>1&&o.substr(o.length-1,1)=='%')o=parseInt(window.screen.height*parseInt(o,10)/100,10);if(n<640)n=640;if(o<420)o=420;var q=parseInt((window.screen.height-o)/2,10),r=parseInt((window.screen.width-n)/2,10);p=(p||'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes')+',width='+n+',height='+o+',top='+q+',left='+r;var s=window.open('',null,p,true);if(!s)return false;try{var t=navigator.userAgent.toLowerCase();if(t.indexOf(' chrome/')==-1){s.moveTo(r,q);s.resizeTo(n,o);}s.focus();s.location.href=m;}catch(u){s=window.open(m,null,p,true);}return true;}});(function(){var m,n={modes:{wysiwyg:1,source:1},canUndo:false,readOnly:1,exec:function(p){var q,r=p.config,s=r.baseHref?'':'',t=b.isCustomDomain();if(r.fullPage)q=p.getData().replace(//,'$&'+s).replace(/[^>]*(?=<\/title>)/,'$& — '+p.lang.preview);else{var u=''+''+s+''+p.lang.preview+''+e.buildStyleHtml(p.config.contentsCss)+''+u+p.getData()+'';}var w=640,x=420,y=80;try{var z=window.screen;w=Math.round(z.width*0.8);x=Math.round(z.height*0.7);y=Math.round(z.width*0.1);}catch(D){}var A='';if(t){window._cke_htmlToLoad=q;A='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )'; +}if(b.gecko){window._cke_htmlToLoad=q;A=m+'preview.html';}var B=window.open(A,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+w+',height='+x+',left='+y);if(!t&&!b.gecko){var C=B.document;C.open();C.write(q);C.close();b.webkit&&setTimeout(function(){C.body.innerHTML+='';},0);}}},o='preview';j.add(o,{init:function(p){m=this.path;p.addCommand(o,n);p.ui.addButton('Preview',{label:p.lang.preview,command:o});}});})();j.add('print',{init:function(m){var n='print',o=m.addCommand(n,j.print);m.ui.addButton('Print',{label:m.lang.print,command:n});}});j.print={exec:function(m){if(b.opera)return;else if(b.gecko)m.window.$.print();else m.document.$.execCommand('Print');},canUndo:false,readOnly:1,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(m){m.addCommand('removeFormat',j.removeformat.commands.removeformat);m.ui.addButton('RemoveFormat',{label:m.lang.removeFormat,command:'removeFormat'});m._.removeFormat={filters:[]};}});j.removeformat={commands:{removeformat:{exec:function(m){var n=m._.removeFormatRegex||(m._.removeFormatRegex=new RegExp('^(?:'+m.config.removeFormatTags.replace(/,/g,'|')+')$','i')),o=m._.removeAttributes||(m._.removeAttributes=m.config.removeFormatAttributes.split(',')),p=j.removeformat.filter,q=m.getSelection().getRanges(1),r=q.createIterator(),s;while(s=r.getNextRange()){if(!s.collapsed)s.enlarge(1);var t=s.createBookmark(),u=t.startNode,v=t.endNode,w,x=function(z){var A=new d.elementPath(z),B=A.elements;for(var C=1,D;D=B[C];C++){if(D.equals(A.block)||D.equals(A.blockLimit))break;if(n.test(D.getName())&&p(m,D))z.breakParent(D);}};x(u);if(v){x(v);w=u.getNextSourceNode(true,1);while(w){if(w.equals(v))break;var y=w.getNextSourceNode(false,1);if(!(w.getName()=='img'&&w.data('cke-realelement'))&&p(m,w))if(n.test(w.getName()))w.remove(1);else{w.removeAttributes(o);m.fire('removeFormatCleanup',w);}w=y;}}s.moveToBookmark(t);}m.getSelection().selectRanges(q);}}},filter:function(m,n){var o=m._.removeFormat.filters;for(var p=0;pr.width&&(n.resize_minWidth=r.width);n.resize_minHeight>r.height&&(n.resize_minHeight=r.height);a.document.on('mousemove',u);a.document.on('mouseup',v);if(m.document){m.document.on('mousemove',u);m.document.on('mouseup',v);}});m.on('destroy',function(){e.removeFunction(w);});m.on('themeSpace',function(x){if(x.data.space=='bottom'){var y='';if(s&&!t)y=' cke_resizer_horizontal';if(!s&&t)y=' cke_resizer_vertical';var z='
    ';o=='ltr'&&y=='ltr'?x.data.html+=z:x.data.html=z+x.data.html;}},m,null,100);}}});(function(){var m={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(o){var p=o.element.$.form;if(p)try{p.submit();}catch(q){if(p.submit.click)p.submit.click();}}},n='save';j.add(n,{init:function(o){var p=o.addCommand(n,m);p.modes={wysiwyg:!!o.element.$.form};o.ui.addButton('Save',{label:o.lang.save,command:n});}});})();(function(){var m='scaytcheck',n='';function o(t,u){var v=0,w;for(w in u){if(u[w]==t){v=1;break;}}return v;};var p=function(){var t=this,u=function(){if(q.instances[t.name])q.instances[t.name].destroy();var y=t.config,z={};z.srcNodeRef=t.document.getWindow().$.frameElement;z.assocApp='CKEDITOR.'+a.version+'@'+a.revision;z.customerid=y.scayt_customerid||'1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';z.customDictionaryIds=y.scayt_customDictionaryIds||'';z.userDictionaryName=y.scayt_userDictionaryName||''; +z.sLang=y.scayt_sLang||'en_US';z.onLoad=function(){if(!(c&&b.version<8))this.addStyle(this.selectorCss(),'padding-bottom: 2px !important;');if(t.focusManager.hasFocus&&!q.isControlRestored(t))this.focus();};z.onBeforeChange=function(){if(q.getScayt(t)&&!t.checkDirty())setTimeout(function(){t.resetDirty();},0);};var A=window.scayt_custom_params;if(typeof A=='object')for(var B in A)z[B]=A[B];if(q.getControlId(t))z.id=q.getControlId(t);var C=new window.scayt(z);C.afterMarkupRemove.push(function(E){new h(E,C.document).mergeSiblings();});var D=q.instances[t.name];if(D){C.sLang=D.sLang;C.option(D.option());C.paused=D.paused;}q.instances[t.name]=C;try{C.setDisabled(q.isPaused(t)===false);}catch(E){}t.fire('showScaytState');};t.on('contentDom',function(y){u();});t.on('contentDomUnload',function(){var y=a.document.getElementsByTag('script'),z=/^dojoIoScript(\d+)$/i,A=/^https?:\/\/svc\.webspellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var B=0;B=0){this.setState(0);q.loadEngine(t);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(t){var u=t.config.scayt_contextMenuItemsOrder||'suggest|moresuggest|control',v='';u=u.split('|');if(u&&u.length)for(var w=0;w tr > td, .%1 table.%2 > tr > th,','.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,','.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,','.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th','{','border : #d3d3d3 1px dotted','}']).join('');n=o.replace(/%2/g,m).replace(/%1/g,'cke_show_borders ');var p={preserveState:true,editorFocus:false,readOnly:1,exec:function(q){this.toggleState();this.refresh(q);},refresh:function(q){if(q.document){var r=this.state==1?'addClass':'removeClass';q.document.getBody()[r]('cke_show_borders');}}};j.add('showborders',{requires:['wysiwygarea'],modes:{wysiwyg:1},init:function(q){var r=q.addCommand('showborders',p);r.canUndo=false;if(q.config.startupShowBorders!==false)r.setState(1);q.addCss(n);q.on('mode',function(){if(r.state!=0)r.refresh(q);},null,null,100);q.on('contentDom',function(){if(r.state!=0)r.refresh(q);});q.on('removeFormatCleanup',function(s){var t=s.data;if(q.getCommand('showborders').state==1&&t.is('table')&&(!t.hasAttribute('border')||parseInt(t.getAttribute('border'),10)<=0))t.addClass(m);});},afterInit:function(q){var r=q.dataProcessor,s=r&&r.dataFilter,t=r&&r.htmlFilter; +if(s)s.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'],x=parseInt(v.border,10);if((!x||x<=0)&&(!w||w.indexOf(m)==-1))v['class']=(w||'')+' '+m;}}});if(t)t.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'];w&&(v['class']=w.replace(m,'').replace(/\s{2}/,' ').replace(/^\s+|\s+$/,''));}}});}});a.on('dialogDefinition',function(q){var r=q.data.name;if(r=='table'||r=='tableProperties'){var s=q.data.definition,t=s.getContents('info'),u=t.get('txtBorder'),v=u.commit;u.commit=e.override(v,function(y){return function(z,A){y.apply(this,arguments);var B=parseInt(this.getValue(),10);A[!B||B<=0?'addClass':'removeClass'](m);};});var w=s.getContents('advanced'),x=w&&w.get('advCSSClasses');if(x){x.setup=e.override(x.setup,function(y){return function(){y.apply(this,arguments);this.setValue(this.getValue().replace(/cke_show_border/,''));};});x.commit=e.override(x.commit,function(y){return function(z,A){y.apply(this,arguments);if(!parseInt(A.getAttribute('border'),10))A.addClass('cke_show_border');};});}}});})();j.add('sourcearea',{requires:['editingblock'],init:function(m){var n=j.sourcearea,o=a.document.getWindow();m.on('editingBlockReady',function(){var p,q;m.addMode('source',{load:function(r,s){if(c&&b.version<8)r.setStyle('position','relative');m.textarea=p=new h('textarea');p.setAttributes({dir:'ltr',tabIndex:b.webkit?-1:m.tabIndex,role:'textbox','aria-label':m.lang.editorTitle.replace('%1',m.name)});p.addClass('cke_source');p.addClass('cke_enable_context_menu');m.readOnly&&p.setAttribute('readOnly','readonly');var t={width:b.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'};if(c){q=function(){p.hide();p.setStyle('height',r.$.clientHeight+'px');p.setStyle('width',r.$.clientWidth+'px');p.show();};m.on('resize',q);o.on('resize',q);setTimeout(q,0);}r.setHtml('');r.append(p);p.setStyles(t);m.fire('ariaWidget',p);p.on('blur',function(){m.focusManager.blur();});p.on('focus',function(){m.focusManager.focus();});m.mayBeDirty=true;this.loadData(s);var u=m.keystrokeHandler;if(u)u.attach(p);setTimeout(function(){m.mode='source';m.fire('mode',{previousMode:m._.previousMode});},b.gecko||b.webkit?100:0);},loadData:function(r){p.setValue(r);m.fire('dataReady');},getData:function(){return p.getValue();},getSnapshotData:function(){return p.getValue();},unload:function(r){p.clearCustomData();m.textarea=p=null;if(q){m.removeListener('resize',q);o.removeListener('resize',q);}if(c&&b.version<8)r.removeStyle('position'); +},focus:function(){p.focus();}});});m.on('readOnly',function(){if(m.mode=='source')if(m.readOnly)m.textarea.setAttribute('readOnly','readonly');else m.textarea.removeAttribute('readOnly');});m.addCommand('source',n.commands.source);if(m.ui.addButton)m.ui.addButton('Source',{label:m.lang.source,command:'source'});m.on('mode',function(){m.getCommand('source').setState(m.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:false,readOnly:1,exec:function(m){if(m.mode=='wysiwyg')m.fire('saveSnapshot');m.getCommand('source').setState(0);m.setMode(m.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(n){var o=n.config,p=n.lang.stylesCombo,q={},r=[],s;function t(u){n.getStylesSet(function(v){if(!r.length){var w,x;for(var y=0,z=v.length;y0)return;if(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true);I.push(S);}};for(var L=0;L1&&V&&U[Y]==V[Y]){Z=U[Y];Z.rowSpan+=1;}else{Z=new h(U[Y]).clone();Z.removeAttribute('rowSpan');!c&&Z.appendBogus();X.append(Z);Z=Z.$;}Y+=Z.colSpan-1;}H?X.insertBefore(S):X.insertAfter(S);};function q(G){if(G instanceof d.selection){var H=n(G),I=H[0],J=I.getAscendant('table'),K=e.buildTableMap(J),L=H[0].getParent(),M=L.$.rowIndex,N=H[H.length-1],O=N.getParent().$.rowIndex+N.$.rowSpan-1,P=[]; +for(var Q=M;Q<=O;Q++){var R=K[Q],S=new h(J.$.rows[Q]);for(var T=0;T0?X[M-1]:null)||J.$.parentNode);for(Q=P.length;Q>=0;Q--)q(P[Q]);return Y;}else if(G instanceof h){J=G.getAscendant('table');if(J.$.rows.length==1)J.remove();else G.remove();}return null;};function r(G,H){var I=G.getParent(),J=I.$.cells,K=0;for(var L=0;LI)I=K;}return I;};function t(G,H){var I=n(G),J=I[0],K=J.getAscendant('table'),L=s(I,1),M=s(I),N=H?L:M,O=e.buildTableMap(K),P=[],Q=[],R=O.length;for(var S=0;S1&&Q[S]==P[S]){U=P[S];U.colSpan+=1;}else{U=new h(P[S]).clone();U.removeAttribute('colSpan');!c&&U.appendBogus();U[H?'insertBefore':'insertAfter'].call(U,new h(P[S]));U=U.$;}S+=U.rowSpan-1;}};function u(G){var H=n(G),I=H[0],J=H[H.length-1],K=I.getAscendant('table'),L=e.buildTableMap(K),M,N,O=[];for(var P=0,Q=L.length;P1){L=H[J-1]+1;break;}}if(!L)L=H[0]>0?H[0]-1:H[H.length-1]+1;var N=I.$.rows;for(J=0,K=N.length;J=0;K--)x(H[K]);if(J)z(J,true);else if(I)I.remove();}else if(G instanceof h){var L=G.getParent();if(L.getChildCount()==1)L.remove(); +else G.remove();}};function y(G){var H=G.getBogus();H&&H.remove();G.trim();};function z(G,H){var I=new d.range(G.getDocument());if(!I['moveToElementEdit'+(H?'End':'Start')](G)){I.selectNodeContents(G);I.collapse(H?false:true);}I.select(true);};function A(G,H,I){var J=G[H];if(typeof I=='undefined')return J;for(var K=0;J&&K1)J+=K[H].rowSpan-1;}return I;};function C(G,H,I){var J=n(G),K;if((H?J.length!=1:J.length<2)||(K=G.getCommonAncestor())&&K.type==1&&K.is('table'))return false;var L,M=J[0],N=M.getAscendant('table'),O=e.buildTableMap(N),P=O.length,Q=O[0].length,R=M.getParent().$.rowIndex,S=A(O,R,M);if(H){var T;try{var U=parseInt(M.getAttribute('rowspan'),10)||1,V=parseInt(M.getAttribute('colspan'),10)||1;T=O[H=='up'?R-U:H=='down'?R+U:R][H=='left'?S-V:H=='right'?S+V:S];}catch(an){return false;}if(!T||M.$==T)return false;J[H=='up'||H=='left'?'unshift':'push'](new h(T));}var W=M.getDocument(),X=R,Y=0,Z=0,aa=!I&&new d.documentFragment(W),ab=0;for(var ac=0;ac=Q)M.removeAttribute('rowSpan');else M.$.rowSpan=Y;if(Y>=P)M.removeAttribute('colSpan');else M.$.colSpan=Z;var ak=new d.nodeList(N.$.rows),al=ak.count();for(ac=al-1;ac>=0;ac--){var am=ak.getItem(ac);if(!am.$.cells.length){am.remove();al++;continue;}}return M;}else return Y*Z==ab;};function D(G,H){var I=n(G);if(I.length>1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.rowSpan,Q,R,S,T;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);T=N+R;var U=new h(L.$.rows[T]),V=A(M,T),W;Q=J.clone();for(var X=0;XO){Q.insertBefore(new h(W));break;}else W=null;}if(!W)U.append(Q,true);}else{S=R=1;U=K.clone();U.insertAfter(K);U.append(Q=J.clone());var Y=A(M,N);for(var Z=0;Z1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.colSpan,Q,R,S;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);}else{S=R=1;var T=B(M,O);for(var U=0;U0?2:0}; +}},tablecell_insertBefore:{label:H.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:H.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:H.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:H.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:H.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:H.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:H.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:H.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:H.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:H.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:H.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:H.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:H.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:H.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2};}},tablecolumn_insertBefore:{label:H.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:H.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:H.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(G.contextMenu)G.contextMenu.addListener(function(I,J){if(!I||I.isReadOnly())return null;while(I){if(I.getName() in F)return{tablecell:2,tablerow:2,tablecolumn:2};I=I.getParent();}return null;});},getSelectedCells:n};j.add('tabletools',j.tabletools);})();e.buildTableMap=function(m){var n=m.$.rows,o=-1,p=[];for(var q=0;qp&&(!s||!t||vt){s=v;t=u;}}else{if(q&&u==p){s=v;break;}if(ut)){s=v;t=u;}}}if(s)s.focus();};(function(){j.add('templates',{requires:['dialog'],init:function(o){a.dialog.add('templates',a.getUrl(this.path+'dialogs/templates.js'));o.addCommand('templates',new a.dialogCommand('templates')); +o.ui.addButton('Templates',{label:o.lang.templates.button,command:'templates'});}});var m={},n={};a.addTemplates=function(o,p){m[o]=p;};a.getTemplates=function(o){return m[o];};a.loadTemplates=function(o,p){var q=[];for(var r=0,s=o.length;r':' style="display:none">');t.push('',o.lang.toolbars,'');var w=o.toolbox.toolbars,x=o.config.toolbar instanceof Array?o.config.toolbar:o.config['toolbar_'+o.config.toolbar];for(var y=0;y');v=0;}if(C==='/'){t.push('
    ');continue;}D=C.items||C;for(var E=0;E');B&&t.push('',B,'');t.push('');var I=w.push(A)-1;if(I>0){A.previous=w[I-1];A.previous.next=A;}}if(H){if(!v){t.push('');v=1;}}else if(v){t.push('');v=0;}var J=F.render(o,t);I=A.items.push(J)-1;if(I>0){J.previous=A.items[I-1];J.previous.next=J;}J.toolbar=A;J.onkey=q;J.onfocus=function(){if(!o.toolbox.focusCommandExecuted)o.focus();};}}if(v){t.push('');v=0;}if(A)t.push('');}t.push('');if(o.config.toolbarCanCollapse){var K=e.addFunction(function(){o.execCommand('toolbarCollapse');});o.on('destroy',function(){e.removeFunction(K);});var L=e.getNextId();o.addCommand('toolbarCollapse',{readOnly:1,exec:function(M){var N=a.document.getById(L),O=N.getPrevious(),P=M.getThemeSpace('contents'),Q=O.getParent(),R=parseInt(P.$.style.height,10),S=Q.$.offsetHeight,T=!O.isVisible();if(!T){O.hide();N.addClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarExpand);}else{O.show();N.removeClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarCollapse);}N.getFirst().setText(T?'▲':'◀');var U=Q.$.offsetHeight-S;P.setStyle('height',R-U+'px');M.fire('resize');},modes:{wysiwyg:1,source:1}});t.push('','','');}r.data.html+=t.join('');}});o.on('destroy',function(){var r,s=0,t,u,v;r=this.toolbox.toolbars;for(;s');return{};}};}});}});})();a.UI_SEPARATOR='separator';i.toolbarLocation='top';i.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];i.toolbar_Full=[{name:'document',items:['Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates']},{name:'clipboard',items:['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']},{name:'editing',items:['Find','Replace','-','SelectAll','-','SpellChecker','Scayt']},{name:'forms',items:['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField']},'/',{name:'basicstyles',items:['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']},{name:'paragraph',items:['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl']},{name:'links',items:['Link','Unlink','Anchor']},{name:'insert',items:['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe']},'/',{name:'styles',items:['Styles','Format','Font','FontSize']},{name:'colors',items:['TextColor','BGColor']},{name:'tools',items:['Maximize','ShowBlocks','-','About']}]; +i.toolbar='Full';i.toolbarCanCollapse=true;(function(){j.add('undo',{requires:['selection','wysiwygarea'],init:function(s){var t=new o(s),u=s.addCommand('undo',{exec:function(){if(t.undo()){s.selectionChange();this.fire('afterUndo');}},state:0,canUndo:false}),v=s.addCommand('redo',{exec:function(){if(t.redo()){s.selectionChange();this.fire('afterRedo');}},state:0,canUndo:false});t.onChange=function(){u.setState(t.undoable()?2:0);v.setState(t.redoable()?2:0);};function w(x){if(t.enabled&&x.data.command.canUndo!==false)t.save();};s.on('beforeCommandExec',w);s.on('afterCommandExec',w);s.on('saveSnapshot',function(x){t.save(x.data&&x.data.contentOnly);});s.on('contentDom',function(){s.document.on('keydown',function(x){if(!x.data.$.ctrlKey&&!x.data.$.metaKey)t.type(x);});});s.on('beforeModeUnload',function(){s.mode=='wysiwyg'&&t.save(true);});s.on('mode',function(){t.enabled=s.readOnly?false:s.mode=='wysiwyg';t.onChange();});s.ui.addButton('Undo',{label:s.lang.undo,command:'undo'});s.ui.addButton('Redo',{label:s.lang.redo,command:'redo'});s.resetUndo=function(){t.reset();s.fire('saveSnapshot');};s.on('updateSnapshot',function(){if(t.currentImage)t.update();});}});j.undo={};var m=j.undo.Image=function(s){this.editor=s;s.fire('beforeUndoImage');var t=s.getSnapshot(),u=t&&s.getSelection();c&&t&&(t=t.replace(/\s+data-cke-expando=".*?"/g,''));this.contents=t;this.bookmarks=u&&u.createBookmarks2(true);s.fire('afterUndoImage');},n=/\b(?:href|src|name)="[^"]*?"/gi;m.prototype={equals:function(s,t){var u=this.contents,v=s.contents;if(c&&(b.ie7Compat||b.ie6Compat)){u=u.replace(n,'');v=v.replace(n,'');}if(u!=v)return false;if(t)return true;var w=this.bookmarks,x=s.bookmarks;if(w||x){if(!w||!x||w.length!=x.length)return false;for(var y=0;y25){this.save(false,null,false);this.modifiersCount=1;}}else if(!y){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1;}}},reset:function(){var s=this;s.lastKeystroke=0;s.snapshots=[];s.index=-1;s.limit=s.editor.config.undoStackSize||20;s.currentImage=null;s.hasUndo=false;s.hasRedo=false;s.resetType();},resetType:function(){var s=this;s.typing=false;delete s.lastKeystroke;s.typesCount=0;s.modifiersCount=0;},fireChange:function(){var s=this;s.hasUndo=!!s.getNextImage(true);s.hasRedo=!!s.getNextImage(false);s.resetType();s.onChange();},save:function(s,t,u){var w=this;var v=w.snapshots;if(!t)t=new m(w.editor);if(t.contents===false)return false;if(w.currentImage&&t.equals(w.currentImage,s))return false;v.splice(w.index+1,v.length-w.index-1);if(v.length==w.limit)v.shift();w.index=v.push(t)-1;w.currentImage=t;if(u!==false)w.fireChange();return true;},restoreImage:function(s){var w=this;var t=w.editor,u;if(s.bookmarks){t.focus();u=t.getSelection();}w.editor.loadSnapshot(s.contents);if(s.bookmarks)u.selectBookmarks(s.bookmarks);else if(c){var v=w.editor.document.getBody().$.createTextRange();v.collapse(true);v.select();}w.index=s.index;w.update();w.fireChange();},getNextImage:function(s){var x=this;var t=x.snapshots,u=x.currentImage,v,w;if(u)if(s)for(w=x.index-1;w>=0;w--){v=t[w];if(!u.equals(v,true)){v.index=w;return v;}}else for(w=x.index+1;w]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,n=d.walker.whitespaces(true),o=d.walker.bogus(true),p=function(E){return n(E)&&o(E);};function q(E){return E.isBlockBoundary()&&f.$empty[E.getName()];};function r(E){return function(F){if(this.mode=='wysiwyg'){this.focus(); +var G=this.getSelection(),H=G.isLocked;H&&G.unlock();this.fire('saveSnapshot');E.call(this,F.data);H&&this.getSelection().lock();var I=this;setTimeout(function(){try{I.fire('saveSnapshot');}catch(J){setTimeout(function(){I.fire('saveSnapshot');},200);}},0);}};};function s(E){var N=this;if(N.dataProcessor)E=N.dataProcessor.toHtml(E);if(!E)return;var F=N.getSelection(),G=F.getRanges()[0];if(G.checkReadOnly())return;if(b.opera){var H=new d.elementPath(G.startContainer);if(H.block){var I=a.htmlParser.fragment.fromHtml(E,false).children;for(var J=0,K=I.length;J'+Q+'';});I=I.replace(/\n/g,'
    ');if(!(H||c))I=I.replace(new RegExp('
    (?=)'),function(O){return e.repeat(O,2);});if(b.gecko||b.webkit){var K=new d.elementPath(F.getStartElement()),L=[];for(var M=0;M/));else if(N in f.$block)break;}I=L.join('')+I;}s.call(this,I);};function u(E){var F=this.getSelection(),G=F.getRanges(),H=E.getName(),I=f.$block[H],J=F.isLocked;if(J)F.unlock();var K,L,M,N;for(var O=G.length-1;O>=0;O--){K=G[O];if(!K.checkReadOnly()){K.deleteContents(1);L=!O&&E||E.clone(1);var P,Q;if(I)while((P=K.getCommonAncestor(0,1))&&(Q=f[P.getName()])&&!(Q&&Q[H])){if(P.getName() in f.span)K.splitElement(P);else if(K.checkStartOfBlock()&&K.checkEndOfBlock()){K.setStartBefore(P);K.collapse(true);P.remove();}else K.splitBlock();}K.insertNode(L); +if(!M)M=L;}}if(M){K.moveToPosition(M,4);if(I){var R=M.getNext(p),S=R&&R.type==1&&R.getName();if(S&&f.$block[S]){if(f[S]['#'])K.moveToElementEditStart(R);else K.moveToElementEditEnd(M);}else if(!R){R=K.fixBlock(true,this.config.enterMode==3?'div':'p');K.moveToElementEditStart(R);}}}F.selectRanges([K]);if(J)this.getSelection().lock();};function v(E){if(!E.checkDirty())setTimeout(function(){E.resetDirty();},0);};var w=d.walker.whitespaces(true),x=d.walker.bookmark(false,true);function y(E){return w(E)&&x(E);};function z(E){return E.type==3&&e.trim(E.getText()).match(/^(?: |\xa0)$/);};function A(E){if(E.isLocked){E.unlock();setTimeout(function(){E.lock();},0);}};function B(E){return E.getOuterHtml().match(m);};w=d.walker.whitespaces(true);function C(E){var F=E.window,G=E.document,H=E.document.getBody(),I=H.getFirst(),J=H.getChildren().count();if(!J||J==1&&I.type==1&&I.hasAttribute('_moz_editor_bogus_node')){v(E);var K=E.element.getDocument(),L=K.getDocumentElement(),M=L.$.scrollTop,N=L.$.scrollLeft,O=G.$.createEvent('KeyEvents');O.initKeyEvent('keypress',true,true,F.$,false,false,false,false,0,32);G.$.dispatchEvent(O);if(M!=L.$.scrollTop||N!=L.$.scrollLeft)K.getWindow().$.scrollTo(N,M);J&&H.getFirst().remove();G.getBody().appendBogus();var P=new d.range(G);P.setStartAt(H,1);P.select();}};function D(E){var F=E.editor,G=E.data.path,H=G.blockLimit,I=E.data.selection,J=I.getRanges()[0],K=F.document.getBody(),L=F.config.enterMode;if(b.gecko){var M=G.block||G.blockLimit,N=M&&M.getLast(y);if(M&&M.isBlockBoundary()&&!(N&&N.type==1&&N.isBlockBoundary())&&!M.is('pre')&&!M.getBogus())M.appendBogus();}if(F.config.autoParagraph!==false&&L!=2&&J.collapsed&&H.getName()=='body'&&!G.block){var O=J.fixBlock(true,F.config.enterMode==3?'div':'p');if(c){var P=O.getFirst(y);P&&z(P)&&P.remove();}if(B(O)){var Q=O.getNext(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditStart(Q);O.remove();}else{Q=O.getPrevious(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditEnd(Q);O.remove();}}}J.select();E.cancel();}var R=new d.range(F.document);R.moveToElementEditEnd(F.document.getBody());var S=new d.elementPath(R.startContainer);if(!S.blockLimit.is('body')){var T;if(L!=2)T=K.append(F.document.createElement(L==1?'p':'div'));else T=K;if(!c)T.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(E){var F=E.config.enterMode!=2&&E.config.autoParagraph!==false?E.config.enterMode==3?'div':'p':false,G=E.lang.editorTitle.replace('%1',E.name),H=E.lang.editorHelp;if(c)G+=', '+H;var I=a.document.getWindow(),J; +E.on('editingBlockReady',function(){var M,N,O,P,Q,R,S,T=b.isCustomDomain(),U=function(X){if(N)N.remove();var Y='document.open();'+(T?'document.domain="'+document.domain+'";':'')+'document.close();';Y=b.air?'javascript:void(0)':c?'javascript:void(function(){'+encodeURIComponent(Y)+'}())':'';var Z=e.getNextId();N=h.createFromHtml('');if(document.location.protocol=='chrome:')a.event.useCapture=true;N.on('load',function(aa){Q=1;aa.removeListener();var ab=N.getFrameDocument();ab.write(X);b.air&&W(ab.getWindow().$);});if(document.location.protocol=='chrome:')a.event.useCapture=false;M.append(h.createFromHtml(''+H+''));M.append(N);if(b.webkit){S=function(){M.setStyle('width','100%');N.hide();N.setSize('width',M.getSize('width'));M.removeStyle('width');N.show();};I.on('resize',S);}};J=e.addFunction(W);var V='';function W(X){if(!Q)return;Q=0;E.fire('ariaWidget',N);var Y=X.document,Z=Y.body,aa=Y.getElementById('cke_actscrpt');aa&&aa.parentNode.removeChild(aa);Z.spellcheck=!E.config.disableNativeSpellChecker;var ab=!E.readOnly;if(c){Z.hideFocus=true;Z.disabled=true;Z.contentEditable=ab;Z.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)Y.$.body.contentEditable=ab;else if(b.webkit)Y.$.body.parentNode.contentEditable=ab;else Y.$.designMode=ab?'off':'on';},0);ab&&b.gecko&&e.setTimeout(C,0,null,E);X=E.window=new d.window(X);Y=E.document=new g(Y);ab&&Y.on('dblclick',function(ag){var ah=ag.data.getTarget(),ai={element:ah,dialog:''};E.fire('doubleclick',ai);ai.dialog&&E.openDialog(ai.dialog);});c&&Y.on('click',function(ag){var ah=ag.data.getTarget();if(ah.is('input')){var ai=ah.getAttribute('type');if(ai=='submit'||ai=='reset')ag.data.preventDefault();}});if(!(c||b.opera))Y.on('mousedown',function(ag){var ah=ag.data.getTarget();if(ah.is('img','hr','input','textarea','select'))E.getSelection().selectElement(ah);});if(b.gecko)Y.on('mouseup',function(ag){if(ag.data.$.button==2){var ah=ag.data.getTarget();if(!ah.getOuterHtml().replace(m,'')){var ai=new d.range(Y);ai.moveToElementEditStart(ah);ai.select(true);}}}); +Y.on('click',function(ag){ag=ag.data;if(ag.getTarget().is('a')&&ag.$.button!=2)ag.preventDefault();});if(b.webkit){Y.on('mousedown',function(){ad=1;});Y.on('click',function(ag){if(ag.data.getTarget().is('input','select'))ag.data.preventDefault();});Y.on('mouseup',function(ag){if(ag.data.getTarget().is('input','textarea'))ag.data.preventDefault();});}var ac=c?N:X;ac.on('blur',function(){E.focusManager.blur();});var ad;ac.on('focus',function(){var ag=E.document;if(b.gecko||b.opera)ag.getBody().focus();else if(b.webkit)if(!ad){E.document.getDocumentElement().focus();ad=1;}E.focusManager.focus();});var ae=E.keystrokeHandler;ae.blockedKeystrokes[8]=!ab;ae.attach(Y);Y.getDocumentElement().addClass(Y.$.compatMode);E.on('key',function(ag){if(E.mode!='wysiwyg')return;var ah=ag.data.keyCode;if(ah in {8:1,46:1}){var ai=E.getSelection(),aj=ai.getSelectedElement(),ak=ai.getRanges()[0],al=new d.elementPath(ak.startContainer),am,an,ao,ap=ah==8;if(aj){E.fire('saveSnapshot');ak.moveToPosition(aj,3);aj.remove();ak.select();E.fire('saveSnapshot');ag.cancel();}else if(ak.collapsed)if((am=al.block)&&ak[ap?'checkStartOfBlock':'checkEndOfBlock']()&&(ao=am[ap?'getPrevious':'getNext'](n))&&ao.is('table')){E.fire('saveSnapshot');if(ak[ap?'checkEndOfBlock':'checkStartOfBlock']())am.remove();ak['moveToElementEdit'+(ap?'End':'Start')](ao);ak.select();E.fire('saveSnapshot');ag.cancel();}else if(al.blockLimit.is('td')&&(an=al.blockLimit.getAscendant('table'))&&ak.checkBoundaryOfElement(an,ap?1:2)&&(ao=an[ap?'getPrevious':'getNext'](n))){E.fire('saveSnapshot');ak['moveToElementEdit'+(ap?'End':'Start')](ao);if(ak.checkStartOfBlock()&&ak.checkEndOfBlock())ao.remove();else ak.select();E.fire('saveSnapshot');ag.cancel();}}if(ah==33||ah==34)if(b.gecko){var aq=Y.getBody();if(X.$.innerHeight>aq.$.offsetHeight){ak=new d.range(Y);ak[ah==33?'moveToElementEditStart':'moveToElementEditEnd'](aq);ak.select();ag.cancel();}}});if(c&&Y.$.compatMode=='CSS1Compat'){var af={33:1,34:1};Y.on('keydown',function(ag){if(ag.data.getKeystroke() in af)setTimeout(function(){E.getSelection().scrollIntoView();},0);});}if(c&&E.config.enterMode!=1)Y.on('selectionchange',function(){var ag=Y.getBody(),ah=E.getSelection(),ai=ah&&ah.getRanges()[0];if(ai&&ag.getHtml().match(/^

     <\/p>$/i)&&ai.startContainer.equals(ag))setTimeout(function(){ai=E.getSelection().getRanges()[0];if(!ai.startContainer.equals('body')){ag.getFirst().remove(1);ai.moveToElementEditEnd(ag);ai.select(1);}},0);});if(E.contextMenu)E.contextMenu.addTarget(Y,E.config.browserContextMenuOnCtrl!==false); +setTimeout(function(){E.fire('contentDom');if(R){E.mode='wysiwyg';E.fire('mode',{previousMode:E._.previousMode});R=false;}O=false;if(P){E.focus();P=false;}setTimeout(function(){E.fire('dataReady');},0);try{E.document.$.execCommand('2D-position',false,true);}catch(ag){}try{E.document.$.execCommand('enableInlineTableEditing',false,!E.config.disableNativeTableHandles);}catch(ah){}if(E.config.disableObjectResizing)try{E.document.$.execCommand('enableObjectResizing',false,false);}catch(ai){E.document.getBody().on(c?'resizestart':'resize',function(aj){aj.data.preventDefault();});}if(c)setTimeout(function(){if(E.document){var aj=E.document.$.body;aj.runtimeStyle.marginBottom='0px';aj.runtimeStyle.marginBottom='';}},1000);},0);};E.addMode('wysiwyg',{load:function(X,Y,Z){M=X;if(c&&b.quirks)X.setStyle('position','relative');E.mayBeDirty=true;R=true;if(Z)this.loadSnapshotData(Y);else this.loadData(Y);},loadData:function(X){O=true;E._.dataStore={id:1};var Y=E.config,Z=Y.fullPage,aa=Y.docType,ab='';!Z&&(ab=e.buildStyleHtml(E.config.contentsCss)+ab);var ac=Y.baseHref?'':'';if(Z)X=X.replace(/]*>/i,function(ad){E.docType=aa=ad;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ad){E.xmlDeclaration=ad;return '';});if(E.dataProcessor)X=E.dataProcessor.toHtml(X,F);if(Z){if(!/]/.test(X))X=''+X;if(!/]/.test(X))X=''+X+'';if(!/]/.test(X))X=X.replace(/]*>/,'$&');else if(!/]/.test(X))X=X.replace(/]*>/,'$&');ac&&(X=X.replace(//,'$&'+ac));X=X.replace(/<\/head\s*>/,ab+'$&');X=aa+X;}else X=Y.docType+''+''+''+G+''+ac+ab+''+''+X+'';if(b.gecko)X=X.replace(/
    (?=\s*<\/(:?html|body)>)/,'$&
    ');X+=V;this.onDispose();U(X);},getData:function(){var X=E.config,Y=X.fullPage,Z=Y&&E.docType,aa=Y&&E.xmlDeclaration,ab=N.getFrameDocument(),ac=Y?ab.getDocumentElement().getOuterHtml():ab.getBody().getHtml();if(b.gecko)ac=ac.replace(/
    (?=\s*(:?$|<\/body>))/,'');if(E.dataProcessor)ac=E.dataProcessor.toDataFormat(ac,F);if(X.ignoreEmptyParagraph)ac=ac.replace(m,function(ad,ae){return ae;});if(aa)ac=aa+'\n'+ac;if(Z)ac=Z+'\n'+ac; +return ac;},getSnapshotData:function(){return N.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(X){N.getFrameDocument().getBody().setHtml(X);},onDispose:function(){if(!E.document)return;E.document.getDocumentElement().clearCustomData();E.document.getBody().clearCustomData();E.window.clearCustomData();E.document.clearCustomData();N.clearCustomData();N.remove();},unload:function(X){this.onDispose();if(S)I.removeListener('resize',S);E.window=E.document=N=M=P=null;E.fire('contentDomUnload');},focus:function(){var X=E.window;if(O)P=true;else if(X){var Y=E.getSelection(),Z=Y&&Y.getNative();if(Z&&Z.type=='Control')return;b.air?setTimeout(function(){X.focus();},0):X.focus();E.selectionChange();}}});E.on('insertHtml',r(s),null,null,20);E.on('insertElement',r(u),null,null,20);E.on('insertText',r(t),null,null,20);E.on('selectionChange',function(X){if(E.readOnly)return;var Y=E.getSelection();if(Y&&!Y.isLocked){var Z=E.checkDirty();E.fire('saveSnapshot',{contentOnly:1});D.call(this,X);E.fire('updateSnapshot');!Z&&E.resetDirty();}},null,null,1);});E.on('contentDom',function(){var M=E.document.getElementsByTag('title').getItem(0);M.data('cke-title',E.document.$.title);c&&(E.document.$.title=G);});E.on('readOnly',function(){if(E.mode=='wysiwyg'){var M=E.getMode();M.loadData(M.getData());}});if(a.document.$.documentMode>=8){E.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var K=[];for(var L in f.$removeEmpty)K.push('html.CSS1Compat '+L+'[contenteditable=false]');E.addCss(K.join(',')+'{ display:inline-block;}');}else if(b.gecko){E.addCss('html { height: 100% !important; }');E.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\tmin-width : 24px; min-height : 24px; }');}E.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');E.addCss('img, input, textarea { cursor: default;}');E.on('insertElement',function(M){var N=M.data;if(N.type==1&&(N.is('input')||N.is('textarea'))){var O=N.getAttribute('contenteditable')=='false';if(!O){N.data('cke-editable',N.hasAttribute('contenteditable')?'true':'1');N.setAttribute('contenteditable',false);}}});}});if(b.gecko)(function(){var E=document.body;if(!E)window.addEventListener('load',arguments.callee,false);else{var F=E.getAttribute('onpageshow');E.setAttribute('onpageshow',(F?F+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();'); +}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(m){var n='checkspell',o=m.addCommand(n,new a.dialogCommand(n));o.modes={wysiwyg:!b.opera&&!b.air&&document.domain==window.location.hostname};m.ui.addButton('SpellChecker',{label:m.lang.spellCheck.toolbar,command:n});a.dialog.add(n,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){var m=e.cssLength;function n(R){return!!this._.tabs[R][0].$.offsetHeight;};function o(){var V=this;var R=V._.currentTabId,S=V._.tabIdList.length,T=e.indexOf(V._.tabIdList,R)+S;for(var U=T-1;U>T-S;U--){if(n.call(V,V._.tabIdList[U%S]))return V._.tabIdList[U%S];}return null;};function p(){var V=this;var R=V._.currentTabId,S=V._.tabIdList.length,T=e.indexOf(V._.tabIdList,R);for(var U=T+1;U1){ah._.tabBarMode=true; +ah._.tabs[ah._.currentTabId][0].focus();Z=1;}else if((as==37||as==39)&&ah._.tabBarMode){aw=as==(at?39:37)?o.call(ah):p.call(ah);ah.selectPage(aw);ah._.tabs[aw][0].focus();Z=1;}else if((as==13||as==32)&&ah._.tabBarMode){ay.selectPage(ay._.currentTabId);ay._.tabBarMode=false;ay._.currentFocusIndex=-1;ak(1);Z=1;}else if(as==13){var ax=ar.data.getTarget();if(!ax.is('a','button','select','textarea')&&(!ax.is('input')||ax.$.type!='button')){au=ay.getButton('ok');au&&e.setTimeout(au.click,0,au);Z=1;}aa=1;}else if(as==27){au=ay.getButton('cancel');if(au)e.setTimeout(au.click,0,au);else if(ay.fire('cancel',{hide:true}).hide!==false)ay.hide();aa=1;}else return;am(ar);};function am(ar){if(Z)ar.data.preventDefault(1);else if(aa)ar.data.stopPropagation();};var an=this._.element;this.on('show',function(){an.on('keydown',al,this);if(b.opera||b.gecko)an.on('keypress',am,this);});this.on('hide',function(){an.removeListener('keydown',al);if(b.opera||b.gecko)an.removeListener('keypress',am);ai(function(ar){s.apply(ar);});});this.on('iframeAdded',function(ar){var as=new g(ar.data.iframe.$.contentWindow.document);as.on('keydown',al,this,null,0);});this.on('show',function(){var av=this;aj();if(R.config.dialog_startupFocusTab&&ah._.pageCount>1){ah._.tabBarMode=true;ah._.tabs[ah._.currentTabId][0].focus();}else if(!av._.hasFocus){av._.currentFocusIndex=-1;if(T.onFocus){var ar=T.onFocus.call(av);ar&&ar.focus();}else ak(1);if(av._.editor.mode=='wysiwyg'&&c){var as=R.document.$.selection,at=as.createRange();if(at)if(at.parentElement&&at.parentElement().ownerDocument==R.document.$||at.item&&at.item(0).ownerDocument==R.document.$){var au=document.body.createTextRange();au.moveToElementText(av.getElement().getFirst().$);au.collapse(true);au.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(ar){var as=this.getElement(),at=as.getFirst();at.remove();at.appendTo(as);},this);B(this);C(this);new d.text(T.title,a.document).appendTo(this.parts.title);for(Y=0;Y0?S:0)+'px'};aa[V?'right':'left']=(R>0?R:0)+'px';U.setStyles(aa);T&&(ab._.moved=1);},getPosition:function(){return e.extend({},this._.position);},show:function(){var R=this._.element,S=this.definition;if(!(R.getParent()&&R.getParent().equals(a.document.getBody())))R.appendTo(a.document.getBody());else R.setStyle('display','block');if(b.gecko&&b.version<10900){var T=this.parts.dialog;T.setStyle('position','absolute');setTimeout(function(){T.setStyle('position','fixed');},0);}this.resize(this._.contentSize&&this._.contentSize.width||S.width||S.minWidth,this._.contentSize&&this._.contentSize.height||S.height||S.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);if(a.dialog._.currentZIndex===null)a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex; +this._.element.getFirst().setStyle('z-index',a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;H(this._.editor);}else{this._.parentDialog=a.dialog._.currentTop;var U=this._.parentDialog.getElement().getFirst();U.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}R.on('keydown',L);R.on(b.opera?'keypress':'keyup',M);this._.hasFocus=false;e.setTimeout(function(){this.layout();u(this);this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});k.fire('ready',this);this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(V){V.setInitValue&&V.setInitValue();});},100,this);},layout:function(){var X=this;var R=X.parts.dialog,S=X.getSize(),T=a.document.getWindow(),U=T.getViewPaneSize(),V=(U.width-S.width)/2,W=(U.height-S.height)/2;if(!b.ie6Compat)if(S.height+(W>0?W:0)>U.height||S.width+(V>0?V:0)>U.width)R.setStyle('position','absolute');else R.setStyle('position','fixed');X.move(X._.moved?X._.position.x:V,X._.moved?X._.position.y:W);},foreach:function(R){var U=this;for(var S in U._.contents)for(var T in U._.contents[S])R.call(U,U._.contents[S][T]);return U;},reset:(function(){var R=function(S){if(S.reset)S.reset(1);};return function(){this.foreach(R);return this;};})(),setupContent:function(){var R=arguments;this.foreach(function(S){if(S.setup)S.setup.apply(S,R);});},commitContent:function(){var R=arguments;this.foreach(function(S){if(c&&this._.currentFocusIndex==S.focusIndex)S.getInputElement().$.blur();if(S.commit)S.commit.apply(S,R);});},hide:function(){if(!this.parts.dialog.isVisible())return;this.fire('hide',{});this._.editor.fire('dialogHide',this);this.selectPage(this._.tabIdList[0]);var R=this._.element;R.setStyle('display','none');this.parts.dialog.setStyle('visibility','hidden');O(this);while(a.dialog._.currentTop!=this)a.dialog._.currentTop.hide();if(!this._.parentDialog)I();else{var S=this._.parentDialog.getElement().getFirst();S.setStyle('z-index',parseInt(S.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;R.removeListener('keydown',L);R.removeListener(b.opera?'keypress':'keyup',M);var T=this._.editor;T.focus();if(T.mode=='wysiwyg'&&c){var U=T.getSelection();U&&U.unlock(true);}}else a.dialog._.currentZIndex-=10;delete this._.parentDialog;this.foreach(function(V){V.resetInitValue&&V.resetInitValue(); +});},addPage:function(R){var ad=this;var S=[],T=R.label?' title="'+e.htmlEncode(R.label)+'"':'',U=R.elements,V=a.dialog._.uiElementBuilders.vbox.build(ad,{type:'vbox',className:'cke_dialog_page_contents',children:R.elements,expand:!!R.expand,padding:R.padding,style:R.style||'width: 100%;height:100%'},S),W=h.createFromHtml(S.join(''));W.setAttribute('role','tabpanel');var X=b,Y='cke_'+R.id+'_'+e.getNextNumber(),Z=h.createFromHtml(['0?' cke_last':'cke_first',T,!!R.hidden?' style="display:none"':'',' id="',Y,'"',X.gecko&&X.version>=10900&&!X.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',R.label,''].join(''));W.setAttribute('aria-labelledby',Y);ad._.tabs[R.id]=[Z,W];ad._.tabIdList.push(R.id);!R.hidden&&ad._.pageCount++;ad._.lastTab=Z;ad.updateStyle();var aa=ad._.contents[R.id]={},ab,ac=V.getChild();while(ab=ac.shift()){aa[ab.id]=ab;if(typeof ab.getChild=='function')ac.push.apply(ac,ab.getChild());}W.setAttribute('name',R.id);W.appendTo(ad.parts.contents);Z.unselectable();ad.parts.tabs.append(Z);if(R.accessKey){N(ad,ad,'CTRL+'+R.accessKey,Q,P);ad._.accessKeyMap['CTRL+'+R.accessKey]=R.id;}},selectPage:function(R){if(this._.currentTabId==R)return;if(this.fire('selectPage',{page:R,currentPage:this._.currentTabId})===true)return;for(var S in this._.tabs){var T=this._.tabs[S][0],U=this._.tabs[S][1];if(S!=R){T.removeClass('cke_dialog_tab_selected');U.hide();}U.setAttribute('aria-hidden',S!=R);}var V=this._.tabs[R];V[0].addClass('cke_dialog_tab_selected');if(b.ie6Compat||b.ie7Compat){q(V[1]);V[1].show();setTimeout(function(){q(V[1],1);},0);}else V[1].show();this._.currentTabId=R;this._.currentTabIndex=e.indexOf(this._.tabIdList,R);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(R){var T=this;var S=T._.tabs[R]&&T._.tabs[R][0];if(!S||T._.pageCount==1||!S.isVisible())return;else if(R==T._.currentTabId)T.selectPage(o.call(T));S.hide();T._.pageCount--;T.updateStyle();},showPage:function(R){var T=this;var S=T._.tabs[R]&&T._.tabs[R][0];if(!S)return;S.show();T._.pageCount++;T.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(R,S){var T=this._.contents[R];return T&&T[S];},getValueOf:function(R,S){return this.getContentElement(R,S).getValue();},setValueOf:function(R,S,T){return this.getContentElement(R,S).setValue(T);},getButton:function(R){return this._.buttons[R]; +},click:function(R){return this._.buttons[R].click();},disableButton:function(R){return this._.buttons[R].disable();},enableButton:function(R){return this._.buttons[R].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(R,S){var U=this;if(typeof S=='undefined'){S=U._.focusList.length;U._.focusList.push(new t(U,R,S));}else{U._.focusList.splice(S,0,new t(U,R,S));for(var T=S+1;Tac.width-ab.width-W)ah=ac.width-ab.width+(V.lang.dir=='rtl'?0:X[1]);else ah=T.x;if(T.y+X[0]ac.height-ab.height-W)ai=ac.height-ab.height+X[2];else ai=T.y;R.move(ah,ai,1);aa.data.preventDefault();};function Z(aa){a.document.removeListener('mousemove',Y);a.document.removeListener('mouseup',Z);if(b.ie6Compat){var ab=F.getChild(0).getFrameDocument();ab.removeListener('mousemove',Y);ab.removeListener('mouseup',Z);}};R.parts.title.on('mousedown',function(aa){S={x:aa.data.$.screenX,y:aa.data.$.screenY};a.document.on('mousemove',Y);a.document.on('mouseup',Z);T=R.getPosition();if(b.ie6Compat){var ab=F.getChild(0).getFrameDocument();ab.on('mousemove',Y);ab.on('mouseup',Z);}aa.data.preventDefault();},R);};function C(R){var S=R.definition,T=S.resizable;if(T==0)return;var U=R.getParentEditor(),V,W,X,Y,Z,aa,ab=e.addFunction(function(ae){Z=R.getSize();var af=R.parts.contents,ag=af.$.getElementsByTagName('iframe').length;if(ag){aa=h.createFromHtml('

    ');af.append(aa);}W=Z.height-R.parts.contents.getSize('height',!(b.gecko||b.opera||c&&b.quirks));V=Z.width-R.parts.contents.getSize('width',1);Y={x:ae.screenX,y:ae.screenY};X=a.document.getWindow().getViewPaneSize();a.document.on('mousemove',ac);a.document.on('mouseup',ad);if(b.ie6Compat){var ah=F.getChild(0).getFrameDocument();ah.on('mousemove',ac);ah.on('mouseup',ad);}ae.preventDefault&&ae.preventDefault();});R.on('load',function(){var ae='';if(T==1)ae=' cke_resizer_horizontal';else if(T==2)ae=' cke_resizer_vertical';var af=h.createFromHtml('
    '); +R.parts.footer.append(af,1);});U.on('destroy',function(){e.removeFunction(ab);});function ac(ae){var af=U.lang.dir=='rtl',ag=(ae.data.$.screenX-Y.x)*(af?-1:1),ah=ae.data.$.screenY-Y.y,ai=Z.width,aj=Z.height,ak=ai+ag*(R._.moved?1:2),al=aj+ah*(R._.moved?1:2),am=R._.element.getFirst(),an=af&&am.getComputedStyle('right'),ao=R.getPosition();if(ao.y+al>X.height)al=X.height-ao.y;if((af?an:ao.x)+ak>X.width)ak=X.width-(af?an:ao.x);if(T==1||T==3)ai=Math.max(S.minWidth||0,ak-V);if(T==2||T==3)aj=Math.max(S.minHeight||0,al-W);R.resize(ai,aj);if(!R._.moved)R.layout();ae.data.preventDefault();};function ad(){a.document.removeListener('mouseup',ad);a.document.removeListener('mousemove',ac);if(aa){aa.remove();aa=null;}if(b.ie6Compat){var ae=F.getChild(0).getFrameDocument();ae.removeListener('mouseup',ad);ae.removeListener('mousemove',ac);}};};var D,E={},F;function G(R){R.data.preventDefault(1);};function H(R){var S=a.document.getWindow(),T=R.config,U=T.dialog_backgroundCoverColor||'white',V=T.dialog_backgroundCoverOpacity,W=T.baseFloatZIndex,X=e.genKey(U,V,W),Y=E[X];if(!Y){var Z=['
    '];if(b.ie6Compat){var aa=b.isCustomDomain(),ab="";Z.push('');}Z.push('
    ');Y=h.createFromHtml(Z.join(''));Y.setOpacity(V!=undefined?V:0.5);Y.on('keydown',G);Y.on('keypress',G);Y.on('keyup',G);Y.appendTo(a.document.getBody());E[X]=Y;}else Y.show();F=Y;var ac=function(){var af=S.getViewPaneSize();Y.setStyles({width:af.width+'px',height:af.height+'px'});},ad=function(){var af=S.getScrollPosition(),ag=a.dialog._.currentTop;Y.setStyles({left:af.x+'px',top:af.y+'px'});if(ag)do{var ah=ag.getPosition();ag.move(ah.x,ah.y);}while(ag=ag._.parentDialog)};D=ac;S.on('resize',ac);ac();if(!(b.mac&&b.webkit))Y.focus();if(b.ie6Compat){var ae=function(){ad();arguments.callee.prevScrollHandler.apply(this,arguments);};S.$.setTimeout(function(){ae.prevScrollHandler=window.onscroll||(function(){}); +window.onscroll=ae;},0);ad();}};function I(){if(!F)return;var R=a.document.getWindow();F.hide();R.removeListener('resize',D);if(b.ie6Compat)R.$.setTimeout(function(){var S=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=S||null;},0);D=null;};function J(){for(var R in E)E[R].remove();E={};};var K={},L=function(R){var S=R.data.$.ctrlKey||R.data.$.metaKey,T=R.data.$.altKey,U=R.data.$.shiftKey,V=String.fromCharCode(R.data.$.keyCode),W=K[(S?'CTRL+':'')+(T?'ALT+':'')+(U?'SHIFT+':'')+V];if(!W||!W.length)return;W=W[W.length-1];W.keydown&&W.keydown.call(W.uiElement,W.dialog,W.key);R.data.preventDefault();},M=function(R){var S=R.data.$.ctrlKey||R.data.$.metaKey,T=R.data.$.altKey,U=R.data.$.shiftKey,V=String.fromCharCode(R.data.$.keyCode),W=K[(S?'CTRL+':'')+(T?'ALT+':'')+(U?'SHIFT+':'')+V];if(!W||!W.length)return;W=W[W.length-1];if(W.keyup){W.keyup.call(W.uiElement,W.dialog,W.key);R.data.preventDefault();}},N=function(R,S,T,U,V){var W=K[T]||(K[T]=[]);W.push({uiElement:R,dialog:S,key:T,keyup:V||R.accessKeyUp,keydown:U||R.accessKeyDown});},O=function(R){for(var S in K){var T=K[S];for(var U=T.length-1;U>=0;U--){if(T[U].dialog==R||T[U].uiElement==R)T.splice(U,1);}if(T.length===0)delete K[S];}},P=function(R,S){if(R._.accessKeyMap[S])R.selectPage(R._.accessKeyMap[S]);},Q=function(R,S){};(function(){k.dialog={uiElement:function(R,S,T,U,V,W,X){if(arguments.length<4)return;var Y=(U.call?U(S):U)||'div',Z=['<',Y,' '],aa=(V&&V.call?V(S):V)||{},ab=(W&&W.call?W(S):W)||{},ac=(X&&X.call?X.call(this,R,S):X)||'',ad=this.domId=ab.id||e.getNextId()+'_uiElement',ae=this.id=S.id,af;ab.id=ad;var ag={};if(S.type)ag['cke_dialog_ui_'+S.type]=1;if(S.className)ag[S.className]=1;if(S.disabled)ag.cke_disabled=1;var ah=ab['class']&&ab['class'].split?ab['class'].split(' '):[];for(af=0;af=0;af--){if(aj[af]==='')aj.splice(af,1);}if(aj.length>0)ab.style=(ab.style?ab.style+'; ':'')+aj.join('; ');for(af in ab)Z.push(af+'="'+e.htmlEncode(ab[af])+'" ');Z.push('>',ac,'');T.push(Z.join(''));(this._||(this._={})).dialog=R;if(typeof S.isChanged=='boolean')this.isChanged=function(){return S.isChanged;};if(typeof S.isChanged=='function')this.isChanged=S.isChanged; +if(typeof S.setValue=='function')this.setValue=e.override(this.setValue,function(am){return function(an){am.call(this,S.setValue.call(this,an));};});if(typeof S.getValue=='function')this.getValue=e.override(this.getValue,function(am){return function(){return S.getValue.call(this,am.call(this));};});a.event.implementOn(this);this.registerEvents(S);if(this.accessKeyUp&&this.accessKeyDown&&S.accessKey)N(this,R,'CTRL+'+S.accessKey);var al=this;R.on('load',function(){var am=al.getInputElement();if(am){var an=al.type in {checkbox:1,ratio:1}&&c&&b.version<8?'cke_dialog_ui_focused':'';am.on('focus',function(){R._.tabBarMode=false;R._.hasFocus=true;al.fire('focus');an&&this.addClass(an);});am.on('blur',function(){al.fire('blur');an&&this.removeClass(an);});}});if(this.keyboardFocusable){this.tabIndex=S.tabIndex||0;this.focusIndex=R._.focusList.push(this)-1;this.on('focus',function(){R._.currentFocusIndex=al.focusIndex;});}e.extend(this,S);},hbox:function(R,S,T,U,V){if(arguments.length<4)return;this._||(this._={});var W=this._.children=S,X=V&&V.widths||null,Y=V&&V.height||null,Z={},aa,ab=function(){var ad=[''];for(aa=0;aa0)ad.push('style="'+af.join('; ')+'" ');ad.push('>',T[aa],'');}ad.push('');return ad.join('');},ac={role:'presentation'};V&&V.align&&(ac.align=V.align);k.dialog.uiElement.call(this,R,V||{type:'hbox'},U,'table',Z,ac,ab);},vbox:function(R,S,T,U,V){if(arguments.length<3)return;this._||(this._={});var W=this._.children=S,X=V&&V.width||null,Y=V&&V.heights||null,Z=function(){var aa=['');for(var ab=0;ab');}aa.push('
    0)aa.push('style="',ac.join('; '),'" ');aa.push(' class="cke_dialog_ui_vbox_child">',T[ab],'
    ');return aa.join('');};k.dialog.uiElement.call(this,R,V||{type:'vbox'},U,'div',null,{role:'presentation'},Z);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(R,S){this.getInputElement().setValue(R);!S&&this.fire('change',{value:R});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var U=this;var R=U.getInputElement(),S=R,T;while((S=S.getParent())&&S.$.className.search('cke_dialog_page_contents')==-1){}if(!S)return U;T=S.getAttribute('name');if(U._.dialog._.currentTabId!=T)U._.dialog.selectPage(T);return U;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(R){var S=/^on([A-Z]\w+)/,T,U=function(W,X,Y,Z){X.on('load',function(){W.getInputElement().on(Y,Z,W);});};for(var V in R){if(!(T=V.match(S)))continue;if(this.eventProcessors[V])this.eventProcessors[V].call(this,this._.dialog,R[V]);else U(this,this._.dialog,T[1].toLowerCase(),R[V]);}return this;},eventProcessors:{onLoad:function(R,S){R.on('load',S,this);},onShow:function(R,S){R.on('show',S,this);},onHide:function(R,S){R.on('hide',S,this);}},accessKeyDown:function(R,S){this.focus();},accessKeyUp:function(R,S){},disable:function(){var R=this.getElement(),S=this.getInputElement();S.setAttribute('disabled','true');R.addClass('cke_disabled');},enable:function(){var R=this.getElement(),S=this.getInputElement();S.removeAttribute('disabled');R.removeClass('cke_disabled');},isEnabled:function(){return!this.getElement().hasClass('cke_disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(R){var S=this;if(arguments.length<1)return S._.children.concat();if(!R.splice)R=[R];if(R.length<2)return S._.children[R[0]];else return S._.children[R[0]]&&S._.children[R[0]].getChild?S._.children[R[0]].getChild(R.slice(1,R.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox(); +(function(){var R={build:function(S,T,U){var V=T.children,W,X=[],Y=[];for(var Z=0;Z',T||U.name,'');return V.join('');}};a.style.getStyleText=function(T){var U=T._ST;if(U)return U;U=T.styles;var V=T.attributes&&T.attributes.style||'',W='';if(V.length)V=V.replace(o,';');for(var X in U){var Y=U[X],Z=(X+':'+Y).replace(o,';');if(Y=='inherit')W+=Z;else V+=Z;}if(V.length)V=P(V);V+=W;return T._ST=V;};function s(T){var U,V;while(T=T.getParent()){if(T.getName()=='body')break;if(T.getAttribute('data-nostyle'))U=T;else if(!V){var W=T.getAttribute('contentEditable');if(W=='false')U=T;else if(W=='true')V=1;}}return U;};function t(T){var ay=this;var U=T.document;if(T.collapsed){var V=J(ay,U);T.insertNode(V);T.moveToPosition(V,2);return;}var W=ay.element,X=ay._.definition,Y,Z=X.ignoreReadonly,aa=Z||X.includeReadonly;if(aa==undefined)aa=U.getCustomData('cke_includeReadonly');var ab=f[W]||(Y=true,f.span);T.enlarge(1,1);T.trim();var ac=T.createBookmark(),ad=ac.startNode,ae=ac.endNode,af=ad,ag;if(!Z){var ah=s(ad),ai=s(ae);if(ah)af=ah.getNextSourceNode(true);if(ai)ae=ai;}if(af.getPosition(ae)==2)af=0;while(af){var aj=false;if(af.equals(ae)){af=null;aj=true;}else{var ak=af.type,al=ak==1?af.getName():null,am=al&&af.getAttribute('contentEditable')=='false',an=al&&af.getAttribute('data-nostyle');if(al&&af.data('cke-bookmark')){af=af.getNextSourceNode(true);continue;}if(!al||ab[al]&&!an&&(!am||aa)&&(af.getPosition(ae)|4|0|8)==4+0+8&&(!X.childRule||X.childRule(af))){var ao=af.getParent(); +if(ao&&((ao.getDtd()||f.span)[W]||Y)&&(!X.parentRule||X.parentRule(ao))){if(!ag&&(!al||!f.$removeEmpty[al]||(af.getPosition(ae)|4|0|8)==4+0+8)){ag=new d.range(U);ag.setStartBefore(af);}if(ak==3||am||ak==1&&!af.getChildCount()){var ap=af,aq;while((aj=!ap.getNext(q))&&(aq=ap.getParent(),ab[aq.getName()])&&(aq.getPosition(ad)|2|0|8)==2+0+8&&(!X.childRule||X.childRule(aq)))ap=aq;ag.setEndAfter(ap);}}else aj=true;}else aj=true;af=af.getNextSourceNode(an||am);}if(aj&&ag&&!ag.collapsed){var ar=J(ay,U),as=ar.hasAttributes(),at=ag.getCommonAncestor(),au={styles:{},attrs:{},blockedStyles:{},blockedAttrs:{}},av,aw,ax;while(ar&&at){if(at.getName()==W){for(av in X.attributes){if(au.blockedAttrs[av]||!(ax=at.getAttribute(aw)))continue;if(ar.getAttribute(av)==ax)au.attrs[av]=1;else au.blockedAttrs[av]=1;}for(aw in X.styles){if(au.blockedStyles[aw]||!(ax=at.getStyle(aw)))continue;if(ar.getStyle(aw)==ax)au.styles[aw]=1;else au.blockedStyles[aw]=1;}}at=at.getParent();}for(av in au.attrs)ar.removeAttribute(av);for(aw in au.styles)ar.removeStyle(aw);if(as&&!ar.hasAttributes())ar=null;if(ar){ag.extractContents().appendTo(ar);G(ay,ar);ag.insertNode(ar);ar.mergeSiblings();if(!c)ar.$.normalize();}else{ar=new h('span');ag.extractContents().appendTo(ar);ag.insertNode(ar);G(ay,ar);ar.remove(true);}ag=null;}}T.moveToBookmark(ac);T.shrink(2);};function u(T){T.enlarge(1,1);var U=T.createBookmark(),V=U.startNode;if(T.collapsed){var W=new d.elementPath(V.getParent()),X;for(var Y=0,Z;Y'+V+'';else T.setHtml(V);U.remove();};function B(T){var U=/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,V=T.getName(),W=C(T.getOuterHtml(),U,function(Y,Z,aa){return Z+''+aa+'
    ';}),X=[];W.replace(/([\s\S]*?)<\/pre>/gi,function(Y,Z){X.push(Z);});return X;};function C(T,U,V){var W='',X='';T=T.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(Y,Z,aa){Z&&(W=Z);aa&&(X=aa);return '';});return W+T.replace(U,V)+X;};function D(T,U){var V;if(T.length>1)V=new d.documentFragment(U.getDocument());for(var W=0;W');X=X.replace(/[ \t]{2,}/g,function(Z){return e.repeat(' ',Z.length-1)+' ';});if(V){var Y=U.clone();Y.setHtml(X);V.append(Y);}else U.setHtml(X);}return V||U;};function E(T,U){var V=T.getBogus();V&&V.remove();var W=T.getHtml();W=C(W,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');W=W.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');W=W.replace(/([ \t\n\r]+| )/g,' ');W=W.replace(/]*>/gi,'\n');if(c){var X=T.getDocument().createElement('div');X.append(U);U.$.outerHTML='
    '+W+'
    ';U.copyAttributes(X.getFirst());U=X.getFirst().remove();}else U.setHtml(W);return U;};function F(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T)[U.getName()],Z=e.isEmpty(W)&&e.isEmpty(X);for(var aa in W){if((aa=='class'||T._.definition.fullMatch)&&U.getAttribute(aa)!=O(aa,W[aa]))continue;Z=U.hasAttribute(aa);U.removeAttribute(aa);}for(var ab in X){if(T._.definition.fullMatch&&U.getStyle(ab)!=O(ab,X[ab],true))continue;Z=Z||!!U.getStyle(ab);U.removeStyle(ab);}H(U,Y,m[U.getName()]);if(Z)!f.$block[U.getName()]||T._.enterMode==2&&!U.hasAttributes()?I(U):U.renameNode(T._.enterMode==1?'p':'div');};function G(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T),Z=U.getElementsByTag(T.element);for(var aa=Z.count();--aa>=0;)F(T,Z.getItem(aa));for(var ab in Y){if(ab!=T.element){Z=U.getElementsByTag(ab);for(aa=Z.count()-1;aa>=0;aa--){var ac=Z.getItem(aa);H(ac,Y[ab]);}}}};function H(T,U,V){var W=U&&U.attributes;if(W)for(var X=0;X0)H+=(F.$.offsetWidth||0)-(F.$.clientWidth||0)+3;H+=4;F.setStyle('width',H+'px');v.element.addClass('cke_frameLoaded');var I=v.element.$.scrollHeight;if(c&&b.quirks&&I>0)I+=(F.$.offsetHeight||0)-(F.$.clientHeight||0)+3;F.setStyle('height',I+'px');u._.currentBlock.element.setStyle('display','none').removeStyle('display');}else F.removeStyle('height');if(A)B-=w.$.offsetWidth;w.setStyle('left',B+'px');var J=u.element,K=J.getWindow(),L=w.$.getBoundingClientRect(),M=K.getViewPaneSize(),N=L.width||L.right-L.left,O=L.height||L.bottom-L.top,P=A?L.right:M.width-L.left,Q=A?M.width-L.right:L.left;if(A){if(PN)B+=N;else if(M.width>N)B-=L.left;else B=B-L.right+M.width;}else if(PN)B-=N;else if(M.width>N)B=B-L.right+M.width;else B-=L.left;var R=M.height-L.top,S=L.top; +if(RO)C-=O;else if(M.height>O)C=C-L.bottom+M.height;else C-=L.top;if(c){var T=new h(w.$.offsetParent),U=T;if(U.getName()=='html')U=U.getDocument().getBody();if(U.getComputedStyle('direction')=='rtl')if(b.ie8Compat)B-=w.getDocument().getDocumentElement().$.scrollLeft*2;else B-=T.$.scrollWidth-T.$.clientWidth;}var V=w.getFirst(),W;if(W=V.getCustomData('activePanel'))W.onHide&&W.onHide.call(this,1);V.setCustomData('activePanel',this);w.setStyles({top:C+'px',left:B+'px'});w.setOpacity(1);},this);u.isLoaded?E():u.onLoad=E;e.setTimeout(function(){x.$.contentWindow.focus();this.allowBlur(true);},0,this);},b.air?200:0,this);this.visible=1;if(this.onShow)this.onShow.call(this);n=0;},hide:function(p){var r=this;if(r.visible&&(!r.onHide||r.onHide.call(r)!==true)){r.hideChild();b.gecko&&r._.iframe.getFrameDocument().$.activeElement.blur();r.element.setStyle('display','none');r.visible=0;r.element.getFirst().removeCustomData('activePanel');var q=p!==false&&r._.returnFocus;if(q){if(b.webkit&&q.type)q.getWindow().$.focus();q.focus();}}},allowBlur:function(p){var q=this._.panel;if(p!=undefined)q.allowBlur=p;return q.allowBlur;},showAsChild:function(p,q,r,s,t,u){if(this._.activeChild==p&&p._.panel._.offsetParentId==r.getId())return;this.hideChild();p.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=p;this._.focused=false;p.showBlock(q,r,s,t,u);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){p.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var p=this._.activeChild;if(p){delete p.onHide;delete p._.returnFocus;delete this._.activeChild;p.hide();}}}});a.on('instanceDestroyed',function(){var p=e.isEmpty(a.instances);for(var q in m){var r=m[q];if(p)r.destroy();else r.element.hide();}p&&(m={});});})();j.add('menu',{beforeInit:function(m){var n=m.config.menu_groups.split(','),o=m._.menuGroups={},p=m._.menuItems={};for(var q=0;q'],B=r.length,C=B&&r[0].group;for(var D=0;D');C=E.group;}E.render(this,D,A);}A.push('');u.setHtml(A.join(''));k.fire('ready',this);if(this.parent)this.parent._.panel.showAsChild(t,this.id,n,o,p,q);else t.showBlock(this.id,n,o,p,q);s.fire('menuShow',[t]);},addListener:function(n){this._.listeners.push(n);},hide:function(n){var o=this;o._.onHide&&o._.onHide();o._.panel&&o._.panel.hide(n);}}});function m(n){n.sort(function(o,p){if(o.groupp.group)return 1;return o.orderp.order?1:0;});};a.menuItem=e.createClass({$:function(n,o,p){var q=this;e.extend(q,p,{order:0,className:'cke_button_'+o});q.group=n._.menuGroups[q.group];q.editor=n;q.name=o;},proto:{render:function(n,o,p){var w=this;var q=n.id+String(o),r=typeof w.state=='undefined'?2:w.state,s=' cke_'+(r==1?'on':r==0?'disabled':'off'),t=w.label;if(w.className)s+=' '+w.className;var u=w.getItems;p.push(''+''+'');if(u)p.push('','&#',w.editor.lang.dir=='rtl'?'9668':'9658',';',''); +p.push(t,'');}}});})();i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';(function(){var m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return;n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='
    ';});n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;n.getMode().loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){if(n.mode){o();n.removeListener('mode',arguments.callee);}});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(n.getMode().getData(),null,1);m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=n.getMode().getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)n.getMode().loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener();b.webkit&&n.container.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);},0);});n.on('destroy',function(){var o=this;if(o.mode)o._.modes[o.mode].unload(o.getThemeSpace('contents'));});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n;(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){this.fire('beforeSetMode',{newMode:n});var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this._.previousMode=this.mode;this.fire('beforeModeUnload');var r=this.getMode();o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=this.getMode(n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.getMode=function(n){return this._.modes&&this._.modes[n||this.mode];};a.editor.prototype.focus=function(){this.forceNextSelectionCheck();var n=this.getMode();if(n)n.focus();};})();i.startupMode='wysiwyg';i.editingBlock=true;(function(){function m(){var G=this;try{var D=G.getSelection();if(!D||!D.document.getWindow().$)return;var E=D.getStartElement(),F=new d.elementPath(E);if(!F.compare(G._.selectionPreviousPath)){G._.selectionPreviousPath=F;G.fire('selectionChange',{selection:D,path:F,element:E}); +}}catch(H){}};var n,o;function p(){o=true;if(n)return;q.call(this);n=e.setTimeout(q,200,this);};function q(){n=null;if(o){e.setTimeout(m,0,this);o=false;}};function r(D){function E(I,J){if(!I||I.type==3)return false;var K=D.clone();return K['moveToElementEdit'+(J?'End':'Start')](I);};var F=D.startContainer,G=D.getPreviousNode(A,null,F),H=D.getNextNode(A,null,F);if(E(G)||E(H,1))return true;if(!(G||H)&&!(F.type==1&&F.isBlockBoundary()&&F.getBogus()))return true;return false;};var s={modes:{wysiwyg:1,source:1},readOnly:c||b.webkit,exec:function(D){switch(D.mode){case 'wysiwyg':D.document.$.execCommand('SelectAll',false,null);D.forceNextSelectionCheck();D.selectionChange();break;case 'source':var E=D.textarea.$;if(c)E.createTextRange().execCommand('SelectAll');else{E.selectionStart=0;E.selectionEnd=E.value.length;}E.focus();}},canUndo:false};function t(D){w(D);var E=D.createText('​');D.setCustomData('cke-fillingChar',E);return E;};function u(D){return D&&D.getCustomData('cke-fillingChar');};function v(D){var E=D&&u(D);if(E)if(E.getCustomData('ready'))w(D);else E.setCustomData('ready',1);};function w(D){var E=D&&D.removeCustomData('cke-fillingChar');if(E){var F,G=D.getSelection().getNative(),H=G&&G.type!='None'&&G.getRangeAt(0);if(E.getLength()>1&&H&&H.intersectsNode(E.$)){F=[G.anchorOffset,G.focusOffset];var I=G.anchorNode==E.$&&G.anchorOffset>0,J=G.focusNode==E.$&&G.focusOffset>0;I&&F[0]--;J&&F[1]--;x(G)&&F.unshift(F.pop());}E.setText(E.getText().replace(/\u200B/g,''));if(F){var K=G.getRangeAt(0);K.setStart(K.startContainer,F[0]);K.setEnd(K.startContainer,F[1]);G.removeAllRanges();G.addRange(K);}}};function x(D){if(!D.isCollapsed){var E=D.getRangeAt(0);E.setStart(D.anchorNode,D.anchorOffset);E.setEnd(D.focusNode,D.focusOffset);return E.collapsed;}};j.add('selection',{init:function(D){if(b.webkit){D.on('selectionChange',function(){v(D.document);});D.on('beforeSetMode',function(){w(D.document);});var E,F;function G(){var I=D.document,J=u(I);if(J){var K=I.$.defaultView.getSelection();if(K.type=='Caret'&&K.anchorNode==J.$)F=1;E=J.getText();J.setText(E.replace(/\u200B/g,''));}};function H(){var I=D.document,J=u(I);if(J){J.setText(E);if(F){I.$.defaultView.getSelection().setPosition(J.$,J.getLength());F=0;}}};D.on('beforeUndoImage',G);D.on('afterUndoImage',H);D.on('beforeGetData',G,null,null,0);D.on('getData',H);}D.on('contentDom',function(){var I=D.document,J=a.document,K=I.getBody(),L=I.getDocumentElement();if(c){var M,N,O=1;K.on('focusin',function(V){if(V.data.$.srcElement.nodeName!='BODY')return; +var W=I.getCustomData('cke_locked_selection');if(W){W.unlock(1);W.lock();}else if(M&&O){try{M.select();}catch(X){}M=null;}});K.on('focus',function(){N=1;U();});K.on('beforedeactivate',function(V){if(V.data.$.toElement)return;N=0;O=1;});c&&D.on('blur',function(){try{I.$.selection.empty();}catch(V){}});L.on('mousedown',function(){O=0;});L.on('mouseup',function(){O=1;});var P;K.on('mousedown',function(V){if(V.data.$.button==2){var W=D.document.$.selection;if(W.type=='None')P=D.window.getScrollPosition();}T();});K.on('mouseup',function(V){if(V.data.$.button==2&&P){D.document.$.documentElement.scrollLeft=P.x;D.document.$.documentElement.scrollTop=P.y;}P=null;N=1;setTimeout(function(){U(true);},0);});K.on('keydown',T);K.on('keyup',function(){N=1;U();});if(I.$.compatMode!='BackCompat'){if(b.ie7Compat||b.ie6Compat){function Q(V,W,X){try{V.moveToPoint(W,X);}catch(Y){}};L.on('mousedown',function(V){function W(ab){ab=ab.data.$;if(Z){var ac=K.$.createTextRange();Q(ac,ab.x,ab.y);Z.setEndPoint(aa.compareEndPoints('StartToStart',ac)<0?'EndToEnd':'StartToStart',ac);Z.select();}};function X(){J.removeListener('mouseup',Y);L.removeListener('mouseup',Y);};function Y(){L.removeListener('mousemove',W);X();Z.select();};V=V.data;if(V.getTarget().is('html')&&V.$.x0)P=Q-1;else if(R<0)O=Q+1;else if(b.ie9Compat&&L.tagName=='BR'){var U=J.defaultView.getSelection();return{container:U[H?'anchorNode':'focusNode'],offset:U[H?'anchorOffset':'focusOffset']};}else return{container:I,offset:E(L)};}if(Q==-1||Q==K.length-1&&R<0){N.moveToElementText(I); +N.setEndPoint('StartToStart',G);S=N.text.replace(/(\r\n|\r)/g,'\n').length;K=I.childNodes;if(!S){L=K[K.length-1];if(L.nodeType!=3)return{container:I,offset:K.length};else return{container:L,offset:L.nodeValue.length};}var V=K.length;while(S>0&&V>0){M=K[--V];if(M.nodeType==3){T=M;S-=M.nodeValue.length;}}return{container:T,offset:-S};}else{N.collapse(R>0?true:false);N.setEndPoint(R>0?'StartToStart':'EndToStart',G);S=N.text.replace(/(\r\n|\r)/g,'\n').length;if(!S)return{container:I,offset:E(L)+(R>0?0:1)};while(S>0)try{M=L[R>0?'previousSibling':'nextSibling'];if(M.nodeType==3){S-=M.nodeValue.length;T=M;}L=M;}catch(W){return{container:I,offset:E(L)};}return{container:T,offset:R>0?-S:T.nodeValue.length+S};}};return function(){var Q=this;var G=Q.getNative(),H=G&&G.createRange(),I=Q.getType(),J;if(!G)return[];if(I==2){J=new d.range(Q.document);var K=F(H,true);J.setStart(new d.node(K.container),K.offset);K=F(H);J.setEnd(new d.node(K.container),K.offset);if(J.endContainer.getPosition(J.startContainer)&4&&J.endOffset<=J.startContainer.getIndex())J.collapse();return[J];}else if(I==3){var L=[];for(var M=0;M=L.getLength())P.setStartAfter(L);else P.setStartBefore(L);if(M&&M.type==3)if(!O)P.setEndBefore(M);else P.setEndAfter(M);var Q=new d.walker(P);Q.evaluator=function(R){if(R.type==1&&R.isReadOnly()){var S=I.clone();I.setEndBefore(R);if(I.collapsed)G.splice(H--,1); +if(!(R.getPosition(P.endContainer)&16)){S.setStartAfter(R);if(!S.collapsed)G.splice(H+1,0,S);}return true;}return false;};Q.next();}}return F.ranges;};})(),getStartElement:function(){var K=this;var D=K._.cache;if(D.startElement!==undefined)return D.startElement;var E,F=K.getNative();switch(K.getType()){case 3:return K.getSelectedElement();case 2:var G=K.getRanges()[0];if(G){if(!G.collapsed){G.optimize();while(1){var H=G.startContainer,I=G.startOffset;if(I==(H.getChildCount?H.getChildCount():H.getLength())&&!H.isBlockBoundary())G.setStartAfter(H);else break;}E=G.startContainer;if(E.type!=1)return E.getParent();E=E.getChild(G.startOffset);if(!E||E.type!=1)E=G.startContainer;else{var J=E.getFirst();while(J&&J.type==1){E=J;J=J.getFirst();}}}else{E=G.startContainer;if(E.type!=1)E=E.getParent();}E=E.$;}}return D.startElement=E?new h(E):null;},getSelectedElement:function(){var D=this._.cache;if(D.selectedElement!==undefined)return D.selectedElement;var E=this,F=e.tryThese(function(){return E.getNative().createRange().item(0);},function(){var G,H,I=E.getRanges()[0],J=I.getCommonAncestor(1,1),K={table:1,ul:1,ol:1,dl:1};for(var L in K){if(G=J.getAscendant(L,1))break;}if(G){var M=new d.range(this.document);M.setStartAt(G,1);M.setEnd(I.startContainer,I.startOffset);var N=e.extend(K,f.$listItem,f.$tableContent),O=new d.walker(M),P=function(Q,R){return function(S,T){if(S.type==3&&(!e.trim(S.getText())||S.getParent().data('cke-bookmark')))return true;var U;if(S.type==1){U=S.getName();if(U=='br'&&R&&S.equals(S.getParent().getBogus()))return true;if(T&&U in N||U in f.$removeEmpty)return true;}Q.halted=1;return false;};};O.guard=P(O);if(O.checkBackward()&&!O.halted){O=new d.walker(M);M.setStart(I.endContainer,I.endOffset);M.setEndAt(G,2);O.guard=P(O,1);if(O.checkForward()&&!O.halted)H=G.$;}}if(!H)throw 0;return H;},function(){var G=E.getRanges()[0],H,I;for(var J=2;J&&!((H=G.getEnclosedNode())&&H.type==1&&y[H.getName()]&&(I=H));J--)G.shrink(1);return I.$;});return D.selectedElement=F?new h(F):null;},getSelectedText:function(){var D=this._.cache;if(D.selectedText!==undefined)return D.selectedText;var E='',F=this.getNative();if(this.getType()==2)E=c?F.createRange().text:F.toString();return D.selectedText=E;},lock:function(){var D=this;D.getRanges();D.getStartElement();D.getSelectedElement();D.getSelectedText();D._.cache.nativeSel={};D.isLocked=1;D.document.setCustomData('cke_locked_selection',D);},unlock:function(D){var I=this;var E=I.document,F=E.getCustomData('cke_locked_selection'); +if(F){E.setCustomData('cke_locked_selection',null);if(D){var G=F.getSelectedElement(),H=!G&&F.getRanges();I.isLocked=0;I.reset();if(G)I.selectElement(G);else I.selectRanges(H);}}if(!F||!D){I.isLocked=0;I.reset();}},reset:function(){this._.cache={};},selectElement:function(D){var F=this;if(F.isLocked){var E=new d.range(F.document);E.setStartBefore(D);E.setEndAfter(D);F._.cache.selectedElement=D;F._.cache.startElement=D;F._.cache.ranges=new d.rangeList(E);F._.cache.type=3;return;}E=new d.range(D.getDocument());E.setStartBefore(D);E.setEndAfter(D);E.select();F.document.fire('selectionchange');F.reset();},selectRanges:function(D){var R=this;if(R.isLocked){R._.cache.selectedElement=null;R._.cache.startElement=D[0]&&D[0].getTouchedStartNode();R._.cache.ranges=new d.rangeList(D);R._.cache.type=2;return;}if(c){if(D.length>1){var E=D[D.length-1];D[0].setEnd(E.endContainer,E.endOffset);D.length=1;}if(D[0])D[0].select();R.reset();}else{var F=R.getNative();if(!F)return;if(D.length){F.removeAllRanges();b.webkit&&w(R.document);}for(var G=0;G=0){M.collapse(1);N.setEnd(M.endContainer.$,M.endOffset);}else throw S;}F.addRange(N);}R.document.fire('selectionchange');R.reset();}},createBookmarks:function(D){return this.getRanges().createBookmarks(D);},createBookmarks2:function(D){return this.getRanges().createBookmarks2(D);},selectBookmarks:function(D){var E=[];for(var F=0;F','','',this.label,'','=10900&&!o.hc?'':" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',p,'_label" aria-describedby="',p,'_text" aria-haspopup="true"');if(b.opera||b.gecko&&b.mac)n.push(' onkeypress="return false;"');if(b.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="CKEDITOR.tools.callFunction( ',t,', event, this );" onfocus="return CKEDITOR.tools.callFunction(',u,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',q,', this); return false;">'+this.label+''+''+''+(b.hc?'▼':b.air?' ':'')+''+''+''+'');if(this.onRender)this.onRender();return r;},createPanel:function(m){if(this._.panel)return;var n=this._.panelDefinition,o=this._.panelDefinition.block,p=n.parent||a.document.getBody(),q=new k.floatPanel(m,p,n),r=q.addListBlock(this.id,o),s=this;q.onShow=function(){if(s.className)this.element.getFirst().addClass(s.className+'_panel');s.setState(1);r.focus(!s.multiSelect&&s.getValue());s._.on=1;if(s.onOpen)s.onOpen();};q.onHide=function(t){if(s.className)this.element.getFirst().removeClass(s.className+'_panel');s.setState(s.modes&&s.modes[m.mode]?2:0);s._.on=0;if(!t&&s.onClose)s.onClose();};q.onEscape=function(){q.hide();};r.onClick=function(t,u){s.document.getWindow().focus();if(s.onClick)s.onClick.call(s,t,u);if(u)s.setValue(t,s._.items[t]);else s.setValue('');q.hide(false);};this._.panel=q;this._.list=r;q.getBlock(this.id).onHide=function(){s._.on=0;s.setState(2);};if(this.init)this.init();},setValue:function(m,n){var p=this;p._.value=m;var o=p.document.getById('cke_'+p.id+'_text');if(o){if(!(m||n)){n=p.label;o.addClass('cke_inline_label');}else o.removeClass('cke_inline_label');o.setHtml(typeof n!='undefined'?n:m);}},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(m){this._.list.mark(m);},hideItem:function(m){this._.list.hideItem(m);},hideGroup:function(m){this._.list.hideGroup(m);},showAll:function(){this._.list.showAll();},add:function(m,n,o){this._.items[m]=o||m;this._.list.add(m,n,o);},startGroup:function(m){this._.list.startGroup(m); +},commit:function(){var m=this;if(!m._.committed){m._.list.commit();m._.committed=1;k.fire('ready',m);}m._.committed=1;},setState:function(m){var n=this;if(n._.state==m)return;n.document.getById('cke_'+n.id).setState(m);n._.state=m;}}});k.prototype.addRichCombo=function(m,n){this.add(m,'richcombo',n);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var o=this;o.base();o.indentationChars='\t';o.selfClosingEnd=' />';o.lineBreakChars='\n';o.forceSimpleAmpersand=0;o.sortAttributes=1;o._.indent=0;o._.indentation='';o._.inPre=0;o._.rules={};var m=f;for(var n in e.extend({},m.$nonBodyContent,m.$block,m.$listItem,m.$tableContent))o.setRules(n,{indent:1,breakBeforeOpen:1,breakAfterOpen:1,breakBeforeClose:!m[n]['#'],breakAfterClose:1});o.setRules('br',{breakAfterOpen:1});o.setRules('title',{indent:0,breakAfterOpen:0});o.setRules('style',{indent:0,breakBeforeClose:1});o.setRules('pre',{indent:0});},proto:{openTag:function(m,n){var p=this;var o=p._.rules[m];if(p._.indent)p.indentation();else if(o&&o.breakBeforeOpen){p.lineBreak();p.indentation();}p._.output.push('<',m);},openTagClose:function(m,n){var p=this;var o=p._.rules[m];if(n)p._.output.push(p.selfClosingEnd);else{p._.output.push('>');if(o&&o.indent)p._.indentation+=p.indentationChars;}if(o&&o.breakAfterOpen)p.lineBreak();m=='pre'&&(p._.inPre=1);},attribute:function(m,n){if(typeof n=='string'){this.forceSimpleAmpersand&&(n=n.replace(/&/g,'&'));n=e.htmlEncodeAttr(n);}this._.output.push(' ',m,'="',n,'"');},closeTag:function(m){var o=this;var n=o._.rules[m];if(n&&n.indent)o._.indentation=o._.indentation.substr(o.indentationChars.length);if(o._.indent)o.indentation();else if(n&&n.breakBeforeClose){o.lineBreak();o.indentation();}o._.output.push('');m=='pre'&&(o._.inPre=0);if(n&&n.breakAfterClose)o.lineBreak();},text:function(m){var n=this;if(n._.indent){n.indentation();!n._.inPre&&(m=e.ltrim(m));}n._.output.push(m);},comment:function(m){if(this._.indent)this.indentation();this._.output.push('');},lineBreak:function(){var m=this;if(!m._.inPre&&m._.output.length>0)m._.output.push(m.lineBreakChars);m._.indent=1;},indentation:function(){var m=this;if(!m._.inPre)m._.output.push(m._.indentation);m._.indent=0;},setRules:function(m,n){var o=this._.rules[m];if(o)e.extend(o,n,true);else this._.rules[m]=n;}}});j.add('menubutton',{requires:['button','menu'],beforeInit:function(m){m.ui.addHandler('menubutton',k.menuButton.handler);}});a.UI_MENUBUTTON='menubutton'; +(function(){var m=function(n){var o=this._;if(o.state===0)return;o.previousState=o.state;var p=o.menu;if(!p){p=o.menu=new a.menu(n,{panel:{className:n.skinClass+' cke_contextmenu',attributes:{'aria-label':n.lang.common.options}}});p.onHide=e.bind(function(){this.setState(this.modes&&this.modes[n.mode]?o.previousState:0);},this);if(this.onMenu)p.addListener(this.onMenu);}if(o.on){p.hide();return;}this.setState(1);p.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(n){var o=n.panel;delete n.panel;this.base(n);this.hasArrow=true;this.click=m;},statics:{handler:{create:function(n){return new k.menuButton(n);}}}});})();j.add('dialogui');(function(){var m=function(u){var x=this;x._||(x._={});x._['default']=x._.initValue=u['default']||'';x._.required=u.required||false;var v=[x._];for(var w=1;w',v.label,'',''); +else{var D={type:'hbox',widths:v.widths,padding:0,children:[{type:'html',html:'
    ";a.bgClassName&&(b='
     
    '+b+"
    ")}m.innerHTML=b,nb.insertBefore(m.firstChild,f)}else f=f.nextSibling;++j})}function Mc(){if(!f.gutter&&!f.lineNumbers)return;var a=V.offsetHeight,b=T.clientHeight;ab.style.height=(a-b<2?b:a)+"px";var c=[],d=Nb,e;tb.iter(Nb,Math.max(Ob,Nb+1),function(a){if(a.hidden)c.push("
    ");else{var b=a.gutterMarker,g=f.lineNumbers?d+f.firstLineNumber:null;b&&b.text?g=b.text.replace("%N%",g!=null?g:""):g==null&&(g="\u00a0"),c.push(b&&b.style?'
    ':"
    ",g);for(var h=1;h ");c.push("
    "),b||(e=d)}++d}),ab.style.display="none",ib.innerHTML=c.join("");if(e!=null){var g=ib.childNodes[e-Nb],h=String(tb.size).length,i=X(g),j="";while(i.length+j.length2;return jb.style.marginLeft=ab.offsetWidth+"px",Kb=!1,k}function Nc(){var a=Z(wb.from,wb.to),b=vd(wb.from,!0),c=a?b:vd(wb.to,!0),d=wb.inverted?b:c,e=Bd(),g=W(s),h=W(nb);A.style.top=Math.max(0,Math.min(T.offsetHeight,d.y+h.top-g.top))+"px",A.style.left=Math.max(0,Math.min(T.offsetWidth,d.x+h.left-g.left))+"px";if(a)lb.style.top=d.y+"px",lb.style.left=(f.lineWrapping?Math.min(d.x,jb.offsetWidth):d.x)+"px",lb.style.display="",mb.style.display="none";else{var i=b.y==c.y,j="",k=jb.clientWidth||jb.offsetWidth,l=jb.clientHeight||jb.offsetHeight;function m(a,b,c,d){var e=O?"width: "+(c?k-c-a:k)+"px":"right: "+c+"px";j+='
    '}if(wb.from.ch&&b.y>=0){var n=i?k-c.x:0;m(b.x,b.y,n,e)}var o=Math.max(0,b.y+(wb.from.ch?e:0)),p=Math.min(c.y,l)-o;p>.2*e&&m(0,o,0,p),(!i||!wb.from.ch)&&c.yc||h>g.text.length)h=g.text.length;return{line:d,ch:h}}d+=b}}var e=Yb(a.line),f=a.ch==e.text.length&&a.ch!=c;return e.hidden?a.line>=b?d(1)||d(-1):d(-1)||d(1):a}function Sc(a,b,c){var d=Uc({line:a,ch:b||0});(c?Pc:Qc)(d,d)}function Tc(a){return Math.max(0,Math.min(a,tb.size-1))}function Uc(a){if(a.line<0)return{line:0,ch:0};if(a.line>=tb.size)return{line:tb.size-1,ch:Yb(tb.size-1).text.length};var b=a.ch,c=Yb(a.line).text.length;return b==null||b>c?{line:a.line,ch:c}:b<0?{line:a.line,ch:0}:a}function Vc(a,b){function g(){for(var b=d+a,c=a<0?-1:tb.size;b!=c;b+=a){var e=Yb(b);if(!e.hidden)return d=b,f=e,!0}}function h(b){if(e==(a<0?0:f.text.length)){if(!!b||!g())return!1;e=a<0?f.text.length:0}else e+=a;return!0}var c=wb.inverted?wb.from:wb.to,d=c.line,e=c.ch,f=Yb(d);if(b=="char")h();else if(b=="column")h(!0);else if(b=="word"){var i=!1;for(;;){if(a<0&&!h())break;if(eb(f.text.charAt(e)))i=!0;else if(i){a<0&&(a=1,h());break}if(a>0&&!h())break}}return{line:d,ch:e}}function Wc(a,b){var c=a<0?wb.from:wb.to;if(xb||Z(wb.from,wb.to))c=Vc(a,b);Sc(c.line,c.ch,!0)}function Xc(a,b){Z(wb.from,wb.to)?a<0?tc("",Vc(a,b),wb.to):tc("",wb.from,Vc(a,b)):tc("",wb.from,wb.to),Fb=!0}function Zc(a,b){var c=0,d=vd(wb.inverted?wb.from:wb.to,!0);Yc!=null&&(d.x=Yc),b=="page"?c=Math.min(T.clientHeight,window.innerHeight||document.documentElement.clientHeight):b=="line"&&(c=Bd());var e=wd(d.x,d.y+c*a+2);b=="page"&&(T.scrollTop+=vd(e,!0).y-d.y),Sc(e.line,e.ch,!0),Yc=d.x}function $c(a){var b=Yb(a.line).text,c=a.ch,d=a.ch;while(c>0&&eb(b.charAt(c-1)))--c;while(dRb.length&&(Rb=a.text)});Gb.push({from:0,to:tb.size})}function fd(a){var b=f.tabSize-a%f.tabSize,c=Tb[b];if(c)return c;for(var d='',e=0;e",width:b}}function gd(){T.className=T.className.replace(/\s*cm-s-\S+/g,"")+f.theme.replace(/(^|\s)\s*/g," cm-s-")}function hd(){this.set=[]}function id(a,b,c){function e(a,b,c,e){Yb(a).addMark(new p(b,c,e,d))}a=Uc(a),b=Uc(b);var d=new hd;if(!$(a,b))return d;if(a.line==b.line)e(a.line,a.ch,b.ch,c);else{e(a.line,a.ch,null,c);for(var f=a.line+1,g=b.line;f=a.ch)&&b.push(f.marker||f)}return b}function ld(a,b,c){return typeof a=="number"&&(a=Yb(Tc(a))),a.gutterMarker={text:b,style:c},Kb=!0,a}function md(a){typeof a=="number"&&(a=Yb(Tc(a))),a.gutterMarker=null,Kb=!0}function nd(a,b){var c=a,d=a;return typeof a=="number"?d=Yb(Tc(a)):c=w(a),c==null?null:b(d,c)?(Gb.push({from:c,to:c+1}),d):null}function od(a,b,c){return nd(a,function(a){if(a.className!=b||a.bgClassName!=c)return a.className=b,a.bgClassName=c,!0})}function pd(a,b){return nd(a,function(a,c){if(a.hidden!=b){a.hidden=b,Zb(a,b?0:1);var d=wb.from.line,e=wb.to.line;if(b&&(d==c||e==c)){var f=d==c?Rc({line:d,ch:0},d,0):wb.from,g=e==c?Rc({line:e,ch:0},e,0):wb.to;if(!g)return;Qc(f,g)}return Kb=!0}})}function qd(a){if(typeof a=="number"){if(!Wb(a))return null;var b=a;a=Yb(a);if(!a)return null}else{var b=w(a);if(b==null)return null}var c=a.gutterMarker;return{line:b,handle:a,text:a.text,markerText:c&&c.text,markerClass:c&&c.style,lineClass:a.className,bgClass:a.bgClassName}}function rd(a){return kb.innerHTML="
    x
    ",kb.firstChild.firstChild.firstChild.nodeValue=a,kb.firstChild.firstChild.offsetWidth||10}function sd(a,b){function e(a){return kb.innerHTML="
    "+c.getHTML(fd,a)+"
    ",kb.firstChild.firstChild.offsetWidth}if(b<=0)return 0;var c=Yb(a),d=c.text,f=0,g=0,h=d.length,i,j=Math.min(h,Math.ceil(b/Ed()));for(;;){var k=e(j);if(!(k<=b&&ji)return h;j=Math.floor(h*.8),k=e(j),kb-g?f:h;var l=Math.ceil((f+h)/2),m=e(l);m>b?(h=l,i=m):(f=l,g=m)}}function ud(a,b){if(b==0)return{top:0,left:0};var c="";if(f.lineWrapping){var d=a.text.indexOf(" ",b+6);c=bb(a.text.slice(b+1,d<0?a.text.length:d+(M?5:0)))}kb.innerHTML="
    "+a.getHTML(fd,b)+''+bb(a.text.charAt(b)||" ")+""+c+"
    ";var e=document.getElementById("CodeMirror-temp-"+td),g=e.offsetTop,h=e.offsetLeft;if(M&&g==0&&h==0){var i=document.createElement("span");i.innerHTML="x",e.parentNode.insertBefore(i,e.nextSibling),g=i.offsetTop}return{top:g,left:h}}function vd(a,b){var c,d=Bd(),e=d*(y(tb,a.line)-(b?Mb:0));if(a.ch==0)c=0;else{var g=ud(Yb(a.line),a.ch);c=g.left,f.lineWrapping&&(e+=Math.max(0,g.top))}return{x:c,y:e,yBot:e+d}}function wd(a,b){function l(a){var b=ud(h,a);if(j){var d=Math.round(b.top/c);return Math.max(0,b.left+(d-k)*T.clientWidth)}return b.left}b<0&&(b=0);var c=Bd(),d=Ed(),e=Mb+Math.floor(b/c),g=x(tb,e);if(g>=tb.size)return{line:tb.size-1,ch:Yb(tb.size-1).text.length};var h=Yb(g),i=h.text,j=f.lineWrapping,k=j?e-y(tb,g):0;if(a<=0&&k==0)return{line:g,ch:0};var m=0,n=0,o=i.length,p,q=Math.min(o,Math.ceil((a+k*T.clientWidth*.9)/d));for(;;){var r=l(q);if(!(r<=a&&qp)return{line:g,ch:o};q=Math.floor(o*.8),r=l(q),ra-n?m:o};var s=Math.ceil((m+o)/2),t=l(s);t>a?(o=s,p=t):(m=s,n=t)}}function xd(a){var b=vd(a,!0),c=W(jb);return{x:c.left+b.x,y:c.top+b.y,yBot:c.top+b.yBot}}function Bd(){if(Ad==null){Ad="
    ";for(var a=0;a<49;++a)Ad+="x
    ";Ad+="x
    "}var b=nb.clientHeight;return b==zd?yd:(zd=b,kb.innerHTML=Ad,yd=kb.firstChild.offsetHeight/50||1,kb.innerHTML="",yd)}function Ed(){return T.clientWidth==Dd?Cd:(Dd=T.clientWidth,Cd=rd("x"))}function Fd(){return jb.offsetTop}function Gd(){return jb.offsetLeft}function Hd(a,b){var c=W(T,!0),d,e;try{d=a.clientX,e=a.clientY}catch(a){return null}if(!b&&(d-c.left>T.clientWidth||e-c.top>T.clientHeight))return null;var f=W(jb,!0);return wd(d-f.left,e-f.top)}function Id(a){function f(){var a=fb(D.value).join("\n");a!=e&&Ud(uc)(a,"end"),A.style.position="relative",D.style.cssText=d,N&&(T.scrollTop=c),Jb=!1,Dc(!0),zc()}var b=Hd(a),c=T.scrollTop;if(!b||window.opera)return;(Z(wb.from,wb.to)||$(b,wb.from)||!$(b,wb.to))&&Ud(Sc)(b.line,b.ch);var d=D.style.cssText;A.style.position="absolute",D.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Jb=!0;var e=D.value=xc();Ec(),Y(D);if(L){E(a);var g=I(window,"mouseup",function(){g(),setTimeout(f,20)},!0)}else setTimeout(f,50)}function Jd(){clearInterval(rb);var a=!0;lb.style.visibility="",rb=setInterval(function(){lb.style.visibility=(a=!a)?"":"hidden"},650)}function Ld(a){function p(a,b,c){if(!a.text)return;var d=a.styles,e=g?0:a.text.length-1,f;for(var i=g?0:d.length-2,j=g?d.length:-2;i!=j;i+=2*h){var k=d[i];if(d[i+1]!=null&&d[i+1]!=m){e+=h*k.length;continue}for(var l=g?0:k.length-1,p=g?k.length:-1;l!=p;l+=h,e+=h)if(e>=b&&e"==g)n.push(f);else{if(n.pop()!=q.charAt(0))return{pos:e,match:!1};if(!n.length)return{pos:e,match:!0}}}}}var b=wb.inverted?wb.from:wb.to,c=Yb(b.line),d=b.ch-1,e=d>=0&&Kd[c.text.charAt(d)]||Kd[c.text.charAt(++d)];if(!e)return;var f=e.charAt(0),g=e.charAt(1)==">",h=g?1:-1,i=c.styles;for(var j=d+1,k=0,l=i.length;ke;--d){if(d==0)return 0;var g=Yb(d-1);if(g.stateAfter)return d;var h=g.indentation(f.tabSize);if(c==null||b>h)c=d-1,b=h}return c}function Nd(a){var b=Md(a),c=b&&Yb(b-1).stateAfter;return c?c=m(sb,c):c=n(sb),tb.iter(b,a,function(a){a.highlight(sb,c,f.tabSize),a.stateAfter=m(sb,c)}),b=tb.size)continue;var d=Md(c),e=d&&Yb(d-1).stateAfter;e?e=m(sb,e):e=n(sb);var g=0,h=sb.compareStates,i=!1,j=d,k=!1;tb.iter(j,tb.size,function(b){var d=b.stateAfter;if(+(new Date)>a)return ub.push(j),Qd(f.workDelay),i&&Gb.push({from:c,to:j+1}),k=!0;var l=b.highlight(sb,e,f.tabSize);l&&(i=!0),b.stateAfter=m(sb,e);var n=null;if(h){var o=d&&h(d,e);o!=K&&(n=!!o)}n==null&&(l!==!1||!d?g=0:++g>3&&(!sb.indent||sb.indent(d,"")==sb.indent(e,""))&&(n=!0));if(n)return!0;++j});if(k)return;i&&Gb.push({from:c,to:j+1})}b&&f.onHighlightComplete&&f.onHighlightComplete(Xb)}function Qd(a){if(!ub.length)return;qb.set(a,Ud(Pd))}function Rd(){Eb=Fb=Hb=null,Gb=[],Ib=!1,Lb=[]}function Sd(){var a=!1,b;Ib&&(a=!Gc()),Gb.length?b=Jc(Gb,!0):(Ib&&Nc(),Kb&&Mc()),a&&Gc(),Ib&&(Fc(),Jd()),vb&&!Jb&&(Eb===!0||Eb!==!1&&Ib)&&Dc(Fb),Ib&&f.matchBrackets&&setTimeout(Ud(function(){Qb&&(Qb(),Qb=null),Z(wb.from,wb.to)&&Ld(!1)}),20);var c=Hb,d=Lb;Ib&&f.onCursorActivity&&f.onCursorActivity(Xb),c&&f.onChange&&Xb&&f.onChange(Xb,c);for(var e=0;eh&&a.y>b.offsetHeight&&(f=a.y-b.offsetHeight),g+b.offsetWidth>i&&(g=i-b.offsetWidth)}b.style.top=f+Fd()+"px",b.style.left=b.style.right="",e=="right"?(g=U.clientWidth-b.offsetWidth,b.style.right="0px"):(e=="left"?g=0:e=="middle"&&(g=(U.clientWidth-b.offsetWidth)/2),b.style.left=g+Gd()+"px"),c&&Hc(g,f,g+b.offsetWidth,f+b.offsetHeight)},lineCount:function(){return tb.size},clipPos:Uc,getCursor:function(a){return a==null&&(a=wb.inverted),_(a?wb.from:wb.to)},somethingSelected:function(){return!Z(wb.from,wb.to)},setCursor:Ud(function(a,b,c){b==null&&typeof a.line=="number"?Sc(a.line,a.ch,c):Sc(a,b,c)}),setSelection:Ud(function(a,b,c){(c?Pc:Qc)(Uc(a),Uc(b||a))}),getLine:function(a){if(Wb(a))return Yb(a).text},getLineHandle:function(a){if(Wb(a))return Yb(a)},setLine:Ud(function(a,b){Wb(a)&&tc(b,{line:a,ch:0},{line:a,ch:Yb(a).text.length})}),removeLine:Ud(function(a){Wb(a)&&tc("",{line:a,ch:0},Uc({line:a+1,ch:0}))}),replaceRange:Ud(tc),getRange:function(a,b){return wc(Uc(a),Uc(b))},triggerOnKeyDown:Ud(jc),execCommand:function(a){return h[a](Xb)},moveH:Ud(Wc),deleteH:Ud(Xc),moveV:Ud(Zc),toggleOverwrite:function(){Cb?(Cb=!1,lb.className=lb.className.replace(" CodeMirror-overwrite","")):(Cb=!0,lb.className+=" CodeMirror-overwrite")},posFromIndex:function(a){var b=0,c;return tb.iter(0,tb.size,function(d){var e=d.text.length+1;if(e>a)return c=a,!0;a-=e,++b}),Uc({line:b,ch:c})},indexFromPos:function(a){if(a.line<0||a.ch<0)return 0;var b=a.ch;return tb.iter(0,a.line,function(a){b+=a.text.length+1}),b},scrollTo:function(a,b){a!=null&&(T.scrollLeft=a),b!=null&&(T.scrollTop=b),Jc([])},operation:function(a){return Ud(a)()},compoundChange:function(a){return Vd(a)},refresh:function(){Jc(!0),T.scrollHeight>Ab&&(T.scrollTop=Ab)},getInputField:function(){return D},getWrapperElement:function(){return s},getScrollerElement:function(){return T},getGutterElement:function(){return ab}},hc=null,ic,yc=!1,Bc="",Yc=null;hd.prototype.clear=Ud(function(){var a=Infinity,b=-Infinity;for(var c=0,d=this.set.length;c",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},Td=0;for(var Wd in g)g.propertyIsEnumerable(Wd)&&!Xb.propertyIsEnumerable(Wd)&&(Xb[Wd]=g[Wd]);return Xb}function j(a){return typeof a=="string"?i[a]:a}function k(a,b,c,d){function e(b){b=j(b);var c=b[a];if(c!=null&&d(c))return!0;if(b.catchall)return d(b.catchall);var f=b.fallthrough;if(f==null)return!1;if(Object.prototype.toString.call(f)!="[object Array]")return e(f);for(var g=0,h=f.length;ga&&d.push(h.slice(a-f,Math.min(h.length,b-f)),c[e+1]),i>=a&&(g=1)):g==1&&(i>b?d.push(h.slice(0,b-f),c[e+1]):d.push(h,c[e+1])),f=i}}function t(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;b=0&&d>=0;--c,--d)if(a.charAt(c)!=b.charAt(d))break;return d+1}function db(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c2){c.dependencies=[];for(var d=2;d0&&b.ch=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.posb},eatSpace:function(){var a=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},backUp:function(a){this.pos-=a},column:function(){return U(this.string,this.start,this.tabSize)},indentation:function(){return U(this.string,null,this.tabSize)},match:function(a,b,c){if(typeof a!="string"){var e=this.string.slice(this.pos).match(a);return e&&b!==!1&&(this.pos+=e[0].length),e}function d(a){return c?a.toLowerCase():a}if(d(this.string).indexOf(d(a),this.pos)==this.pos)return b!==!1&&(this.pos+=a.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},a.StringStream=o,p.prototype={attach:function(a){this.marker.set.push(a)},detach:function(a){var b=db(this.marker.set,a);b>-1&&this.marker.set.splice(b,1)},split:function(a,b){if(this.to<=a&&this.to!=null)return null;var c=this.fromthis.from&&(d=b&&(this.from=Math.max(d,this.from)+e),c&&(bthis.from||this.from==null)?this.to=null:this.to!=null&&this.to>b&&(this.to=d=this.to},sameSet:function(a){return this.marker==a.marker}},q.prototype={attach:function(a){this.line=a},detach:function(a){this.line==a&&(this.line=null)},split:function(a,b){if(athis.to},clipTo:function(a,b,c,d,e){(a||bthis.to)?(this.from=0,this.to=-1):this.from>b&&(this.from=this.to=Math.max(d,this.from)+e)},sameSet:function(a){return!1},find:function(){return!this.line||!this.line.parent?null:{line:w(this.line),ch:this.from}},clear:function(){if(this.line){var a=db(this.line.marked,this);a!=-1&&this.line.marked.splice(a,1),this.line=null}}},r.inheritMarks=function(a,b){var c=new r(a),d=b&&b.marked;if(d)for(var e=0;e5e3){e[f++]=this.text.slice(d.pos),e[f++]=null;break}}return e.length!=f&&(e.length=f,g=!0),f&&e[f-2]!=i&&(g=!0),g||(e.length<5&&this.text.length<10?null:!1)},getTokenAt:function(a,b,c){var d=this.text,e=new o(d);while(e.pos',g,"
    "):c.push(g)}function k(a){return a?"cm-"+a.replace(/ +/g," cm-"):null}var c=[],d=!0,e=0,g=this.styles,h=this.text,i=this.marked,j=h.length;b!=null&&(j=Math.min(b,j));if(!h&&b==null)f(" ");else if(!i||!i.length)for(var l=0,m=0;mj&&(n=n.slice(0,j-m)),m+=p,f(n,k(o))}else{var q=0,l=0,r="",o,s=0,t=i[0].from||0,u=[],v=0;function w(){var a;while(vy?r.slice(0,y-q):r,A);if(z>=y){r=r.slice(y-q),q=y;break}q=z}r=g[l++],o=k(g[l++])}}}return c.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var a=0,b=this.marked.length;a50){while(f.lines.length>50){var h=f.lines.splice(f.lines.length-25,25),i=new t(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(this.children.length<=10)return;var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new u(b);if(!a.parent){var d=new u(a.children);d.parent=a,a.children=[d,c],a=d}else{a.size-=c.size,a.height-=c.height;var e=db(a.parent.children,a);a.parent.children.splice(e+1,0,c)}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b,c){for(var d=0,e=this.children.length;d400||!f||this.closed||f.start>a+c.length||f.start+f.added0;--j)f.old.unshift(c[j-1]);for(var j=i;j>0;--j)f.old.push(c[c.length-j]);h&&(f.start=a),f.added+=b-(c.length-h-i)}this.time=d},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},a.e_stop=E,a.e_preventDefault=C,a.e_stopPropagation=D,a.connect=I,J.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}};var K=a.Pass={toString:function(){return"CodeMirror.Pass"}},L=/gecko\/\d{7}/i.test(navigator.userAgent),M=/MSIE \d/.test(navigator.userAgent),N=/MSIE [1-8]\b/.test(navigator.userAgent),O=M&&document.documentMode==5,P=/WebKit\//.test(navigator.userAgent),Q=/Chrome\//.test(navigator.userAgent),R=/KHTML\//.test(navigator.userAgent),S=function(){if(N)return!1;var a=document.createElement("div");return"draggable"in a||"dragDrop"in a}(),T="\n";(function(){var a=document.createElement("textarea");a.value="foo\nbar",a.value.indexOf("\r")>-1&&(T="\r\n")})(),document.documentElement.getBoundingClientRect!=null&&(W=function(a,b){try{var c=a.getBoundingClientRect();c={top:c.top,left:c.left}}catch(d){c={top:0,left:0}}if(!b)if(window.pageYOffset==null){var e=document.documentElement||document.body.parentNode;e.scrollTop==null&&(e=document.body),c.top+=e.scrollTop,c.left+=e.scrollLeft}else c.top+=window.pageYOffset,c.left+=window.pageXOffset;return c});var ab=document.createElement("pre");bb("a")=="\na"?bb=function(a){return ab.textContent=a,ab.innerHTML.slice(1)}:bb(" ")!=" "&&(bb=function(a){return ab.innerHTML="",ab.appendChild(document.createTextNode(a)),ab.innerHTML}),a.htmlEscape=bb;var fb="\n\nb".split(/\n/).length!=3?function(a){var b=0,c,d=[];while((c=a.indexOf("\n",b))>-1)d.push(a.slice(b,a.charAt(c-1)=="\r"?c-1:c)),b=c+1;return d.push(a.slice(b)),d}:function(a){return a.split(/\r?\n/)};a.splitLines=fb;var gb=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b||b.parentElement()!=a?!1:b.compareEndPoints("StartToEnd",b)!=0};a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var hb={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return a.keyNames=hb,function(){for(var a=0;a<10;a++)hb[a+48]=String(a);for(var a=65;a<=90;a++)hb[a]=String.fromCharCode(a);for(var a=1;a<=12;a++)hb[a+111]=hb[a+63235]="F"+a}(),a}();CodeMirror.defineMode("clike",function(a,b){function k(a,b){var c=a.next();if(g[c]){var h=g[c](a,b);if(h!==!1)return h}if(c=='"'||c=="'")return b.tokenize=l(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return j=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if(c=="/"){if(a.eat("*"))return b.tokenize=m,m(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(i.test(c))return a.eatWhile(i),"operator";a.eatWhile(/[\w\$_]/);var k=a.current();return d.propertyIsEnumerable(k)?(e.propertyIsEnumerable(k)&&(j="newstatement"),"keyword"):f.propertyIsEnumerable(k)?"atom":"word"}function l(a){return function(b,c){var d=!1,e,f=!1;while((e=b.next())!=null){if(e==a&&!d){f=!0;break}d=!d&&e=="\\"}if(f||!d&&!h)c.tokenize=null;return"string"}}function m(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=null;break}c=d=="*"}return"comment"}function n(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function o(a,b,c){return a.context=new n(a.indented,b,c,null,a.context)}function p(a){var b=a.context.type;if(b==")"||b=="]"||b=="}")a.indented=a.context.indented;return a.context=a.context.prev}var c=a.indentUnit,d=b.keywords||{},e=b.blockKeywords||{},f=b.atoms||{},g=b.hooks||{},h=b.multiLineStrings,i=/[+\-*&%=<>!?|\/]/,j;return{startState:function(a){return{tokenize:null,context:new n((a||0)-c,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;a.sol()&&(c.align==null&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0);if(a.eatSpace())return null;j=null;var d=(b.tokenize||k)(a,b);if(d=="comment"||d=="meta")return d;c.align==null&&(c.align=!0);if(j!=";"&&j!=":"||c.type!="statement")if(j=="{")o(b,a.column(),"}");else if(j=="[")o(b,a.column(),"]");else if(j=="(")o(b,a.column(),")");else if(j=="}"){while(c.type=="statement")c=p(b);c.type=="}"&&(c=p(b));while(c.type=="statement")c=p(b)}else j==c.type?p(b):(c.type=="}"||c.type=="top"||c.type=="statement"&&j=="newstatement")&&o(b,a.column(),"statement");else p(b);return b.startOfLine=!1,d},indent:function(a,b){if(a.tokenize!=k&&a.tokenize!=null)return 0;var d=a.context,e=b&&b.charAt(0);d.type=="statement"&&e=="}"&&(d=d.prev);var f=e==d.type;return d.type=="statement"?d.indented+(e=="{"?0:c):d.align?d.column+(f?0:1):d.indented+(f?0:c)},electricChars:"{}"}}),function(){function a(a){var b={},c=a.split(" ");for(var d=0;d*\/]/.test(c)?d(null,"select-op"):/[;{}:\[\]]/.test(c)?d(null,c):(a.eatWhile(/[\w\\\-]/),d("variable","variable")):d(null,"compare");d(null,"compare")}function f(a,b){var c=!1,f;while((f=a.next())!=null){if(c&&f=="/"){b.tokenize=e;break}c=f=="*"}return d("comment","comment")}function g(a,b){var c=0,f;while((f=a.next())!=null){if(c>=2&&f==">"){b.tokenize=e;break}c=f=="-"?c+1:0}return d("comment","comment")}function h(a){return function(b,c){var f=!1,g;while((g=b.next())!=null){if(g==a&&!f)break;f=!f&&g=="\\"}return f||(c.tokenize=e),d("string","string")}}var b=a.indentUnit,c;return{startState:function(a){return{tokenize:e,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];if(c=="hash"&&e!="rule")d="string-2";else if(d=="variable")if(e=="rule")d="number";else if(!e||e=="@media{")d="tag";return e=="rule"&&/^[\{\};]$/.test(c)&&b.stack.pop(),c=="{"?e=="@media"?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):c=="}"?b.stack.pop():c=="@media"?b.stack.push("@media"):e=="{"&&c!="comment"&&b.stack.push("rule"),d},indent:function(a,c){var d=a.stack.length;return/^\}/.test(c)&&(d-=a.stack[a.stack.length-1]=="rule"?2:1),a.baseIndent+d*b},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlembedded",function(a,b){function g(a,b){return a.match(c,!1)?(b.token=h,e.token(a,b.scriptState)):f.token(a,b.htmlState)}function h(a,b){return a.match(d,!1)?(b.token=g,f.token(a,b.htmlState)):e.token(a,b.scriptState)}var c=b.scriptStartRegex||/^<%/i,d=b.scriptEndRegex||/^%>/i,e,f;return{startState:function(){return e=e||CodeMirror.getMode(a,b.scriptingModeSpec),f=f||CodeMirror.getMode(a,"htmlmixed"),{token:b.startOpen?h:g,htmlState:f.startState(),scriptState:e.startState()}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==g?f.indent(a.htmlState,b):e.indent(a.scriptState,b)},copyState:function(a){return{token:a.token,htmlState:CodeMirror.copyState(f,a.htmlState),scriptState:CodeMirror.copyState(e,a.scriptState)}},electricChars:"/{}:"}},"htmlmixed"),CodeMirror.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),CodeMirror.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),CodeMirror.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),CodeMirror.defineMode("htmlmixed",function(a,b){function f(a,b){var f=c.token(a,b.htmlState);return f=="tag"&&a.current()==">"&&b.htmlState.context&&(/^script$/i.test(b.htmlState.context.tagName)?(b.token=h,b.localState=d.startState(c.indent(b.htmlState,"")),b.mode="javascript"):/^style$/i.test(b.htmlState.context.tagName)&&(b.token=i,b.localState=e.startState(c.indent(b.htmlState,"")),b.mode="css")),f}function g(a,b,c){var d=a.current(),e=d.search(b);return e>-1&&a.backUp(d.length-e),c}function h(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=f,b.localState=null,b.mode="html",f(a,b)):g(a,/<\/\s*script\s*>/,d.token(a,b.localState))}function i(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=f,b.localState=null,b.mode="html",f(a,b)):g(a,/<\/\s*style\s*>/,e.token(a,b.localState))}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"javascript"),e=CodeMirror.getMode(a,"css");return{startState:function(){var a=c.startState();return{token:f,localState:null,mode:"html",htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.token==i?e:d,a.localState);return{token:a.token,localState:b,mode:a.mode,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==f||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.token==h?d.indent(a.localState,b):e.indent(a.localState,b)},compareStates:function(a,b){return a.mode!=b.mode?!1:a.localState?CodeMirror.Pass:c.compareStates(a.htmlState,b.htmlState)},electricChars:"/{}:"}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(a,b){function g(a,b,c){return b.tokenize=c,c(a,b)}function h(a,b){var c=!1,d;while((d=a.next())!=null){if(d==b&&!c)return!1;c=!c&&d=="\\"}return c}function k(a,b,c){return i=a,j=c,b}function l(a,b){var c=a.next();if(c=='"'||c=="'")return g(a,b,m(c));if(/[\[\]{}\(\),;\:\.]/.test(c))return k(c);if(c=="0"&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),k("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),k("number","number");if(c=="/")return a.eat("*")?g(a,b,n):a.eat("/")?(a.skipToEnd(),k("comment","comment")):b.reAllowed?(h(a,"/"),a.eatWhile(/[gimy]/),k("regexp","string-2")):(a.eatWhile(f),k("operator",null,a.current()));if(c=="#")return a.skipToEnd(),k("error","error");if(f.test(c))return a.eatWhile(f),k("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),i=e.propertyIsEnumerable(d)&&e[d];return i&&b.kwAllowed?k(i.type,i.style,d):k("variable","variable",d)}function m(a){return function(b,c){return h(b,a)||(c.tokenize=l),k("string","string")}}function n(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=l;break}c=d=="*"}return k("comment","comment")}function p(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,d!=null&&(this.align=d)}function q(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function r(a,b,c,e,f){var g=a.cc;s.state=a,s.stream=f,s.marked=null,s.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;){var h=g.length?g.pop():d?D:C;if(h(c,e)){while(g.length&&g[g.length-1].lex)g.pop()();return s.marked?s.marked:c=="variable"&&q(a,e)?"variable-2":b}}}function t(){for(var a=arguments.length-1;a>=0;a--)s.cc.push(arguments[a])}function u(){return t.apply(null,arguments),!0}function v(a){var b=s.state;if(b.context){s.marked="def";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function x(){s.state.context||(s.state.localVars=w),s.state.context={prev:s.state.context,vars:s.state.localVars}}function y(){s.state.localVars=s.state.context.vars,s.state.context=s.state.context.prev}function z(a,b){var c=function(){var c=s.state;c.lexical=new p(c.indented,s.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function A(){var a=s.state;a.lexical.prev&&(a.lexical.type==")"&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function B(a){return function(c){return c==a?u():a==";"?t():u(arguments.callee)}}function C(a){return a=="var"?u(z("vardef"),L,B(";"),A):a=="keyword a"?u(z("form"),D,C,A):a=="keyword b"?u(z("form"),C,A):a=="{"?u(z("}"),K,A):a==";"?u():a=="function"?u(R):a=="for"?u(z("form"),B("("),z(")"),N,B(")"),A,C,A):a=="variable"?u(z("stat"),G):a=="switch"?u(z("form"),D,z("}","switch"),B("{"),K,A,A):a=="case"?u(D,B(":")):a=="default"?u(B(":")):a=="catch"?u(z("form"),x,B("("),S,B(")"),C,A,y):t(z("stat"),D,B(";"),A)}function D(a){return o.hasOwnProperty(a)?u(F):a=="function"?u(R):a=="keyword c"?u(E):a=="("?u(z(")"),E,B(")"),A,F):a=="operator"?u(D):a=="["?u(z("]"),J(D,"]"),A,F):a=="{"?u(z("}"),J(I,"}"),A,F):u()}function E(a){return a.match(/[;\}\)\],]/)?t():t(D)}function F(a,b){if(a=="operator"&&/\+\+|--/.test(b))return u(F);if(a=="operator")return u(D);if(a==";")return;if(a=="(")return u(z(")"),J(D,")"),A,F);if(a==".")return u(H,F);if(a=="[")return u(z("]"),D,B("]"),A,F)}function G(a){return a==":"?u(A,C):t(F,B(";"),A)}function H(a){if(a=="variable")return s.marked="property",u()}function I(a){a=="variable"&&(s.marked="property");if(o.hasOwnProperty(a))return u(B(":"),D)}function J(a,b){function c(d){return d==","?u(a,c):d==b?u():u(B(b))}return function(e){return e==b?u():t(a,c)}}function K(a){return a=="}"?u():t(C,K)}function L(a,b){return a=="variable"?(v(b),u(M)):u()}function M(a,b){if(b=="=")return u(D,M);if(a==",")return u(L)}function N(a){return a=="var"?u(L,P):a==";"?t(P):a=="variable"?u(O):t(P)}function O(a,b){return b=="in"?u(D):u(F,P)}function P(a,b){return a==";"?u(Q):b=="in"?u(D):u(D,B(";"),Q)}function Q(a){a!=")"&&u(D)}function R(a,b){if(a=="variable")return v(b),u(R);if(a=="(")return u(z(")"),x,J(S,")"),A,C,y)}function S(a,b){if(a=="variable")return v(b),u()}var c=a.indentUnit,d=b.json,e=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"};return{"if":b,"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":f,"false":f,"null":f,"undefined":f,NaN:f,Infinity:f}}(),f=/[+\-*&%=<>!?|]/,i,j,o={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},s={state:null,column:null,marked:null,cc:null},w={name:"this",next:{name:"arguments"}};return A.lex=!0,{startState:function(a){return{tokenize:l,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new p((a||0)-c,0,"block",!1),localVars:b.localVars,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation());if(a.eatSpace())return null;var c=b.tokenize(a,b);return i=="comment"?c:(b.reAllowed=i=="operator"||i=="keyword c"||!!i.match(/^[\[{}\(,;:]$/),b.kwAllowed=i!=".",r(b,c,i,j,a))},indent:function(a,b){if(a.tokenize!=l)return 0;var d=b&&b.charAt(0),e=a.lexical,f=e.type,g=d==f;return f=="vardef"?e.indented+4:f=="form"&&d=="{"?e.indented:f=="stat"||f=="form"?e.indented+c:e.info=="switch"&&!g?e.indented+(/^(?:case|default)\b/.test(b)?c:2*c):e.align?e.column+(g?0:1):e.indented+(g?0:c)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("markdown",function(a,b){function s(a,b,c){return b.f=b.inline=c,c(a,b)}function t(a,b,c){return b.f=b.block=c,c(a,b)}function u(a){return a.em=!1,a.strong=!1,null}function v(a,b){var c;if(b.indentationDiff>=4)return b.indentation-=b.indentationDiff,a.skipToEnd(),e;if(a.eatSpace())return null;if(a.peek()==="#"||a.match(q))b.header=!0;else if(a.eat(">"))b.indentation++,b.quote=!0;else{if(a.peek()==="[")return s(a,b,C);if(a.match(n,!0))return h;if(c=a.match(o,!0)||a.match(p,!0))return b.indentation+=c[0].length,g}return s(a,b,b.inline)}function w(a,b){var d=c.token(a,b.htmlState);return d==="tag"&&b.htmlState.type!=="openTag"&&!b.htmlState.context&&(b.f=z,b.block=v),d}function x(a){var b=[];return a.strong?b.push(a.em?m:l):a.em&&b.push(k),a.header&&b.push(d),a.quote&&b.push(f),b.length?b.join(" "):null}function y(a,b){return a.match(r,!0)?x(b):undefined}function z(a,b){var c=b.text(a,b);if(typeof c!="undefined")return c;var d=a.next();if(d==="\\")return a.next(),x(b);if(d==="`")return s(a,b,F(e,"`"));if(d==="[")return s(a,b,A);if(d==="<"&&a.match(/^\w/,!1))return a.backUp(1),t(a,b,w);var f=x(b);return d==="*"||d==="_"?a.eat(d)?(b.strong=!b.strong)?x(b):f:(b.em=!b.em)?x(b):f:x(b)}function A(a,b){while(!a.eol()){var c=a.next();c==="\\"&&a.next();if(c==="]")return b.inline=b.f=B,i}return i}function B(a,b){a.eatSpace();var c=a.next();return c==="("||c==="["?s(a,b,F(j,c==="("?")":"]")):"error"}function C(a,b){return a.match(/^[^\]]*\]:/,!0)?(b.f=D,i):s(a,b,z)}function D(a,b){return a.eatSpace(),a.match(/^[^\s]+/,!0),b.f=b.inline=z,j}function E(a){return E[a]||(E[a]=new RegExp("^(?:[^\\\\\\"+a+"]|\\\\.)*(?:\\"+a+"|$)")),E[a]}function F(a,b,c){return c=c||z,function(d,e){return d.match(E(b)),e.inline=e.f=c,a}}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d="header",e="comment",f="quote",g="string",h="hr",i="link",j="string",k="em",l="strong",m="emstrong",n=/^([*\-=_])(?:\s*\1){2,}\s*$/,o=/^[*\-+]\s+/,p=/^[0-9]+\.\s+/,q=/^(?:\={3,}|-{3,})$/,r=/^[^\[*_\\<>`]+/;return{startState:function(){return{f:v,block:v,htmlState:c.startState(),indentation:0,inline:z,text:y,em:!1,strong:!1,header:!1,quote:!1}},copyState:function(a){return{f:a.f,block:a.block,htmlState:CodeMirror.copyState(c,a.htmlState),indentation:a.indentation,inline:a.inline,text:a.text,em:a.em,strong:a.strong,header:a.header,quote:a.quote}},token:function(a,b){if(a.sol()){if(a.match(/^\s*$/,!0))return u(b);b.header=!1,b.quote=!1,b.f=b.block;var c=a.match(/^\s*/,!0)[0].replace(/\t/g," ").length;b.indentationDiff=c-b.indentation,b.indentation=c;if(c>0)return null}return b.f(a,b)},blankLine:u,getType:x}},"xml"),CodeMirror.defineMIME("text/x-markdown","markdown"),function(){function a(a){var b={},c=a.split(" ");for(var d=0;d",!1))a.next();return"comment"},"/":function(a,b){if(a.eat("/")){while(!a.eol()&&!a.match("?>",!1))a.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(a,b){function h(a,b){var c=b.mode=="php";a.sol()&&b.pending!='"'&&(b.pending=null);if(b.curMode==d){if(a.match(/^<\?\w*/))return b.curMode=g,b.curState=b.php,b.curClose="?>",b.mode="php","meta";if(b.pending=='"'){while(!a.eol()&&a.next()!='"');var i="string"}else if(b.pending&&a.pos/.test(j)?b.pending='"':b.pending={end:a.pos,style:i},a.backUp(j.length-k)):i=="tag"&&a.current()==">"&&b.curState.context&&(/^script$/i.test(b.curState.context.tagName)?(b.curMode=e,b.curState=e.startState(d.indent(b.curState,"")),b.curClose=/^<\/\s*script\s*>/i,b.mode="javascript"):/^style$/i.test(b.curState.context.tagName)&&(b.curMode=f,b.curState=f.startState(d.indent(b.curState,"")),b.curClose=/^<\/\s*style\s*>/i,b.mode="css")),i}return(!c||b.php.tokenize==null)&&a.match(b.curClose,c)?(b.curMode=d,b.curState=b.html,b.curClose=null,b.mode="html",c?"meta":h(a,b)):b.curMode.token(a,b.curState)}var d=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),e=CodeMirror.getMode(a,"javascript"),f=CodeMirror.getMode(a,"css"),g=CodeMirror.getMode(a,c);return{startState:function(){var a=d.startState();return{html:a,php:g.startState(),curMode:b.startOpen?g:d,curState:b.startOpen?g.startState():a,curClose:b.startOpen?/^\?>/:null,mode:b.startOpen?"php":"html",pending:null}},copyState:function(a){var b=a.html,c=CodeMirror.copyState(d,b),e=a.php,f=CodeMirror.copyState(g,e),h;return a.curState==b?h=c:a.curState==e?h=f:h=CodeMirror.copyState(a.curMode,a.curState),{html:c,php:f,curMode:a.curMode,curState:h,curClose:a.curClose,mode:a.mode,pending:a.pending}},token:h,indent:function(a,b){return a.curMode!=g&&/^\s*<\//.test(b)||a.curMode==g&&/^\?>/.test(b)?d.indent(a.html,b):a.curMode.indent(a.curState,b)},electricChars:"/{}:"}},"xml","clike","javascript","css"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",c)}(),CodeMirror.defineMode("xml",function(a,b){function h(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if(d=="<"){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(k("atom","]]>")):null:a.match("--")?c(k("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(l(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=k("meta","?>"),"meta";g=a.eat("/")?"closeTag":"openTag",a.eatSpace(),f="";var e;while(e=a.eat(/[^\s\u00a0=<>\"\'\/?]/))f+=e;return b.tokenize=i,"tag"}if(d=="&"){var h;return a.eat("#")?a.eat("x")?h=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):h=a.eatWhile(/[\d]/)&&a.eat(";"):h=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),h?"atom":"error"}return a.eatWhile(/[^&<]/),null}function i(a,b){var c=a.next();return c==">"||c=="/"&&a.eat(">")?(b.tokenize=h,g=c==">"?"endTag":"selfcloseTag","tag"):c=="="?(g="equals",null):/[\'\"]/.test(c)?(b.tokenize=j(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function j(a){return function(b,c){while(!b.eol())if(b.next()==a){c.tokenize=i;break}return"string"}}function k(a,b){return function(c,d){while(!c.eol()){if(c.match(b)){d.tokenize=h;break}c.next()}return a}}function l(a){return function(b,c){var d;while((d=b.next())!=null){if(d=="<")return c.tokenize=l(a+1),c.tokenize(b,c);if(d==">"){if(a==1){c.tokenize=h;break}return c.tokenize=l(a-1),c.tokenize(b,c)}}return"meta"}}function o(){for(var a=arguments.length-1;a>=0;a--)m.cc.push(arguments[a])}function p(){return o.apply(null,arguments),!0}function q(a,b){var c=d.doNotIndent.hasOwnProperty(a)||m.context&&m.context.noIndent;m.context={prev:m.context,tagName:a,indent:m.indented,startOfLine:b,noIndent:c}}function r(){m.context&&(m.context=m.context.prev)}function s(a){if(a=="openTag")return m.tagName=f,p(w,t(m.startOfLine));if(a=="closeTag"){var b=!1;return m.context?m.context.tagName!=f&&(d.implicitlyClosed.hasOwnProperty(m.context.tagName.toLowerCase())&&r(),b=!m.context||m.context.tagName!=f):b=!0,b&&(n="error"),p(u(b))}return p()}function t(a){return function(b){return b=="selfcloseTag"||b=="endTag"&&d.autoSelfClosers.hasOwnProperty(m.tagName.toLowerCase())?(v(m.tagName.toLowerCase()),p()):b=="endTag"?(v(m.tagName.toLowerCase()),q(m.tagName,a),p()):p()}}function u(a){return function(b){return a&&(n="error"),b=="endTag"?(r(),p()):(n="error",p(arguments.callee))}}function v(a){var b;for(;;){if(!m.context)return;b=m.context.tagName.toLowerCase();if(!d.contextGrabbers.hasOwnProperty(b)||!d.contextGrabbers[b].hasOwnProperty(a))return;r()}}function w(a){return a=="word"?(n="attribute",p(x,w)):a=="endTag"||a=="selfcloseTag"?o():(n="error",p(w))}function x(a){return a=="equals"?p(y,w):(d.allowMissing||(n="error"),a=="endTag"||a=="selfcloseTag"?o():p())}function y(a){return a=="string"?p(z):a=="word"&&d.allowUnquoted?(n="string",p()):(n="error",a=="endTag"||a=="selfCloseTag"?o():p())}function z(a){return a=="string"?p(z):o()}var c=a.indentUnit,d=b.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},e=b.alignCDATA,f,g,m,n;return{startState:function(){return{tokenize:h,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(a,b){a.sol()&&(b.startOfLine=!0,b.indented=a.indentation());if(a.eatSpace())return null;n=g=f=null;var c=b.tokenize(a,b);b.type=g;if((c||g)&&c!="comment"){m=b;for(;;){var d=b.cc.pop()||s;if(d(g||c))break}}return b.startOfLine=!1,n||c},indent:function(a,b,d){var f=a.context;if(a.tokenize!=i&&a.tokenize!=h||f&&f.noIndent)return d?d.match(/^(\s*)/)[0].length:0;if(e&&/0);f=c(a,{line:d.line,ch:f.start});if(f.className!="variable")return;f.className="function"}if(!h)var h=[];h.push(f)}return{list:j(e,h,b),from:{line:d.line,ch:e.start},to:{line:d.line,ch:e.end}}}function d(a,b){var c=a.getTokenAt(b);return b.ch==c.start+1&&c.string.charAt(0)=="."?(c.end=c.start,c.string=".",c.className="property"):/^\.[\w$_]*$/.test(c.string)&&(c.className="property",c.start++,c.string=c.string.replace(/\./,"")),c}function j(c,d,h){function k(a){a.indexOf(j)==0&&!b(i,a)&&i.push(a)}function l(b){typeof b=="string"?a(e,k):b instanceof Array?a(f,k):b instanceof Function&&a(g,k);for(var c in b)k(c)}var i=[],j=c.string;if(d){var m=d.pop(),n;m.className=="variable"?n=window[m.string]:m.className=="string"?n="":m.className=="atom"?n=1:m.className=="function"&&(window.jQuery==null||m.string!="$"&&m.string!="jQuery"||typeof window.jQuery!="function"?window._!=null&&m.string=="_"&&typeof window._=="function"&&(n=window._()):n=window.jQuery());while(n!=null&&d.length)n=n[d.pop().string];n!=null&&l(n)}else{for(var o=c.state.localVars;o;o=o.next)k(o.name);l(window),a(h,k)}return i}CodeMirror.javascriptHint=function(a){return c(a,h,function(a,b){return a.getTokenAt(b)})},CodeMirror.coffeescriptHint=function(a){return c(a,i,d)};var e="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),f="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),g="prototype apply call bind".split(" "),h="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),i="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}(),CodeMirror.tagRangeFinder=function(a,b){var c="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",d=c+"-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",e=new RegExp("^["+c+"]["+d+"]*"),f=a.getLine(b),g=!1,h=null,i=0;while(!g){i=f.indexOf("<",i);if(-1==i)return;if(i+1",i+1);if(-1==j){var k=b+1,l=!1,m=a.lineCount();while(k");if(-1!=o){l=!0;var p=n.lastIndexOf("/",o);if(-1!=p&&p/))return k+1}}k++}g=!0}else{var r=f.lastIndexOf("/",j);if(-1==r)g=!0;else{var q=f.substr(r,j-r+1);q.match(/\/\s*\>/)||(g=!0)}}if(g){var s=f.substr(i+1);h=s.match(e),h?(h=h[0],-1!=f.indexOf("",i)&&(g=!1)):g=!1}g||i++}if(g){var t="(\\<\\/"+h+"\\>)|(\\<"+h+"\\>)|(\\<"+h+"\\s)|(\\<"+h+"$)",u=new RegExp(t,"g"),v="",w=1,k=b+1,m=a.lineCount();while(kd)return;var e=a.getTokenAt({line:b,ch:d}).className,f=1,g=a.lineCount(),h;a:for(var i=b+1;i▼%N%'),function(f,g){f.operation(function(){var h=d(f,g);if(h)c.splice(h.pos,1),e(f,h.region);else{var i=a(f,g);if(i==null)return;var j=[];for(var k=g+1;k",d}CodeMirror.defineExtension("openDialog",function(b,c){function g(){if(e)return;e=!0,d.parentNode.removeChild(d)}var d=a(this,b),e=!1,f=this,h=d.getElementsByTagName("input")[0];return h&&(CodeMirror.connect(h,"keydown",function(a){if(a.keyCode==13||a.keyCode==27)CodeMirror.e_stop(a),g(),f.focus(),a.keyCode==13&&c(h.value)}),h.focus(),CodeMirror.connect(h,"blur",g)),g}),CodeMirror.defineExtension("openConfirm",function(b,c){function i(){if(f)return;f=!0,d.parentNode.removeChild(d),g.focus()}var d=a(this,b),e=d.getElementsByTagName("button"),f=!1,g=this,h=1;e[0].focus();for(var j=0;j=g&&(h=f.lastIndexOf(b,d.ch-g))!=-1:(h=f.indexOf(b,d.ch))!=-1)return{from:{line:d.line,ch:h},to:{line:d.line,ch:h+g}}}:this.matches=function(b,c){var d=c.line,g=b?f.length-1:0,h=f[g],i=e(a.getLine(d)),j=b?i.indexOf(h)+h.length:i.lastIndexOf(h);if(b?j>=c.ch||j!=h.length:j<=c.ch||j!=i.length-h.length)return;for(;;){if(b?!d:d==a.lineCount()-1)return;i=e(a.getLine(d+=b?-1:1)),h=f[b?--g:++g];if(g>0&&g-1&&h>-1&&h>g&&(f=f.substr(0,g)+f.substring(g+d.commentStart.length,h)+f.substr(h+d.commentEnd.length)),this.replaceRange(f,b,c)}}),CodeMirror.defineExtension("autoIndentRange",function(a,b){var c=this;this.operation(function(){for(var d=a.line;d<=b.line;d++)c.indentLine(d,"smart")})}),CodeMirror.defineExtension("autoFormatRange",function(a,b){var c=this.indexFromPos(a),d=this.indexFromPos(b),e=this.getModeExt().autoFormatLineBreaks(this.getValue(),c,d),f=this;this.operation(function(){f.replaceRange(e,a,b);var d=f.posFromIndex(c).line,g=f.posFromIndex(c+e.length).line;for(var h=d;h<=g;h++)f.indentLine(h,"smart")})}),CodeMirror.modeExtensions.css={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],autoFormatLineBreaks:function(a){return a.replace(new RegExp("(;|\\{|\\})([^\r\n])","g"),"$1\n$2")}},CodeMirror.modeExtensions.javascript={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],getNonBreakableBlocks:function(a){var b=[new RegExp("for\\s*?\\(([\\s\\S]*?)\\)"),new RegExp("'([\\s\\S]*?)('|$)"),new RegExp('"([\\s\\S]*?)("|$)'),new RegExp("//.*([\r\n]|$)")],c=new Array;for(var d=0;db&&(e+=a.substring(b,d[f].start).replace(c,"$1\n$2"),b=d[f].start),d[f].start<=b&&d[f].end>=b&&(e+=a.substring(b,d[f].end),b=d[f].end);return b",wordWrapChars:[">"],autoFormatLineBreaks:function(a){var b=a.split("\n"),c=new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"),d=new RegExp("<","g"),e=new RegExp("(>)([^\r\n])","g");for(var f=0;f3){b[f]=g[1]+g[2].replace(d,"\n$&").replace(e,"$1\n$2")+g[3];continue}}return b.join("\n")}},CodeMirror.modeExtensions.htmlmixed={commentStart:"",wordWrapChars:[">",";","\\{","\\}"],getModeInfos:function(a,b){var c=new Array;c[0]={pos:0,modeExt:CodeMirror.modeExtensions.xml,modeName:"xml"};var d=new Array;d[0]={regex:new RegExp("]*>([\\s\\S]*?)(]*>|$)","i"),modeExt:CodeMirror.modeExtensions.css,modeName:"css"},d[1]={regex:new RegExp("]*>([\\s\\S]*?)(]*>|$)","i"),modeExt:CodeMirror.modeExtensions.javascript,modeName:"javascript"};var e=typeof b!="undefined"?b:a.length-1;for(var f=0;f1&&h[1].length>0){var i=g+h.index+h[0].indexOf(h[1]);c.push({pos:i,modeExt:d[f].modeExt,modeName:d[f].modeName}),c.push({pos:i+h[1].length,modeExt:c[0].modeExt,modeName:c[0].modeName}),g+=h.index+h[0].length;continue}g+=h.index+Math.max(h[0].length,1)}}return c.sort(function(b,c){return b.pos-c.pos}),c},autoFormatLineBreaks:function(a,b,c){var d=this.getModeInfos(a),e=new RegExp("^\\s*?\n"),f=new RegExp("\n\\s*?$"),g="";if(d.length>1)for(var h=1;h<=d.length;h++){var i=d[h-1].pos,j=h=c)break;if(ic&&(j=c);var k=a.substring(i,j);d[h-1].modeName!="xml"&&(!e.test(k)&&i>0&&(k="\n"+k),!f.test(k)&&j=f){var g=c(b),h=b.getSelection();b.operation(function(){if(b.lineCount()<2e3)for(var a=b.getSearchCursor(h);a.findNext();)(a.from().line!==b.getCursor(!0).line||a.from().ch!==b.getCursor(!0).ch)&&g.marked.push(b.markText(a.from(),a.to(),e))})}}var a=2;CodeMirror.defineExtension("matchHighlight",function(a,b){e(this,a,b)})}(),function(){function a(a,c,d,e){b(a,c,e)?(a.replaceSelection("\n\n","end"),a.indentLine(d.line+1),a.indentLine(d.line+2),a.setCursor({line:d.line+1,ch:a.getLine(d.line+1).length})):(a.replaceSelection(""),a.setCursor(d))}function b(a,b,d){if(typeof b=="undefined"||b==null||b==1)b=a.getOption("closeTagIndent");return b||(b=[]),c(b,d.toLowerCase())!=-1}function c(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c"),a.setCursor({line:b.line,ch:b.ch+c.length+2})}CodeMirror.defaults.closeTagEnabled=!0,CodeMirror.defaults.closeTagIndent=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"],CodeMirror.defineExtension("closeTag",function(b,c,e){if(!b.getOption("closeTagEnabled"))throw CodeMirror.Pass;var f=b.getOption("mode");if(f=="text/html"){var g=b.getCursor(),h=b.getTokenAt(g),i=h.state;if(i.mode&&i.mode!="html")throw CodeMirror.Pass;if(c==">"){var j=i.htmlState?i.htmlState.type:i.type;if(h.className=="tag"&&j=="closeTag")throw CodeMirror.Pass;b.replaceSelection(">"),g={line:g.line,ch:g.ch+1},b.setCursor(g),h=b.getTokenAt(b.getCursor()),i=h.state,j=i.htmlState?i.htmlState.type:i.type;if(h.className=="tag"&&j!="selfcloseTag"){var k=i.htmlState?i.htmlState.context.tagName:i.tagName;k.length>0&&a(b,e,g,k);return}b.setSelection({line:g.line,ch:g.ch-1},g),b.replaceSelection("")}else if(c=="/"&&h.className=="tag"&&h.string=="<"){var k=i.htmlState?i.htmlState.context?i.htmlState.context.tagName:"":i.context.tagName;if(k.length>0){d(b,g,k);return}}}else if(f=="xmlpure"){var g=b.getCursor(),h=b.getTokenAt(g),k=h.state.context.tagName;if(c==">"){if(h.string==k){b.replaceSelection(">"),g={line:g.line,ch:g.ch+1},b.setCursor(g),a(b,e,g,k);return}}else if(c=="/"&&h.string=="<"){d(b,g,k);return}}throw CodeMirror.Pass})}(),function(){function b(a,b){var c=b;return function(){--c==0&&a()}}function c(a,c){var d=CodeMirror.modes[a].dependencies;if(!d)return c();var e=[];for(var f=0;f100)return clearInterval(i);CodeMirror.modes.hasOwnProperty(b)&&(clearInterval(i),a[b]=null,c(b,function(){for(var a=0;a4IVU-}5Kb;YzPgZ*np^bZBV4q(oPb> z{bE2=RIK5mg%)j4+M;yqNkB!dPO!Aa4t4-9#hSMZY}bsg+PANr^{zFYch>5McYoL) z_x|wwf6w#my=t{qu`DkVhy?!O1waslAP9zG3WY+YQV|59)9EOR(r7dmi{*M3Y z+UnmrYg@r{$MM)$Qu~-}u5`yEnKp+SV43x=aK|w(Zg(5mS+Rx8VBoZxH zut2F)E?v4*E|)J_v}p0-#j94WTCrk9OiWBcLBX5gQwu zn3$+isWLM&wOVa*ajUb%8*Qc}{IHEU8+Q(;ev*Jfm7?A*EY)TvW?y*?`|Ys;1`Z@&5F z!Gj0$^YeG@+ST9R|MuH&A2@KpX0sI+7uVF(m`tXUl9HyTrfu7{9XfQVqN1X!tIOeV z?A^O}xmO5-gx7U+S=OY=H@^B=}#LrY^bZNd+oK?^78Vsv$I=T zS~hRqY&M%$uU>un^l7`@zJ2@l-Me?MU%&q9)vI^!-hKc5_eV!Z`}+FcdFP!EKKP)r zva+F}p{J+EYPD8ZS06rnxUjJB!Gi}yMMWbcBNs1TJa_Kg@#DwK%F14U{q?GFRoIH8*yYIepxm?4;!$*!BdF!pWZr!>yI5;>xJ>A~k?sPgkJ3II7 z+t=9G`0l&!e)7pDAAkIDcX#(^pMBQR(NSMtKRG#Ru~J zmw)@)-)`T&{qW(#_uhNYo*czk^P(xpoS0|USO^2^ZB z(7k*2?%%&ZH8pkR%9XFb{`$iYKYaG=+4bw!0RZ^**I!@l|Gy>rm6@8DnUSEZ&XU>cm zqBxMX-8VOzNnvVIZj3@@egvZN*+-y@sdwcGfG$g~$INS*4rclF9(ZshoSL7M*pKBU zsu*020Ke3I_xxfx&~*uRnQb5|Nr9Q&)*8mjRq00Vwy%O$qQV}T)IdU<$ev4?_^2)tfg7Fmk^J?SJMZHbfUd^;~hOh~_&l$&SsAZl)wPcXf7e*)pT{ z2{jmgAoZKw*P+0I(ZWVo;t)jV6Jt)$a)YTY#Fn-YLloQ3+Y12ZGJVla_57Du0wQeT zt9iHv@*B93+K<*)3dAPlAe0j2m4#fHYE2 zq<5x*2TwauR5~^>XrRQ)EpLmTY}M2DYua3KQ4)(ASTIJoRp2`|GjG|rGZl!EMx9}< zdP#=rna@RuZ%~GuSDT+|48wFiXtW+k{)H@i{i(w42KC@`klo{V83Vwc(KGFKZRC^A z&~i<;Dmb?$?QC=UXm>)Z`jMXa*9f2h3J8F}{~ZCL&YsKgLwJ#r7VT>lI*xROIce0%6mjls>?4mMwY!aFI8!h@w=tW9NOM5bf7MWn9qowI^#_{3ZWu?LwKoaC}eD;LKb1ksOfsRIbD zX=3%v)uY0;y7(FsW;Iy-XdxPbCC^O&>n=;9Zn1A1h3Ak5pO08hmC<7+oFw5t0a%Eb z8K(w}!9WW$?sKC#eU8IEUV!^GUZr?HpDAN{GqFMX0*+@0Q#cossM^>MV$m>-gXknK z3$a8nGFK@X*MGYzVp`&1$9fA%3R-FtDY^J)Q`1vf_8-b~pThY~9^JODE6W*lO|=+P zo!%J@2XT&arYcsn7@bNpvd*W3F%vTdra9_Y9(*-q%dDsP+M6Mo6x?nVC#@Vib?Ha2 zyw#8bGt6>~Jho5?I|qsGzaXleIn&FQZVevbRAz1wWS#NzS8*ZP&0ceG6_EDWB$sPX zeWYE21d&BaYvzdPKDZ(6{gY7|0ayJz3c0B!M!f}%8{}ppAf5*~NO3s{0Anh=sa$6l z$BZ3V*T1K%0^>-e0xO7Y6*fLYL4iyFhC!3Z%~;TzLHKCuuBIZ< zhU*|zkkW4lSH1N3D}5dgvjOg?gQo%e0rxifkokTI3o~TbQMTjmJz0^(XLeu+{0BS* zR|Wi2u*ZjN<;){ej*j36gP?4_8)!UbU3f0qnP3m~VU^Ikiuc}a%sm{te9T9hZMlCe z=k3_O82rp_cFC5BRwKBL&9qR^^PAIY+H_{Vw)fWE3YG8TYIti_=&B(y{EcCLw(Ac4 zP-EODJyEWOjp5q6pf-lN=k4QewT%q{dM5iehk0h9%13LEQr0J0c(7xYRY zo`t;$)I(IE^P(B?0lpq#6G9zS>+R_PsZUfeK>6<*1uCZM!XOCE%`oInP0#H1F?EkjZu*y*7$MFh1FNz042Z9Qk zQNvQrAzH~=?8u};Zw4*2Cd^IV@jdA`$6g&2WpojM%dk|doDaWxz8;=CB~ zniQWZK%ubbct|<}38)*3%Kxc$n3?U(4&C8<8po~ioV_-*7Q#LfE*?BN$}jPa>71Uy zE!PqG9(nJqWVb6os^AUHtfCLmLmNC<&nvPo#jjvk>&Xd9RTYyNi^T(=Mx5(ZB&OqX zvTlwb4#wq zc@OAps&~hbTyNf9C-g-n%P5sMb;rGuY1BOg4M2YMrowf#Nx?jNaH%3XVdAni?yJJI zM!8c(VSFt@qx5Ei#>v#6w*$rXvAahN)qIN8cP>#fL{1zK;mbD7m>NgRf+>7lAU94# zSrB1d{&Qm*=7KTif;tftl?dZL{?Eq#9+_Hi#e({p$r)=mWDQiGo7j6j^SuZq5<8X$ z#tl&YFy{l3o!T$*nh4s$FAcaJVD*>-l@TPa0z{?GRNoUV7a=7y=Apn8P;RIAXOg3^ znB_1p=ys0W1;V?q^@;EF?t^2m$tF3Vf5G)T0I$?(CNgD*6OtLSnXFAo^iCDm*Hrv) z^PzJDpj!2@#2m=uS%>pafS|*sv`14Q(~MVJxdC zO3Q7cT`9JR(j1j|wCvij)q1~9n9Y@Ia68$6hmYMiU&wQ{6B3welw$kg=sP#Q8B4pk&xLMq+i#4VsjzZFa1%%cgP4fDLiL|ve=Z-`w91QdG>T8*ubOT%t12q~Kqcl)PKCF6Hyps|X8s_9VQ*kro zjR6>6JgB^Fh1VNQjru%FbgD$UOGtv&D*R~de@iEaZ1nIDxN6#R9b1_2Qj_HntIMgJ zBvzFPu0QhE&F?w~085z_P7V!0MPl_%1X+}jqj0TdR#1qT1+JN4p`u^|HwSlFQ6KaK zen|A(ik8hQ#4PW-OCHyY3+brUv8Q;txW~EFDyl9H8sC5#;3?s{_|K6B0s9hKWXMr>5h6&?n=# zo?TKGFal`DJpo{8%U!V&cRI(_Pk*}Fa9HoKG$pfkKmJdY{*_AliSqpj&mRVeiOY;Q ze`%{?BC)yxjD8M?Fa)FW5V1LpVkH^T3a%mTVWQ3wq|Gt}0FS68Ay%MhrYRR>hU%TS zu!JdYsM_y@lWYvOapYL5AkU%Z_(6d&y?IT+W_qN!AI95Y3q*sOJ#7wvD#^KEE~vDF z)vUmDRQSpU0e*!^+E}!BvWyxANoBM1uGQFTkRV*%NK670Ox!{)v{C5`H=U3dlvUM> zCEU!enaKo-k5Bjy=ocM-pA!r%%gJ)GCzJW%@%9-f{xQMb4$Q9U7q70U7HWUV*QUh! zMXi(YW%;WzqF2NeqV*!hB-IwQ;abXpe8U^>6;GRReBwq*4MQ(9AI~VePZ4LdzAEQA z9<`OowLhaNPb$=I)<@2~yFlQy-JEcxx5Fy4_mK^PO&&cV*dtNt3*dQ9TIeoks5xlU zPp^T}qL`Uh7M-SSxO22}&w~CvuG$)Af*^3#AOb;z+VkK8Jz0JlfFuR0rtG2d zn+n=Qc+}M=Y%e_G4+DdxIFl=7+Vkn2o_I z{+620GpE(VH0w!ZQx|V%Ye0p(=V3c~LEYAy5}R59#(o9xGcqLAyQj=%aXlyMu`$?o}^m6QoTx( z!tP7u8Fty{CEV#feE*nyYasUTZ9MRIuUkD{ZbfOrVkX7_T1^9GPOE`tP?sUz^gfK!=%!eZ)GWZ2s;0JZw#otA4!HK0r96_7cU0xR z-VnQCDL9-|!i?_I$*~C8-UgfVDP|=BIBLEEGqxx40s}5bqQ$qeKU@q#d?C=LW#Qr} zG0Re(5potyb5@b~l$seX3L^&g0E6!ydtPOeh8s37f zgrmd{(MGD5Jxx5btv-we(~ZUvQ6htOj22xbj-8|ihBa_g>;;DcBYV#nMYiGs9*Iq5d3$61i$Ah7o`2x_5|%vc{#(UzbJul z*r);U-WfZmy<*+C18tqj1C`)BdB0hz|I5YHur+qmb9}J2hVCoJP}iNsOT00eI)YTg z?5D6lUU-AoQWJY{Nn8<0vHA&O&`v^3QCqg_y4^MkDcLA(y6}{60|Qu~_H&)w=)yLB zmboR4P@PkO0nvSq*?biMz!`3tN-z-iN;sIL1nHbSv(IuJ z$!26rW`SfzbK7vLSCQ61EC8Naism-U_1q0(!)zq%)gN0C1$4MMVQJluj>5~SuX0NH EKQq^Bj{pDw literal 0 HcmV?d00001 diff --git a/admin/template/js/fancybox/fancybox_sprite.png b/admin/template/js/fancybox/fancybox_sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..ae597131d62a62e7a0e2faf86c168a07df2bb8f9 GIT binary patch literal 2750 zcmV;v3PJUWP)6+*Y#wu1Z0%~Z0D2k$3iH`^i0v3E_6%|2wsEE`5yZz7Pa=9~ehnd+X?VRKfGlt=N>(JRQLGtR~QQNm~Pr7~kcC|rcBao-AUcDNt6_^$<*n;oPojdo9hK7bJu@Gs( zP*zrE$jr<%ELpO|Fn|7hN$@!%Bg0TqQetRpYcm4t?CdN#dh}?3B~a$TxbpS{rKF@J z)0VVj;s*~N7_zgo4dcg;Hv|L(n3Zwk#z}qe+_@uxdj9-*Yh7Jk6wj>+$`l|M2J_mo zWy_X7dGe$O6G9_Xr%ts9L@5&|PLwo;*4Nk9#h_d)0#a;KP32eB;jN? z*%(MC$}nZh6uSWm4GlG1yLL?i)zsAVwy>vufMnVkN`jLRfBpLPuQ4bqE6Z+Rglycn zQ36D^Sx;*X6W(13NNDFL@$vCnFyP9SD<&r`EG(2J#b0ZF6LR6g1*y-aOP6NJZAlJD z&$hELKR>?`opW<@O-?9p@`ZQq+}ZCpQ{&0OO26N|dpDcc9smfcgXRCWrl#g5IwvF~ zn4ECarcM181`s6}^f5Jl(V|7dVO|v5##oF|8-8aJ$sg#XccSyOY17Qwf)bQgFp$ZU zCrkZ$dwbh>ZQ;TD+0V~NRz7?7tQVa_LP9JWs2V6sV3gZVYkH{x`VL79$!bE~hmK>% zjzjp0f>34F#M>*H} z49aCQ$JNa8qjbOZ+nj}bvu=@?zvxM0{HZQZ(6dIUU)y#XP6Ks$Ht+%8_z zRSl5XwqTN9dw6(krcAE`0}mcNXg4tX_wN_Rd@mv*VzPX@)Y1=>F5hJ>rO%!{d;im? zPbFsoBeWF^@^3!s&uPu~Xbm4;(_}uRG)G4bBopN$%jL;0#YCCAoP%bP@r?84d&5fN^7=v1~V8Md? zd-v{jil>BOu3x|25FH&o00h3nZ^C%d=+w3+Cnv9=xnAeF-P9@%b7hbKHG$+Uk`*II zj@&{SA#5Gf94f(Bk9c^ZD}S z%ZpE(IMFChqP$Vk)m~Xy`PIsmEA#yQ{omuUfxJy_RuzgSs@GwBB0_j_Y~zO{8Q4ye zk7?mgN&dp$eaL-&&SQLdj=`1EDxh@yWFG7mMw9#q`8NZc&4SNA<=;kgUk@Iu(?U2{ zOULNgtGe?-p6qFTSiJc=5ANft7093nD;2Uz5LK=$a^h-Gq?O&MJbO`lL;lw}#sS;q zuq_jlmzS3hC&##eDw8j$7%1xN>$^aIFOpP~6U-s!xTe0oK2*jr>Kwu`k^>w~p=b~J zy>2a39szEmG4Hegaka~_XN?S{r~i!BFop{R%MBYgNI_Omc@*m;Di2Xzup1mYu2xr9 z&$Y=hia|GT-t;4_REWtzT1}rmT~m}#OG`7HKYw1ZX1$j$UrysNu58m4K9C5C|oEmp^01jFIdSZQZ(cAJKZ>R}!E7v_nSs8am&&aYGX^E@bJ_rPvAs zrKlGBf=EZZNR8HvU>Zo3(sQA_SE^IMCu;>mrIMyvUI<7qHi=#@FRuiymQ^cPH{3^{ zGb#lwU_cj>YcPVr(`y+g2v1sPGbjDSm1Kj&F;b}`af@1n*$gFh=d+xQ9STkV%#%m22kMv13*lx3Ht#yLVS`LFy-S0mek$Q>z_Nv^Rpm z?a*L}bJFTRY29COMdChy(xa0i6@p=5VP+>pAeA>NhpYm$ZQC|!+>RYPaNm)LTPF^_ z{Q!A)baea+9p}uMV{y``sHlG1MyFUapn`$|X$;wKDR^<_#|HrNYHn_pP8nj4)>9@o z?3R`mP2+@fjERZ)8*Au?e9zL~hDu6GJ{A{sTAvoD4Piz!OE*Wzow(Kq`?`q>%F#+2 z!YT8Jjg5^&@WTMGq}JF4mCuIw_;}5icof%aY0V8JZ<6>LPnm*a45+HAl42RIB<&r` z#9;t2Pgz7Bs6&#dezdTHJ@bi-jC`9Mq?E2|iA~lBaw{}S+Mt~+B){XRugb!@unP~% z%gf8>eAqB!#tgfr9^jb#{rz{-I%`ROfh%}9t*1;s^t_+*PM}GAB}_^Ps*EPfyQ8O3a(Y=|PoYEfDxKu}uJzn3#Bs=0;xqClcHwzG{;6 zRM--NU4*;4`}>83g~rz^!0e}{rb>yHIUuuU%`$2Qjk3@#%06+0u#M!;9KV9JlAby~ zaj)_T_#h=ErGToChhhO-<>M6Y-Md$+#UQvBK@_JN%m{>n^$YUK4WmYl`a8|@1%r8q zWSm<1YOV~@vFC(6MPk48di^J~Z6|7KYQDBqwG!Z-!-o$yPMS2SfX04F@;Pr)95ZU3 zre3!&S11Ziz06mi@gP1)KBaBRrSMWt0M8yda-;#WYuBzTlqa8!i;MdQ^~oXGP69r9 z9WHd3VGCl-xLQSeDnRM^iGrBnN4k*43w_4^B%39RPY}4qOa}5MXNA6eb>T87($fU- z>CM2xNl>pRaB%!RFP=p5E^kc?)4+bL6}=Y1VKDsSP}bNhc)^JybqIUhUxB!Q6j6%RI%C`&LX&pDB$E6ogAZ+V{~$iPL9#ZF*-TM|5uLj-;y%7L$s}Jj{pDw07*qoM6N<$ Ef()%9Q2+n{ literal 0 HcmV?d00001 diff --git a/admin/template/js/fancybox/jquery.fancybox.css b/admin/template/js/fancybox/jquery.fancybox.css new file mode 100644 index 0000000..5f23ef0 --- /dev/null +++ b/admin/template/js/fancybox/jquery.fancybox.css @@ -0,0 +1,225 @@ +/*! fancyBox v2.0.4 fancyapps.com | fancyapps.com/fancybox/#license */ +.fancybox-tmp iframe, .fancybox-tmp object { + vertical-align: top; + padding: 0; + margin: 0; +} + +.fancybox-wrap { + position: absolute; + top: 0; + left: 0; + z-index: 1002; +} + +.fancybox-outer { + padding: 0; + margin: 0; + background: #f9f9f9; + color: #444; + text-shadow: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.fancybox-opened { + z-index: 1003; +} + +.fancybox-opened .fancybox-outer { + -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); + -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); + box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); +} + +.fancybox-inner { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + position: relative; + outline: none; + overflow: hidden; + background:#F6F6F6; +} + +.fancybox-error { + color: #444; + font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; + margin: 0; + padding: 10px; +} + +.fancybox-image, .fancybox-iframe { + display: block; + width: 100%; + height: 100%; + border: 0; + padding: 0; + margin: 0; + vertical-align: top; +} + +.fancybox-image { + max-width: 100%; + max-height: 100%; +} + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + margin-top: -21px; + margin-left: -21px; + width: 42px; + height: 42px; + background: url('fancybox_loading.gif'); + opacity: 0.8; + cursor: pointer; + z-index: 1010; +} + +.fancybox-close, .fancybox-prev span, .fancybox-next span { + background-image: url('fancybox_sprite.png'); +} + +.fancybox-close { + position: absolute; + top: -18px; + right: -18px; + width: 36px; + height: 36px; + cursor: pointer; + z-index: 1004; +} + +.fancybox-prev, .fancybox-next { + position: absolute; + top: 0; + width: 40%; + height: 100%; + cursor: pointer; + background: transparent url('blank.gif'); /* helps IE */ + z-index: 1003; +} + +.fancybox-prev { + left: 0; +} + +.fancybox-next { + right: 0; +} + +.fancybox-prev span, .fancybox-next span { + position: absolute; + top: 50%; + left: -9999px; + width: 36px; + height: 36px; + margin-top: -18px; + cursor: pointer; + z-index: 1003; +} + +.fancybox-prev span { + background-position: 0 -36px; +} + +.fancybox-next span { + background-position: 0 -72px; +} + +.fancybox-prev:hover, .fancybox-next:hover { + visibility: visible; +} + +.fancybox-prev:hover span { + left: 20px; +} + +.fancybox-next:hover span { + left: auto; + right: 20px; +} + +.fancybox-tmp { + position: absolute; + top: -9999px; + left: -9999px; + padding: 0; + overflow: visible; + visibility: hidden; +} + +/* Overlay helper */ + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + overflow: hidden; + display: none; + z-index: 1001; + background: #000; +} + +/* Title helper */ + +.fancybox-title { + visibility: hidden; + font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; + position: relative; + text-shadow: none; + z-index: 1005; +} + +.fancybox-opened .fancybox-title { + visibility: visible; +} + +.fancybox-title-float-wrap { + position: absolute; + bottom: 0; + right: 50%; + margin-bottom: -35px; + z-index: 1003; + text-align: center; +} + +.fancybox-title-float-wrap .child { + display: inline-block; + margin-right: -100%; + padding: 2px 20px; + background: transparent; /* Fallback for web browsers that doesn't support RGBa */ + background: rgba(0, 0, 0, 0.8); + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; + text-shadow: 0 1px 2px #222; + color: #FFF; + font-weight: bold; + line-height: 24px; + white-space: nowrap; +} + +.fancybox-title-outside-wrap { + position: relative; + margin-top: 10px; + color: #fff; +} + +.fancybox-title-inside-wrap { + margin-top: 10px; +} + +.fancybox-title-over-wrap { + position: absolute; + bottom: 0; + left: 0; + color: #fff; + padding: 10px; + background: #000; + background: rgba(0, 0, 0, .8); +} \ No newline at end of file diff --git a/admin/template/js/fancybox/jquery.fancybox.pack.js b/admin/template/js/fancybox/jquery.fancybox.pack.js new file mode 100644 index 0000000..ff34249 --- /dev/null +++ b/admin/template/js/fancybox/jquery.fancybox.pack.js @@ -0,0 +1,32 @@ +/*! fancyBox v2.0.4 fancyapps.com | fancyapps.com/fancybox/#license */ +(function(u,q,e){var l=e(u),r=e(q),a=e.fancybox=function(){a.open.apply(this,arguments)},s=!1,t=null;e.extend(a,{version:"2.0.4",defaults:{padding:15,margin:20,width:800,height:600,minWidth:200,minHeight:200,maxWidth:9999,maxHeight:9999,autoSize:!0,fitToView:!0,aspectRatio:!1,topRatio:0.5,fixed:!e.browser.msie||6
    ',image:'',iframe:'',swf:'', +error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'
    ',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut", +nextEffect:"elastic",nextSpeed:300,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:300,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:300,opacity:0.8,css:{cursor:"pointer"},closeClick:!0},title:{type:"float"}}},group:{},opts:{},coming:null,current:null,isOpen:!1,isOpened:!1,wrap:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(b,c){e.isArray(b)||(b=[b]);if(b.length)a.close(!0), +a.opts=e.extend(!0,{},a.defaults,c),a.group=b,a._start(a.opts.index||0)},cancel:function(){if(!(a.coming&&!1===a.trigger("onCancel"))&&(a.coming=null,a.hideLoading(),a.ajaxLoad&&a.ajaxLoad.abort(),a.ajaxLoad=null,a.imgPreload))a.imgPreload.onload=a.imgPreload.onabort=a.imgPreload.onerror=null},close:function(b){a.cancel();if(a.current&&!1!==a.trigger("beforeClose"))a.unbindEvents(),!a.isOpen||b&&!0===b[0]?(e(".fancybox-wrap").stop().trigger("onReset").remove(),a._afterZoomOut()):(a.isOpen=a.isOpened= +!1,e(".fancybox-item").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.closeMethod]())},play:function(b){var c=function(){clearTimeout(a.player.timer)},d=function(){c();if(a.current&&a.player.isActive)a.player.timer=setTimeout(a.next,a.current.playSpeed)},g=function(){c();e("body").unbind(".player");a.player.isActive=!1;a.trigger("onPlayEnd")};if(a.player.isActive||b&&!1===b[0])g();else if(a.current&&(a.current.loop||a.current.index< +a.group.length-1))a.player.isActive=!0,e("body").bind({"afterShow.player onUpdate.player":d,"onCancel.player beforeClose.player":g,"beforeLoad.player":c}),d(),a.trigger("onPlayStart")},next:function(){a.current&&a.jumpto(a.current.index+1)},prev:function(){a.current&&a.jumpto(a.current.index-1)},jumpto:function(b){a.current&&(b=parseInt(b,10),1=a.group.length?b=0:0>b&&(b=a.group.length-1)),"undefined"!==typeof a.group[b]&&(a.cancel(),a._start(b)))},reposition:function(b){a.isOpen&& +a.wrap.css(a._getPosition(b))},update:function(){a.isOpen&&(s||(t=setInterval(function(){if(s&&(s=!1,clearTimeout(t),a.current)){if(a.current.autoSize)a.inner.height("auto"),a.current.height=a.inner.height();a._setDimension();a.current.canGrow&&a.inner.height("auto");a.reposition();a.trigger("onUpdate")}},100)),s=!0)},toggle:function(){if(a.isOpen)a.current.fitToView=!a.current.fitToView,a.update()},hideLoading:function(){e("#fancybox-loading").remove()},showLoading:function(){a.hideLoading();e('
    ').click(a.cancel).appendTo("body")}, +getViewport:function(){return{x:l.scrollLeft(),y:l.scrollTop(),w:l.width(),h:l.height()}},unbindEvents:function(){a.wrap&&a.wrap.unbind(".fb");r.unbind(".fb");l.unbind(".fb")},bindEvents:function(){var b=a.current,c=b.keys;b&&(l.bind("resize.fb, orientationchange.fb",a.update),c&&r.bind("keydown.fb",function(b){var g;if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey&&0>e.inArray(b.target.tagName.toLowerCase(),["input","textarea","select","button"]))g=b.keyCode,-1').appendTo(e("body")).append(b),d.width=c.outerWidth(),d.height=c.outerHeight(!0),b=c.contents().detach(),c.remove();break;case "image":b=d.tpl.image.replace("{href}", +d.href);d.aspectRatio=!0;break;case "swf":b=d.tpl.swf.replace(/\{width\}/g,d.width).replace(/\{height\}/g,d.height).replace(/\{href\}/g,d.href);break;case "iframe":b=d.tpl.iframe.replace("{href}",d.href).replace("{scrolling}",d.scrolling).replace("{rnd}",(new Date).getTime())}if(-1o&&(h=o,j=(h-i)/l+i),j>m&&(j=m,h=(j-i)*l+i),ho||k>m)for(;(h>o||k>m)&&h>n&&k>p;)j-=10,g.aspectRatio?(h=Math.round((j-i)*l+i),hp&&jf.w||k>f.h)&&h>n&&j>p)g.canShrink=!0;b=k-i;a.innerSpace=b-d.height();a.outerSpace=b- +c.height()},_getPosition:function(b){var c=a.current,d=a.getViewport(),e=c.margin,f=a.wrap.width()+e[1]+e[3],k=a.wrap.height()+e[0]+e[2],i={position:"absolute",top:e[0]+d.y,left:e[3]+d.x};if(c.fixed&&(!b||!1===b[0])&&k<=d.h&&f<=d.w)i={position:"fixed",top:e[0],left:e[3]};i.top=Math.ceil(Math.max(i.top,i.top+(d.h-k)*c.topRatio))+"px";i.left=Math.ceil(Math.max(i.left,i.left+0.5*(d.w-f)))+"px";return i},_afterZoomIn:function(){var b=a.current;a.isOpen=a.isOpened=!0;a.wrap.addClass("fancybox-opened").css("overflow", +"visible");a.update();a.inner.css("overflow","auto"===b.scrolling?"auto":"yes"===b.scrolling?"scroll":"hidden");if(b.closeClick||b.nextClick)a.inner.css("cursor","pointer").bind("click.fb",b.nextClick?a.next:a.close);b.closeBtn&&e(b.tpl.closeBtn).appendTo(a.wrap).bind("click.fb",a.close);b.arrows&&1c.end&&(d=1-d),e-=a.innerSpace*d,f-=a.outerSpace*d),a.inner[c.prop](e),a.outer[c.prop](f)},zoomIn:function(){var b=a.wrap,c=a.current,d,g;d=c.dim;if("elastic"===c.openEffect){g=e.extend({}, +d,a._getPosition(!0));delete g.position;d=this.getOrigPosition();if(c.openOpacity)d.opacity=0,g.opacity=1;b.css(d).show().animate(g,{duration:c.openSpeed,easing:c.openEasing,step:this.step,complete:a._afterZoomIn})}else b.css(e.extend({},d,a._getPosition())),"fade"===c.openEffect?b.fadeIn(c.openSpeed,a._afterZoomIn):(b.show(),a._afterZoomIn())},zoomOut:function(){var b=a.wrap,c=a.current,d;if("elastic"===c.closeEffect){"fixed"===b.css("position")&&b.css(a._getPosition(!0));d=this.getOrigPosition(); +if(c.closeOpacity)d.opacity=0;b.animate(d,{duration:c.closeSpeed,easing:c.closeEasing,step:this.step,complete:a._afterZoomOut})}else b.fadeOut("fade"===c.closeEffect?c.closeSpeed:0,a._afterZoomOut)},changeIn:function(){var b=a.wrap,c=a.current,d;"elastic"===c.nextEffect?(d=a._getPosition(!0),d.opacity=0,d.top=parseInt(d.top,10)-200+"px",b.css(d).show().animate({opacity:1,top:"+=200px"},{duration:c.nextSpeed,complete:a._afterZoomIn})):(b.css(a._getPosition()),"fade"===c.nextEffect?b.hide().fadeIn(c.nextSpeed, +a._afterZoomIn):(b.show(),a._afterZoomIn()))},changeOut:function(){var b=a.wrap,c=a.current,d=function(){e(this).trigger("onReset").remove()};b.removeClass("fancybox-opened");"elastic"===c.prevEffect?b.animate({opacity:0,top:"+=200px"},{duration:c.prevSpeed,complete:d}):b.fadeOut("fade"===c.prevEffect?c.prevSpeed:0,d)}};a.helpers.overlay={overlay:null,update:function(){var a,c;this.overlay.width(0).height(0);e.browser.msie?(a=Math.max(q.documentElement.scrollWidth,q.body.scrollWidth),c=Math.max(q.documentElement.offsetWidth, +q.body.offsetWidth),a=a').css(b.css||{background:"black"}).appendTo("body"),this.update(),b.closeClick&&this.overlay.bind("click.fb",a.close),l.bind("resize.fb",e.proxy(this.update,this)),this.overlay.fadeTo(b.speedIn||"fast",b.opacity||1)},onUpdate:function(){this.update()},afterClose:function(a){this.overlay&&this.overlay.fadeOut(a.speedOut|| +"fast",function(){e(this).remove()});this.overlay=null}};a.helpers.title={beforeShow:function(b){var c;if(c=a.current.title)c=e('
    '+c+"
    ").appendTo("body"),"float"===b.type&&(c.width(c.width()),c.wrapInner(''),a.current.margin[2]+=Math.abs(parseInt(c.css("margin-bottom"),10))),c.appendTo("over"===b.type?a.inner:"outside"===b.type?a.wrap:a.outer)}};e.fn.fancybox=function(b){function c(b){var c=[],i,h=this.rel; +if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey)b.preventDefault(),b=e(this).data("fancybox-group"),"undefined"!==typeof b?i=b?"data-fancybox-group":!1:h&&""!==h&&"nofollow"!==h&&(b=h,i="rel"),i&&(c=g.length?e(g).filter("["+i+'="'+b+'"]'):e("["+i+'="'+b+'"]')),c.length?(d.index=c.index(this),a.open(c.get(),d)):a.open(this,d)}var d=b||{},g=this.selector||"";g?r.undelegate(g,"click.fb-start").delegate(g,"click.fb-start",c):e(this).unbind("click.fb-start").bind("click.fb-start",c);return this}})(window, +document,jQuery); \ No newline at end of file diff --git a/admin/template/js/jcrop/Jcrop.gif b/admin/template/js/jcrop/Jcrop.gif new file mode 100644 index 0000000000000000000000000000000000000000..72ea7ccb5321d5384d70437cfaac73011237901e GIT binary patch literal 329 zcmZ?wbhEHb9b#5NV>2k zBC~b@b~P=nNfWAe-b%_i6tS^-1y(h@EsB~1TqDA_h@fkxG$bHgvj}VxE1JLgr!*!^ ILUxTc0Q$^Q5C8xG literal 0 HcmV?d00001 diff --git a/admin/template/js/jcrop/jquery.Jcrop.css b/admin/template/js/jcrop/jquery.Jcrop.css new file mode 100644 index 0000000..b95178a --- /dev/null +++ b/admin/template/js/jcrop/jquery.Jcrop.css @@ -0,0 +1,45 @@ +/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */ +.jcrop-holder +{ + text-align: left; +} + +.jcrop-vline, .jcrop-hline +{ + font-size: 0; + position: absolute; + background: white url('Jcrop.gif') top left repeat; + /* + opacity: .5; + *filter:alpha(opacity=50); + */ +} +.jcrop-vline { height: 100%; width: 1px !important; } +.jcrop-hline { width: 100%; height: 1px !important; } +.jcrop-handle { + font-size: 1px; + width: 7px !important; + height: 7px !important; + border: 1px #eee solid; + background-color: #333; + *width: 9px; + *height: 9px; +} + +.jcrop-tracker { + *background-color: gray; + width: 100%; height: 100%; +} + +.custom .jcrop-vline, +.custom .jcrop-hline +{ + background: yellow; +} +.custom .jcrop-handle +{ + border-color: black; + background-color: #C7BB00; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} diff --git a/admin/template/js/jcrop/jquery.Jcrop.min.js b/admin/template/js/jcrop/jquery.Jcrop.min.js new file mode 100644 index 0000000..9002b97 --- /dev/null +++ b/admin/template/js/jcrop/jquery.Jcrop.min.js @@ -0,0 +1,163 @@ +/** + * Jcrop v.0.9.8 (minimized) + * (c) 2008 Kelly Hallman and DeepLiquid.com + * More information: http://deepliquid.com/content/Jcrop.html + * Released under MIT License - this header must remain with code + */ + + +(function($){$.Jcrop=function(obj,opt) +{var obj=obj,opt=opt;if(typeof(obj)!=='object')obj=$(obj)[0];if(typeof(opt)!=='object')opt={};if(!('trackDocument'in opt)) +{opt.trackDocument=$.browser.msie?false:true;if($.browser.msie&&$.browser.version.split('.')[0]=='8') +opt.trackDocument=true;} +if(!('keySupport'in opt)) +opt.keySupport=$.browser.msie?false:true;var defaults={trackDocument:false,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:.6,borderOpacity:.4,handleOpacity:.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var options=defaults;setOptions(opt);var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css({position:'absolute'});$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('
    ').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);;if(options.addClass)$div.addClass(options.addClass);var $img2=$('').attr('src',$img.attr('src')).css('position','absolute').width(boundx).height(boundy);var $img_holder=$('
    ').width(pct(100)).height(pct(100)).css({zIndex:310,position:'absolute',overflow:'hidden'}).append($img2);var $hdl_holder=$('
    ').width(pct(100)).height(pct(100)).css('zIndex',320);var $sel=$('
    ').css({position:'absolute',zIndex:300}).insertBefore($img).append($img_holder,$hdl_holder);var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:'absolute',top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var xlimit,ylimit,xmin,ymin;var xscale,yscale,enabled=true;var docOffset=getPos($img),btndown,lastcurs,dimmed,animating,shift_down;var Coords=function() +{var x1=0,y1=0,x2=0,y2=0,ox,oy;function setPressed(pos) +{var pos=rebound(pos);x2=x1=pos[0];y2=y1=pos[1];};function setCurrent(pos) +{var pos=rebound(pos);ox=pos[0]-x2;oy=pos[1]-y2;x2=pos[0];y2=pos[1];};function getOffset() +{return[ox,oy];};function moveOffset(offset) +{var ox=offset[0],oy=offset[1];if(0>x1+ox)ox-=ox+x1;if(0>y1+oy)oy-=oy+y1;if(boundyboundx) +{xx=boundx;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}} +else +{xx=x2;h=rwa/aspect;yy=rh<0?y1-h:y1+h;if(yy<0) +{yy=0;w=Math.abs((yy-y1)*aspect);xx=rw<0?x1-w:w+x1;} +else if(yy>boundy) +{yy=boundy;w=Math.abs(yy-y1)*aspect;xx=rw<0?x1-w:w+x1;}} +if(xx>x1){if(xx-x1max_x){xx=x1+max_x;} +if(yy>y1){yy=y1+(xx-x1)/aspect;}else{yy=y1-(xx-x1)/aspect;}}else if(xxmax_x){xx=x1-max_x;} +if(yy>y1){yy=y1+(x1-xx)/aspect;}else{yy=y1-(x1-xx)/aspect;}} +if(xx<0){x1-=xx;xx=0;}else if(xx>boundx){x1-=xx-boundx;xx=boundx;} +if(yy<0){y1-=yy;yy=0;}else if(yy>boundy){y1-=yy-boundy;yy=boundy;} +return last=makeObj(flipCoords(x1,y1,xx,yy));};function rebound(p) +{if(p[0]<0)p[0]=0;if(p[1]<0)p[1]=0;if(p[0]>boundx)p[0]=boundx;if(p[1]>boundy)p[1]=boundy;return[p[0],p[1]];};function flipCoords(x1,y1,x2,y2) +{var xa=x1,xb=x2,ya=y1,yb=y2;if(x2xlimit)) +x2=(xsize>0)?(x1+xlimit):(x1-xlimit);if(ylimit&&(Math.abs(ysize)>ylimit)) +y2=(ysize>0)?(y1+ylimit):(y1-ylimit);if(ymin&&(Math.abs(ysize)0)?(y1+ymin):(y1-ymin);if(xmin&&(Math.abs(xsize)0)?(x1+xmin):(x1-xmin);if(x1<0){x2-=x1;x1-=x1;} +if(y1<0){y2-=y1;y1-=y1;} +if(x2<0){x1-=x2;x2-=x2;} +if(y2<0){y1-=y2;y2-=y2;} +if(x2>boundx){var delta=x2-boundx;x1-=delta;x2-=delta;} +if(y2>boundy){var delta=y2-boundy;y1-=delta;y2-=delta;} +if(x1>boundx){var delta=x1-boundy;y2-=delta;y1-=delta;} +if(y1>boundy){var delta=y1-boundy;y2-=delta;y1-=delta;} +return makeObj(flipCoords(x1,y1,x2,y2));};function makeObj(a) +{return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]};};return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed};}();var Selection=function() +{var start,end,dragmode,awake,hdep=370;var borders={};var handle={};var seehandles=false;var hhs=options.handleOffset;if(options.drawBorders){borders={top:insertBorder('hline').css('top',$.browser.msie?px(-1):px(0)),bottom:insertBorder('hline'),left:insertBorder('vline'),right:insertBorder('vline')};} +if(options.dragEdges){handle.t=insertDragbar('n');handle.b=insertDragbar('s');handle.r=insertDragbar('e');handle.l=insertDragbar('w');} +options.sideHandles&&createHandles(['n','s','e','w']);options.cornerHandles&&createHandles(['sw','nw','ne','se']);function insertBorder(type) +{var jq=$('
    ').css({position:'absolute',opacity:options.borderOpacity}).addClass(cssClass(type));$img_holder.append(jq);return jq;};function dragDiv(ord,zi) +{var jq=$('
    ').mousedown(createDragger(ord)).css({cursor:ord+'-resize',position:'absolute',zIndex:zi});$hdl_holder.append(jq);return jq;};function insertHandle(ord) +{return dragDiv(ord,hdep++).css({top:px(-hhs+1),left:px(-hhs+1),opacity:options.handleOpacity}).addClass(cssClass('handle'));};function insertDragbar(ord) +{var s=options.handleSize,o=hhs,h=s,w=s,t=o,l=o;switch(ord) +{case'n':case's':w=pct(100);break;case'e':case'w':h=pct(100);break;} +return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});};function createHandles(li) +{for(i in li)handle[li[i]]=insertHandle(li[i]);};function moveHandles(c) +{var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;'e'in handle&&handle.e.css({top:px(midvert),left:px(east)})&&handle.w.css({top:px(midvert)})&&handle.s.css({top:px(south),left:px(midhoriz)})&&handle.n.css({left:px(midhoriz)});'ne'in handle&&handle.ne.css({left:px(east)})&&handle.se.css({top:px(south),left:px(east)})&&handle.sw.css({top:px(south)});'b'in handle&&handle.b.css({top:px(south)})&&handle.r.css({left:px(east)});};function moveto(x,y) +{$img2.css({top:px(-y),left:px(-x)});$sel.css({top:px(y),left:px(x)});};function resize(w,h) +{$sel.width(w).height(h);};function refresh() +{var c=Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();};function updateVisible() +{if(awake)return update();};function update() +{var c=Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);options.drawBorders&&borders['right'].css({left:px(c.w-1)})&&borders['bottom'].css({top:px(c.h-1)});seehandles&&moveHandles(c);awake||show();options.onChange(unscale(c));};function show() +{$sel.show();$img.css('opacity',options.bgOpacity);awake=true;};function release() +{disableHandles();$sel.hide();$img.css('opacity',1);awake=false;};function showHandles() +{if(seehandles) +{moveHandles(Coords.getFixed());$hdl_holder.show();}};function enableHandles() +{seehandles=true;if(options.allowResize) +{moveHandles(Coords.getFixed());$hdl_holder.show();return true;}};function disableHandles() +{seehandles=false;$hdl_holder.hide();};function animMode(v) +{(animating=v)?disableHandles():enableHandles();};function done() +{animMode(false);refresh();};var $track=newTracker().mousedown(createDragger('move')).css({cursor:'move',position:'absolute',zIndex:360}) +$img_holder.append($track);disableHandles();return{updateVisible:updateVisible,update:update,release:release,refresh:refresh,setCursor:function(cursor){$track.css('cursor',cursor);},enableHandles:enableHandles,enableOnly:function(){seehandles=true;},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,done:done};}();var Tracker=function() +{var onMove=function(){},onDone=function(){},trackDoc=options.trackDocument;if(!trackDoc) +{$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);} +function toFront() +{$trk.css({zIndex:450});if(trackDoc) +{$(document).mousemove(trackMove).mouseup(trackUp);}} +function toBack() +{$trk.css({zIndex:290});if(trackDoc) +{$(document).unbind('mousemove',trackMove).unbind('mouseup',trackUp);}} +function trackMove(e) +{onMove(mouseAbs(e));};function trackUp(e) +{e.preventDefault();e.stopPropagation();if(btndown) +{btndown=false;onDone(mouseAbs(e));options.onSelect(unscale(Coords.getFixed()));toBack();onMove=function(){};onDone=function(){};} +return false;};function activateHandlers(move,done) +{btndown=true;onMove=move;onDone=done;toFront();return false;};function setCursor(t){$trk.css('cursor',t);};$img.before($trk);return{activateHandlers:activateHandlers,setCursor:setCursor};}();var KeyManager=function() +{var $keymgr=$('').css({position:'absolute',left:'-30px'}).keypress(parseKey).blur(onBlur),$keywrap=$('
    ').css({position:'absolute',overflow:'hidden'}).append($keymgr);function watchKeys() +{if(options.keySupport) +{$keymgr.show();$keymgr.focus();}};function onBlur(e) +{$keymgr.hide();};function doNudge(e,x,y) +{if(options.allowMove){Coords.moveOffset([x,y]);Selection.updateVisible();};e.preventDefault();e.stopPropagation();};function parseKey(e) +{if(e.ctrlKey)return true;shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode) +{case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:Selection.release();break;case 9:return true;} +return nothing(e);};if(options.keySupport)$keywrap.insertBefore($img);return{watchKeys:watchKeys};}();function px(n){return''+parseInt(n)+'px';};function pct(n){return''+parseInt(n)+'%';};function cssClass(cl){return options.baseClass+'-'+cl;};function getPos(obj) +{var pos=$(obj).offset();return[pos.left,pos.top];};function mouseAbs(e) +{return[(e.pageX-docOffset[0]),(e.pageY-docOffset[1])];};function myCursor(type) +{if(type!=lastcurs) +{Tracker.setCursor(type);lastcurs=type;}};function startDragMode(mode,pos) +{docOffset=getPos($img);Tracker.setCursor(mode=='move'?mode:mode+'-resize');if(mode=='move') +return Tracker.activateHandlers(createMover(pos),doneSelect);var fc=Coords.getFixed();var opp=oppLockCorner(mode);var opc=Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);};function dragmodeHandler(mode,f) +{return function(pos){if(!options.aspectRatio)switch(mode) +{case'e':pos[1]=f.y2;break;case'w':pos[1]=f.y2;break;case'n':pos[0]=f.x2;break;case's':pos[0]=f.x2;break;} +else switch(mode) +{case'e':pos[1]=f.y+1;break;case'w':pos[1]=f.y+1;break;case'n':pos[0]=f.x+1;break;case's':pos[0]=f.x+1;break;} +Coords.setCurrent(pos);Selection.update();};};function createMover(pos) +{var lloc=pos;KeyManager.watchKeys();return function(pos) +{Coords.moveOffset([pos[0]-lloc[0],pos[1]-lloc[1]]);lloc=pos;Selection.update();};};function oppLockCorner(ord) +{switch(ord) +{case'n':return'sw';case's':return'nw';case'e':return'nw';case'w':return'ne';case'ne':return'sw';case'nw':return'se';case'se':return'nw';case'sw':return'ne';};};function createDragger(ord) +{return function(e){if(options.disabled)return false;if((ord=='move')&&!options.allowMove)return false;btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};};function presize($obj,w,h) +{var nw=$obj.width(),nh=$obj.height();if((nw>w)&&w>0) +{nw=w;nh=(w/$obj.width())*$obj.height();} +if((nh>h)&&h>0) +{nh=h;nw=(h/$obj.height())*$obj.width();} +xscale=$obj.width()/nw;yscale=$obj.height()/nh;$obj.width(nw).height(nh);};function unscale(c) +{return{x:parseInt(c.x*xscale),y:parseInt(c.y*yscale),x2:parseInt(c.x2*xscale),y2:parseInt(c.y2*yscale),w:parseInt(c.w*xscale),h:parseInt(c.h*yscale)};};function doneSelect(pos) +{var c=Coords.getFixed();if(c.w>options.minSelect[0]&&c.h>options.minSelect[1]) +{Selection.enableHandles();Selection.done();} +else +{Selection.release();} +Tracker.setCursor(options.allowSelect?'crosshair':'default');};function newSelection(e) +{if(options.disabled)return false;if(!options.allowSelect)return false;btndown=true;docOffset=getPos($img);Selection.disableHandles();myCursor('crosshair');var pos=mouseAbs(e);Coords.setPressed(pos);Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();Selection.update();e.stopPropagation();e.preventDefault();return false;};function selectDrag(pos) +{Coords.setCurrent(pos);Selection.update();};function newTracker() +{var trk=$('
    ').addClass(cssClass('tracker'));$.browser.msie&&trk.css({opacity:0,backgroundColor:'white'});return trk;};function animateTo(a) +{var x1=a[0]/xscale,y1=a[1]/yscale,x2=a[2]/xscale,y2=a[3]/yscale;if(animating)return;var animto=Coords.flipCoords(x1,y1,x2,y2);var c=Coords.getFixed();var animat=initcr=[c.x,c.y,c.x2,c.y2];var interv=options.animationDelay;var x=animat[0];var y=animat[1];var x2=animat[2];var y2=animat[3];var ix1=animto[0]-initcr[0];var iy1=animto[1]-initcr[1];var ix2=animto[2]-initcr[2];var iy2=animto[3]-initcr[3];var pcent=0;var velocity=options.swingSpeed;Selection.animMode(true);var animator=function() +{return function() +{pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent<100)animateStart();else Selection.done();if(pcent>=99.8)pcent=100;setSelectRaw(animat);};}();function animateStart() +{window.setTimeout(animator,interv);};animateStart();};function setSelect(rect) +{setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);};function setSelectRaw(l) +{Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();};function setOptions(opt) +{if(typeof(opt)!='object')opt={};options=$.extend(options,opt);if(typeof(options.onChange)!=='function') +options.onChange=function(){};if(typeof(options.onSelect)!=='function') +options.onSelect=function(){};};function tellSelect() +{return unscale(Coords.getFixed());};function tellScaled() +{return Coords.getFixed();};function setOptionsNew(opt) +{setOptions(opt);interfaceUpdate();};function disableCrop() +{options.disabled=true;Selection.disableHandles();Selection.setCursor('default');Tracker.setCursor('default');};function enableCrop() +{options.disabled=false;interfaceUpdate();};function cancelCrop() +{Selection.done();Tracker.activateHandlers(null,null);};function destroy() +{$div.remove();$origimg.show();};function interfaceUpdate(alt) +{options.allowResize?alt?Selection.enableOnly():Selection.enableHandles():Selection.disableHandles();Tracker.setCursor(options.allowSelect?'crosshair':'default');Selection.setCursor(options.allowMove?'move':'default');$div.css('backgroundColor',options.bgColor);if('setSelect'in options){setSelect(opt.setSelect);Selection.done();delete(options.setSelect);} +if('trueSize'in options){xscale=options.trueSize[0]/boundx;yscale=options.trueSize[1]/boundy;} +xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if('outerImage'in options) +{$img.attr('src',options.outerImage);delete(options.outerImage);} +Selection.refresh();};$hdl_holder.hide();interfaceUpdate(true);var api={animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},release:Selection.release,destroy:destroy};$origimg.data('Jcrop',api);return api;};$.fn.Jcrop=function(options) +{function attachWhenDone(from) +{var loadsrc=options.useImg||from.src;var img=new Image();img.onload=function(){$.Jcrop(from,options);};img.src=loadsrc;};if(typeof(options)!=='object')options={};this.each(function() +{if($(this).data('Jcrop')) +{if(options=='api')return $(this).data('Jcrop');else $(this).data('Jcrop').setOptions(options);} +else attachWhenDone(this);});return this;};})(jQuery); \ No newline at end of file diff --git a/admin/template/js/jquery-scrolltofixed.js b/admin/template/js/jquery-scrolltofixed.js new file mode 100644 index 0000000..8aa3a00 --- /dev/null +++ b/admin/template/js/jquery-scrolltofixed.js @@ -0,0 +1,531 @@ +(function($) { + $.isScrollToFixed = function(el) { + return !!$(el).data('ScrollToFixed'); + }; + + $.ScrollToFixed = function(el, options) { + // To avoid scope issues, use 'base' instead of 'this' to reference this + // class from internal events and functions. + var base = this; + + // Access to jQuery and DOM versions of element. + base.$el = $(el); + base.el = el; + + // Add a reverse reference to the DOM object. + base.$el.data('ScrollToFixed', base); + + // A flag so we know if the scroll has been reset. + var isReset = false; + + // The element that was given to us to fix if scrolled above the top of + // the page. + var target = base.$el; + + var position; + var originalPosition; + + var originalOffset; + + // The offset top of the element when resetScroll was called. This is + // used to determine if we have scrolled past the top of the element. + var offsetTop = 0; + + // The offset left of the element when resetScroll was called. This is + // used to move the element left or right relative to the horizontal + // scroll. + var offsetLeft = 0; + var originalOffsetLeft = -1; + + // This last offset used to move the element horizontally. This is used + // to determine if we need to move the element because we would not want + // to do that for no reason. + var lastOffsetLeft = -1; + + // This is the element used to fill the void left by the target element + // when it goes fixed; otherwise, everything below it moves up the page. + var spacer = null; + + var spacerClass; + + var className; + + // Capture the original offsets for the target element. This needs to be + // called whenever the page size changes or when the page is first + // scrolled. For some reason, calling this before the page is first + // scrolled causes the element to become fixed too late. + function resetScroll() { + // Set the element to it original positioning. + target.trigger('preUnfixed.ScrollToFixed'); + setUnfixed(); + target.trigger('unfixed.ScrollToFixed'); + + // Reset the last offset used to determine if the page has moved + // horizontally. + lastOffsetLeft = -1; + + // Capture the offset top of the target element. + offsetTop = target.offset().top; + + // Capture the offset left of the target element. + offsetLeft = target.offset().left; + + // If the offsets option is on, alter the left offset. + if (base.options.offsets) { + offsetLeft += (target.offset().left - target.position().left); + } + + if (originalOffsetLeft == -1) { + originalOffsetLeft = offsetLeft; + } + + position = target.css('position'); + + // Set that this has been called at least once. + isReset = true; + + if (base.options.bottom != -1) { + target.trigger('preFixed.ScrollToFixed'); + setFixed(); + target.trigger('fixed.ScrollToFixed'); + } + } + + function getLimit() { + var limit = base.options.limit; + if (!limit) return 0; + + if (typeof(limit) === 'function') { + return limit.apply(target); + } + return limit; + } + + // Returns whether the target element is fixed or not. + function isFixed() { + return position === 'fixed'; + } + + // Returns whether the target element is absolute or not. + function isAbsolute() { + return position === 'absolute'; + } + + function isUnfixed() { + return !(isFixed() || isAbsolute()); + } + + // Sets the target element to fixed. Also, sets the spacer to fill the + // void left by the target element. + function setFixed() { + // console.log("setFixed"); + // Only fix the target element and the spacer if we need to. + if (!isFixed()) { + // Set the spacer to fill the height and width of the target + // element, then display it. + spacer.css({ + 'display' : target.css('display'), + 'width' : target.outerWidth(true), + 'height' : target.outerHeight(true), + 'float' : target.css('float') + }); + + // Set the target element to fixed and set its width so it does + // not fill the rest of the page horizontally. Also, set its top + // to the margin top specified in the options. + + cssOptions={ + 'position' : 'fixed', + 'top' : base.options.bottom == -1?getMarginTop():'', + 'bottom' : base.options.bottom == -1?'':base.options.bottom, + 'margin-left' : '0px' + } + if (!base.options.dontSetWidth){ cssOptions['width']=target.width(); }; + + target.css(cssOptions); + + target.addClass('scroll-to-fixed-fixed'); + target.removeClass('scroll-to-fixed-abs'); + + if (base.options.className) { + target.addClass(base.options.className); + } + + // setTimeout(function(){$(target).css('position','fixed')},60); + + position = 'fixed'; + } + } + + function setAbsolute() { + // console.log("setAbsolute"); + var top = getLimit(); + var left = offsetLeft; + + if (base.options.removeOffsets) { + left = 0; + top = top - offsetTop; + } + + cssOptions={ + 'position' : 'absolute', + 'top' : top, + 'left' : left, + 'margin-left' : '0px', + 'bottom' : '' + } + if (!base.options.dontSetWidth){ cssOptions['width']=target.width(); }; + + target.css(cssOptions); + + position = 'absolute'; + + target.removeClass('scroll-to-fixed-fixed'); + target.addClass('scroll-to-fixed-abs'); + + } + + // Sets the target element back to unfixed. Also, hides the spacer. + function setUnfixed() { + // console.log("setUnfixed"); + // Only unfix the target element and the spacer if we need to. + if (!isUnfixed()) { + lastOffsetLeft = -1; + + // Hide the spacer now that the target element will fill the + // space. + spacer.css('display', 'none'); + + // Remove the style attributes that were added to the target. + // This will reverse the target back to the its original style. + target.css({ + 'width' : '', + 'position' : originalPosition, + 'left' : '', + 'top' : '0px',//originalOffset.top, // removed becasue it causes the fixed switch to jump down then back up to margintop + 'margin-left' : '' + }); + + target.removeClass('scroll-to-fixed-fixed'); + target.removeClass('scroll-to-fixed-abs'); + + if (base.options.className) { + target.removeClass(base.options.className); + } + + position = null; + } + } + + // Moves the target element left or right relative to the horizontal + // scroll position. + function setLeft(x) { + // Only if the scroll is not what it was last time we did this. + if (x != lastOffsetLeft) { + // Move the target element horizontally relative to its original + // horizontal position. + target.css('left', offsetLeft - x); + + // Hold the last horizontal position set. + lastOffsetLeft = x; + } + } + + function getMarginTop() { + var marginTop = base.options.marginTop; + if (!marginTop) return 0; + + if (typeof(marginTop) === 'function') { + return marginTop.apply(target); + } + return marginTop; + } + + // Checks to see if we need to do something based on new scroll position + // of the page. + function checkScroll() { + if (!$.isScrollToFixed(target)) return; + var wasReset = isReset; + + // If resetScroll has not yet been called, call it. This only + // happens once. + if (!isReset) { + resetScroll(); + } + + // Grab the current horizontal scroll position. + var x = $(window).scrollLeft(); + + // Grab the current vertical scroll position. + var y = $(window).scrollTop(); + + // Get the limit, if there is one. + var limit = getLimit(); + + // If the vertical scroll position, plus the optional margin, would + // put the target element at the specified limit, set the target + // element to absolute. + if (base.options.minWidth && $(window).width() < base.options.minWidth) { + if (!isUnfixed() || !wasReset) { + postPosition(); + target.trigger('preUnfixed.ScrollToFixed'); + setUnfixed(); + target.trigger('unfixed.ScrollToFixed'); + } + } else if (base.options.bottom == -1) { + // If the vertical scroll position, plus the optional margin, would + // put the target element at the specified limit, set the target + // element to absolute. + if (limit > 0 && y >= limit - getMarginTop()) { + if (!isAbsolute() || !wasReset) { + postPosition(); + target.trigger('preAbsolute.ScrollToFixed'); + setAbsolute(); + target.trigger('unfixed.ScrollToFixed'); + } + // If the vertical scroll position, plus the optional margin, would + // put the target element above the top of the page, set the target + // element to fixed. + } else if (y >= offsetTop - getMarginTop()) { + if (!isFixed() || !wasReset) { + postPosition(); + target.trigger('preFixed.ScrollToFixed'); + + // Set the target element to fixed. + setFixed(); + + // Reset the last offset left because we just went fixed. + lastOffsetLeft = -1; + + target.trigger('fixed.ScrollToFixed'); + } + // If the page has been scrolled horizontally as well, move the + // target element accordingly. + setLeft(x); + } else { + // Set the target element to unfixed, placing it where it was + // before. + if (!isUnfixed() || !wasReset) { + postPosition(); + target.trigger('preUnfixed.ScrollToFixed'); + setUnfixed(); + target.trigger('unfixed.ScrollToFixed'); + } + } + } else { + if (limit > 0) { + if (y + $(window).height() - target.outerHeight(true) >= limit - (getMarginTop() || -getBottom())) { + if (isFixed()) { + postPosition(); + target.trigger('preUnfixed.ScrollToFixed'); + + if (originalPosition === 'absolute') { + setAbsolute(); + } else { + setUnfixed(); + } + + target.trigger('unfixed.ScrollToFixed'); + } + } else { + if (!isFixed()) { + postPosition(); + target.trigger('preFixed.ScrollToFixed'); + setFixed(); + } + setLeft(x); + target.trigger('fixed.ScrollToFixed'); + } + } else { + setLeft(x); + } + } + } + + function getBottom() { + if (!base.options.bottom) return 0; + return base.options.bottom; + } + + function postPosition() { + var position = target.css('position'); + + if (position == 'absolute') { + target.trigger('postAbsolute.ScrollToFixed'); + } else if (position == 'fixed') { + target.trigger('postFixed.ScrollToFixed'); + } else { + target.trigger('postUnfixed.ScrollToFixed'); + } + } + + var windowResize = function(event) { + // Check if the element is visible before updating it's position, which + // improves behavior with responsive designs where this element is hidden. + if(target.is(':visible')) { + isReset = false; + checkScroll(); + } + } + + var windowScroll = function(event) { + checkScroll(); + } + + // From: http://kangax.github.com/cft/#IS_POSITION_FIXED_SUPPORTED + var isPositionFixedSupported = function() { + var container = document.body; + + if (document.createElement && container && container.appendChild && container.removeChild) { + var el = document.createElement('div'); + + if (!el.getBoundingClientRect) return null; + + el.innerHTML = 'x'; + el.style.cssText = 'position:fixed;top:100px;'; + container.appendChild(el); + + var originalHeight = container.style.height, + originalScrollTop = container.scrollTop; + + container.style.height = '3000px'; + container.scrollTop = 500; + + var elementTop = el.getBoundingClientRect().top; + container.style.height = originalHeight; + + var isSupported = (elementTop === 100); + container.removeChild(el); + container.scrollTop = originalScrollTop; + + return isSupported; + } + + return null; + } + + var preventDefault = function(e) { + e = e || window.event; + if (e.preventDefault) { + e.preventDefault(); + } + e.returnValue = false; + } + + // Initializes this plugin. Captures the options passed in, turns this + // off for devices that do not support fixed position, adds the spacer, + // and binds to the window scroll and resize events. + base.init = function() { + // Capture the options for this plugin. + base.options = $ + .extend({}, $.ScrollToFixed.defaultOptions, options); + + // Turn off this functionality for devices that do not support it. + // if (!(base.options && base.options.dontCheckForPositionFixedSupport)) { + // var fixedSupported = isPositionFixedSupported(); + // if (!fixedSupported) return; + // } + + // Put the target element on top of everything that could be below + // it. This reduces flicker when the target element is transitioning + // to fixed. + base.$el.css('z-index', base.options.zIndex); + + // Create a spacer element to fill the void left by the target + // element when it goes fixed. + spacer = $('
    '); + + position = target.css('position'); + originalPosition = target.css('position'); + + originalOffset = $.extend({}, target.offset()); + + // Place the spacer right after the target element. + if (isUnfixed()) base.$el.after(spacer); + + // Reset the target element offsets when the window is resized, then + // check to see if we need to fix or unfix the target element. + $(window).bind('resize.ScrollToFixed', windowResize); + + // When the window scrolls, check to see if we need to fix or unfix + // the target element. + $(window).bind('scroll.ScrollToFixed', windowScroll); + + if (base.options.preFixed) { + target.bind('preFixed.ScrollToFixed', base.options.preFixed); + } + if (base.options.postFixed) { + target.bind('postFixed.ScrollToFixed', base.options.postFixed); + } + if (base.options.preUnfixed) { + target.bind('preUnfixed.ScrollToFixed', base.options.preUnfixed); + } + if (base.options.postUnfixed) { + target.bind('postUnfixed.ScrollToFixed', base.options.postUnfixed); + } + if (base.options.preAbsolute) { + target.bind('preAbsolute.ScrollToFixed', base.options.preAbsolute); + } + if (base.options.postAbsolute) { + target.bind('postAbsolute.ScrollToFixed', base.options.postAbsolute); + } + if (base.options.fixed) { + target.bind('fixed.ScrollToFixed', base.options.fixed); + } + if (base.options.unfixed) { + target.bind('unfixed.ScrollToFixed', base.options.unfixed); + } + + if (base.options.spacerClass) { + spacer.addClass(base.options.spacerClass); + } + + target.bind('resize.ScrollToFixed', function() { + spacer.height(target.height()); + }); + + target.bind('scroll.ScrollToFixed', function() { + target.trigger('preUnfixed.ScrollToFixed'); + setUnfixed(); + target.trigger('unfixed.ScrollToFixed'); + checkScroll(); + }); + + target.bind('detach.ScrollToFixed', function(ev) { + preventDefault(ev); + + target.trigger('preUnfixed.ScrollToFixed'); + setUnfixed(); + target.trigger('unfixed.ScrollToFixed'); + + $(window).unbind('resize.ScrollToFixed', windowResize); + $(window).unbind('scroll.ScrollToFixed', windowScroll); + + target.unbind('.ScrollToFixed'); + base.$el.removeData('ScrollToFixed'); + }); + + // Reset everything. + windowResize(); + }; + + // Initialize the plugin. + base.init(); + }; + + // Sets the option defaults. + $.ScrollToFixed.defaultOptions = { + marginTop : 0, + limit : 0, + bottom : -1, + zIndex : 1000 + }; + + // Returns enhanced elements that will fix to the top of the page when the + // page is scrolled. + $.fn.scrollToFixed = function(options) { + return this.each(function() { + (new $.ScrollToFixed(this, options)); + }); + }; +})(jQuery); diff --git a/admin/template/js/jquery-ui.min.js b/admin/template/js/jquery-ui.min.js new file mode 100644 index 0000000..618b8ef --- /dev/null +++ b/admin/template/js/jquery-ui.min.js @@ -0,0 +1,15 @@ +/*! + * jQuery UI 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})}(jQuery),function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e
    ');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),a.browser.opera&&/relative/.test(f.css("position"))&&f.css({position:"relative",top:"auto",left:"auto"}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d
    ');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.17"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10),position:b.css("position")})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,e){a(b).each(function(){var b=a(this),f=a(this).data("resizable-alsoresize"),g={},i=e&&e.length?e:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(i,function(a,b){var c=(f[b]||0)+(h[b]||0);c&&c>=0&&(g[b]=c||null)}),a.browser.opera&&/relative/.test(b.css("position"))&&(d._revertToRelativePosition=!0,b.css({position:"absolute",top:"auto",left:"auto"})),b.css(g)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};d._revertToRelativePosition&&(d._revertToRelativePosition=!1,typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)),a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}}(jQuery),function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this +.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f
    ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h
    ").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}}(jQuery),function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}}(jQuery),function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e
    ').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}}(jQuery),function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.17",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})}(jQuery),function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("
      ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",autocompleteRequest:++c,success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length").data("item.autocomplete",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})}(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})}(jQuery),function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('
      '))}$.extend($.ui,{datepicker:{version:"1.8.17"}});var PROP_NAME="datepicker" +,dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
      ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
      '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
      ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
      '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
      '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
      '+this._get(a,"weekHeader")+"
      '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
      "+(j?"
      "+(g[0]>0&&N==g[1]-1?'
      ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""),a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
      ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
      ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date +(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.17",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
      ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
      ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.17",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()
      ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&jQuery.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()}(jQuery),function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
      ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.17"})}(jQuery),function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("
      ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.17"})}(jQuery),function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
    • #{label}
    • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing" +)||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.17"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a

      ' + $msg + '

      '); + $('div.bodycontent').before($notify); + return $notify; + } +} + +function clearNotify() { + $('div.wrapper .notify').remove(); +} + +basename = function(str){ + return str.substring(0,str.lastIndexOf('/') ); +} + + +function i18n(key){ + return GS.i18n[key]; +} + +function checkCoords() { + if (parseInt($('#x').val())) return true; + alert('Please select a crop region then press submit.'); + return false; +}; + +jQuery(document).ready(function () { + + var loadingAjaxIndicator = $('#loader'); + + /* Listener for filter dropdown */ + function attachFilterChangeEvent() { + $(document).on('change', "#imageFilter", function () { + Debugger.log('attachFilterChangeEvent'); + loadingAjaxIndicator.show(); + var filterx = $(this).val(); + $("#imageTable").find("tr").hide(); + if (filterx == 'Images') { + $("#imageTable").find("tr .imgthumb").show(); + } else { + $("#imageTable").find("tr .imgthumb").hide(); + } + $("#filetypetoggle").html('  /  ' + filterx); + $("#imageTable").find("tr." + filterx).show(); + $("#imageTable").find("tr.folder").show(); + $("#imageTable").find("tr:first-child").show(); + $("#imageTable").find("tr.deletedrow").hide(); + loadingAjaxIndicator.fadeOut(500); + }); + } + + //upload.php + attachFilterChangeEvent(); + + //image.php + var copyKitTextArea = $('textarea.copykit'); + $("select#img-info").change(function () { + var codetype = $(this).val(); + var code = $('p#' + codetype).html(); + var originalBG = $('textarea.copykit').css('background-color'); + var fadeColor = "#FFFFD1"; + copyKitTextArea.fadeOut(500).fadeIn(500).html(code); + }); + $(".select-all").live("click", function () { + copyKitTextArea.focus().select(); + return false; + }); + + + //autofocus index.php & resetpassword.php fields on pageload + $("#index input#userid").focus(); + $("#resetpassword input[name='username']").focus(); + var options = { + caps_lock_on: function () { + $(this).addClass('capslock'); + }, + caps_lock_off: function () { + $(this).removeClass('capslock'); + }, + caps_lock_undetermined: function () { + $(this).removeClass('capslock'); + } + }; + + $("input[type='password']").capslock(options); + + + // components.php + + function focusCompEditor(selector){ + var editor = $(selector + ' textarea'); + editor.focus(); + } + + // auto focus component editors + $('#components div.compdivlist a').on('click', function(ev){ + focusCompEditor($(this).attr('href')); + e.preventDefault(); + }); + + $(".delconfirmcomp").live("click", function ($e) { + $e.preventDefault(); + loadingAjaxIndicator.show(); + var message = $(this).attr("title"); + var answer = confirm(message); + if (answer) { + var compid = $(this).attr("rel"); + $(compid).slideToggle(500).remove(); + } + loadingAjaxIndicator.fadeOut(500); + }); + $("#addcomponent").live("click", function ($e) { + $e.preventDefault(); + loadingAjaxIndicator.show(); + var id = $("#id").val(); + $("#divTxt").prepend('