From 2644a7e656b60de4faa8051655d94c758af8a453 Mon Sep 17 00:00:00 2001 From: Tim Jordan Date: Thu, 16 Feb 2012 17:46:23 -0500 Subject: [PATCH] update --- .../sites/all/modules/ckeditor/CHANGELOG.txt | 355 + .../sites/all/modules/ckeditor/LICENSE.txt | 339 + docroot/sites/all/modules/ckeditor/README.txt | 327 + .../all/modules/ckeditor/TROUBLESHOOTING.txt | 215 + .../sites/all/modules/ckeditor/UPGRADE.txt | 30 + .../all/modules/ckeditor/ckeditor-rtl.css | 34 + .../all/modules/ckeditor/ckeditor.api.php | 58 + .../all/modules/ckeditor/ckeditor.config.js | 101 + .../sites/all/modules/ckeditor/ckeditor.css | 123 + .../sites/all/modules/ckeditor/ckeditor.info | 12 + .../all/modules/ckeditor/ckeditor.install | 514 + .../all/modules/ckeditor/ckeditor.module | 485 + .../all/modules/ckeditor/ckeditor.styles.js | 91 + .../modules/ckeditor/ckeditor/COPY_HERE.txt | 3 + .../modules/ckeditor/images/buttons/about.png | Bin 0 -> 1221 bytes .../ckeditor/images/buttons/anchor.png | Bin 0 -> 1215 bytes .../images/buttons/backgroundColor.png | Bin 0 -> 1238 bytes .../ckeditor/images/buttons/bidiLeft.png | Bin 0 -> 1149 bytes .../ckeditor/images/buttons/bidiRight.png | Bin 0 -> 1149 bytes .../ckeditor/images/buttons/blockJustify.png | Bin 0 -> 1124 bytes .../ckeditor/images/buttons/blockQuote.png | Bin 0 -> 1164 bytes .../modules/ckeditor/images/buttons/bold.png | Bin 0 -> 1156 bytes .../ckeditor/images/buttons/bulletedList.png | Bin 0 -> 1131 bytes .../ckeditor/images/buttons/button.png | Bin 0 -> 1191 bytes .../ckeditor/images/buttons/centerJustify.png | Bin 0 -> 1128 bytes .../ckeditor/images/buttons/checkSpelling.png | Bin 0 -> 1193 bytes .../ckeditor/images/buttons/checkbox.png | Bin 0 -> 1171 bytes .../modules/ckeditor/images/buttons/copy.png | Bin 0 -> 1193 bytes .../images/buttons/createDivContainer.png | Bin 0 -> 1166 bytes .../modules/ckeditor/images/buttons/cut.png | Bin 0 -> 1233 bytes .../images/buttons/decreaseIndent.png | Bin 0 -> 1153 bytes .../ckeditor/images/buttons/drupalbreak.png | Bin 0 -> 191 bytes .../images/buttons/drupalpagebreak.png | Bin 0 -> 212 bytes .../modules/ckeditor/images/buttons/find.png | Bin 0 -> 1199 bytes .../modules/ckeditor/images/buttons/flash.png | Bin 0 -> 1226 bytes .../modules/ckeditor/images/buttons/font.png | Bin 0 -> 3663 bytes .../ckeditor/images/buttons/fontSize.png | Bin 0 -> 3657 bytes .../modules/ckeditor/images/buttons/form.png | Bin 0 -> 1141 bytes .../ckeditor/images/buttons/format.png | Bin 0 -> 3815 bytes .../modules/ckeditor/images/buttons/group.png | Bin 0 -> 190 bytes .../ckeditor/images/buttons/hiddenField.png | Bin 0 -> 1313 bytes .../images/buttons/horizontalLine.png | Bin 0 -> 1158 bytes .../modules/ckeditor/images/buttons/icon.png | Bin 0 -> 4405 bytes .../ckeditor/images/buttons/iframe.png | Bin 0 -> 409 bytes .../modules/ckeditor/images/buttons/image.png | Bin 0 -> 1267 bytes .../ckeditor/images/buttons/imageButton.png | Bin 0 -> 1199 bytes .../images/buttons/increaseIndent.png | Bin 0 -> 1156 bytes .../ckeditor/images/buttons/index.html | 1 + .../ckeditor/images/buttons/italic.png | Bin 0 -> 1142 bytes .../ckeditor/images/buttons/leftJustify.png | Bin 0 -> 1128 bytes .../modules/ckeditor/images/buttons/link.png | Bin 0 -> 1224 bytes .../ckeditor/images/buttons/linkit.png | Bin 0 -> 608 bytes .../ckeditor/images/buttons/linktomenu.gif | Bin 0 -> 971 bytes .../ckeditor/images/buttons/linktonode.gif | Bin 0 -> 979 bytes .../ckeditor/images/buttons/maximize.png | Bin 0 -> 1184 bytes .../ckeditor/images/buttons/newPage.png | Bin 0 -> 1142 bytes .../ckeditor/images/buttons/numberedList.png | Bin 0 -> 1149 bytes .../images/buttons/pageBreakPrinting.png | Bin 0 -> 1185 bytes .../modules/ckeditor/images/buttons/paste.png | Bin 0 -> 1224 bytes .../images/buttons/pastePlainText.png | Bin 0 -> 1246 bytes .../ckeditor/images/buttons/pasteWord.png | Bin 0 -> 1242 bytes .../ckeditor/images/buttons/preview.png | Bin 0 -> 1193 bytes .../modules/ckeditor/images/buttons/print.png | Bin 0 -> 1183 bytes .../ckeditor/images/buttons/radioButton.png | Bin 0 -> 1164 bytes .../images/buttons/readmoreButton.png | Bin 0 -> 1145 bytes .../modules/ckeditor/images/buttons/redo.png | Bin 0 -> 1168 bytes .../ckeditor/images/buttons/removeFormat.png | Bin 0 -> 1176 bytes .../ckeditor/images/buttons/replace.png | Bin 0 -> 1182 bytes .../ckeditor/images/buttons/rightJustify.png | Bin 0 -> 1128 bytes .../modules/ckeditor/images/buttons/save.png | Bin 0 -> 1197 bytes .../ckeditor/images/buttons/selectAll.png | Bin 0 -> 1165 bytes .../images/buttons/selectionField.png | Bin 0 -> 912 bytes .../ckeditor/images/buttons/showBlocks.png | Bin 0 -> 1197 bytes .../ckeditor/images/buttons/smiley.png | Bin 0 -> 1212 bytes .../ckeditor/images/buttons/source.png | Bin 0 -> 1171 bytes .../ckeditor/images/buttons/spacer.png | Bin 0 -> 1233 bytes .../images/buttons/specialCharacter.png | Bin 0 -> 1175 bytes .../ckeditor/images/buttons/strike.png | Bin 0 -> 1147 bytes .../ckeditor/images/buttons/styles.png | Bin 0 -> 3822 bytes .../ckeditor/images/buttons/subscript.png | Bin 0 -> 1170 bytes .../ckeditor/images/buttons/superscript.png | Bin 0 -> 1172 bytes .../modules/ckeditor/images/buttons/table.png | Bin 0 -> 1182 bytes .../ckeditor/images/buttons/templates.png | Bin 0 -> 1165 bytes .../ckeditor/images/buttons/textColor.png | Bin 0 -> 1201 bytes .../ckeditor/images/buttons/textField.png | Bin 0 -> 1197 bytes .../ckeditor/images/buttons/textarea.png | Bin 0 -> 956 bytes .../ckeditor/images/buttons/underline.png | Bin 0 -> 1143 bytes .../modules/ckeditor/images/buttons/undo.png | Bin 0 -> 1173 bytes .../ckeditor/images/buttons/unlink.png | Bin 0 -> 1220 bytes .../ckeditor/includes/ckeditor.admin.inc | 1401 ++ .../ckeditor/includes/ckeditor.admin.js | 159 + .../ckeditor/includes/ckeditor.drush.inc | 68 + .../ckeditor/includes/ckeditor.features.inc | 109 + .../ckeditor/includes/ckeditor.lib.inc | 1537 +++ .../ckeditor/includes/ckeditor.page.inc | 187 + .../ckeditor/includes/ckeditor.popup.html | 87 + .../ckeditor/includes/ckeditor.user.inc | 174 + .../ckeditor/includes/ckeditor.utils.js | 294 + .../ckeditor/includes/filemanager.config.php | 97 + .../ckeditor/includes/jqueryUI/jquery-ui.js | 11511 ++++++++++++++++ .../includes/jqueryUI/jquery.ui.sortable.js | 1071 ++ .../includes/jqueryUI/jquery.ui.widget.js | 262 + .../ckeditor/includes/jqueryUI/sort.js | 151 + .../ckeditor/plugins/counter/plugin.js | 60 + .../drupalbreaks/images/drupalbreak.png | Bin 0 -> 191 bytes .../drupalbreaks/images/drupalpagebreak.png | Bin 0 -> 212 bytes .../plugins/drupalbreaks/images/pagebreak.gif | Bin 0 -> 54 bytes .../ckeditor/plugins/drupalbreaks/plugin.js | 166 + .../ckeditor/plugins/imce/images/icon.png | Bin 0 -> 523 bytes .../modules/ckeditor/plugins/imce/plugin.js | 67 + .../ckeditor/plugins/media/images/icon.gif | Bin 0 -> 126 bytes .../modules/ckeditor/plugins/media/library.js | 349 + .../modules/ckeditor/plugins/media/plugin.js | 58 + .../plugins/mediaembed/images/icon.png | Bin 0 -> 560 bytes .../plugins/mediaembed/images/placeholder.gif | Bin 0 -> 2711 bytes .../ckeditor/plugins/mediaembed/plugin.js | 147 + ...xonomy_node_get_terms_fail_959984_82.patch | 232 + 117 files changed, 20875 insertions(+) create mode 100644 docroot/sites/all/modules/ckeditor/CHANGELOG.txt create mode 100644 docroot/sites/all/modules/ckeditor/LICENSE.txt create mode 100644 docroot/sites/all/modules/ckeditor/README.txt create mode 100644 docroot/sites/all/modules/ckeditor/TROUBLESHOOTING.txt create mode 100644 docroot/sites/all/modules/ckeditor/UPGRADE.txt create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor-rtl.css create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor.api.php create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor.config.js create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor.css create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor.info create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor.install create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor.module create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor.styles.js create mode 100644 docroot/sites/all/modules/ckeditor/ckeditor/COPY_HERE.txt create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/about.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/anchor.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/backgroundColor.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/bidiLeft.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/bidiRight.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/blockJustify.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/blockQuote.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/bold.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/bulletedList.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/button.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/centerJustify.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/checkSpelling.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/checkbox.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/copy.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/createDivContainer.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/cut.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/decreaseIndent.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/drupalbreak.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/drupalpagebreak.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/find.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/flash.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/font.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/fontSize.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/form.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/format.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/group.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/hiddenField.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/horizontalLine.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/icon.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/iframe.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/image.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/imageButton.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/increaseIndent.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/index.html create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/italic.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/leftJustify.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/link.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/linkit.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/linktomenu.gif create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/linktonode.gif create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/maximize.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/newPage.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/numberedList.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/pageBreakPrinting.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/paste.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/pastePlainText.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/pasteWord.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/preview.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/print.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/radioButton.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/readmoreButton.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/redo.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/removeFormat.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/replace.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/rightJustify.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/save.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/selectAll.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/selectionField.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/showBlocks.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/smiley.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/source.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/spacer.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/specialCharacter.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/strike.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/styles.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/subscript.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/superscript.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/table.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/templates.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/textColor.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/textField.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/textarea.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/underline.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/undo.png create mode 100644 docroot/sites/all/modules/ckeditor/images/buttons/unlink.png create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.admin.inc create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.admin.js create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.drush.inc create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.features.inc create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.lib.inc create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.page.inc create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.popup.html create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.user.inc create mode 100644 docroot/sites/all/modules/ckeditor/includes/ckeditor.utils.js create mode 100644 docroot/sites/all/modules/ckeditor/includes/filemanager.config.php create mode 100644 docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery-ui.js create mode 100644 docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.sortable.js create mode 100644 docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.widget.js create mode 100644 docroot/sites/all/modules/ckeditor/includes/jqueryUI/sort.js create mode 100644 docroot/sites/all/modules/ckeditor/plugins/counter/plugin.js create mode 100644 docroot/sites/all/modules/ckeditor/plugins/drupalbreaks/images/drupalbreak.png create mode 100644 docroot/sites/all/modules/ckeditor/plugins/drupalbreaks/images/drupalpagebreak.png create mode 100644 docroot/sites/all/modules/ckeditor/plugins/drupalbreaks/images/pagebreak.gif create mode 100644 docroot/sites/all/modules/ckeditor/plugins/drupalbreaks/plugin.js create mode 100644 docroot/sites/all/modules/ckeditor/plugins/imce/images/icon.png create mode 100644 docroot/sites/all/modules/ckeditor/plugins/imce/plugin.js create mode 100644 docroot/sites/all/modules/ckeditor/plugins/media/images/icon.gif create mode 100644 docroot/sites/all/modules/ckeditor/plugins/media/library.js create mode 100644 docroot/sites/all/modules/ckeditor/plugins/media/plugin.js create mode 100644 docroot/sites/all/modules/ckeditor/plugins/mediaembed/images/icon.png create mode 100644 docroot/sites/all/modules/ckeditor/plugins/mediaembed/images/placeholder.gif create mode 100644 docroot/sites/all/modules/ckeditor/plugins/mediaembed/plugin.js create mode 100644 docroot/sites/all/modules/feeds.taxonomy_node_get_terms_fail_959984_82.patch diff --git a/docroot/sites/all/modules/ckeditor/CHANGELOG.txt b/docroot/sites/all/modules/ckeditor/CHANGELOG.txt new file mode 100644 index 0000000..2e87d05 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/CHANGELOG.txt @@ -0,0 +1,355 @@ +2011-11-10 +New stable relase 7.x-1.6 +[#1337064] Fix Fatal error: Call to undefined function db_fetch_object() + +2011-11-09 +New stable relase 7.x-1.5 + +Bug fixes: +[#1334140] by michal_cksource: CKEditor is cut off in comments form +[#1331728] by michal_cksource: Remove unnecessary Drupal Page Break button if there is no module to support this feature +[#1331720] by michal_cksource: Fix broken link to Global Profile in CKEditor configuration main page +[#1331716] by michal_cksource: Fix missing version number in report status +[#1324554] by dczepierga: Fix adding custom plugin - change in ckeditor.api.php +[#1283918] by michal_cksource: Fix UTF-8 issues +[#1327540] by michal_cksource: Fix hook_file_download allows downloading of private files created by another module +[#1325412] by michal_cksource: Fix problem with list-style-type in ckeditor.css + + +2011-10-26 +New stable relase 7.x-1.4 + +-- 2011-10-24 +- [#1319658] by michal_cksource: Correct language list in the CKEditor profile configuration + +-- 2011-10-20 +- [#1259510] by michal_cksource: Fix for setting a private files folder breaks CKEditor file uploads + +-- 2011-10-17 +- [#1310280] by dczepierga: Improve icons detection from CKEditor plugins (part 2) +- [#1298972] by michal_cksource: Correct messages and add language fixes +- [#1311928] by dczepierga: Add jquery_ui support to the Drag & Drop toolbar configuration + +-- 2011-10-14 +- [#1310280] by dczepierga: Improve icons detection from CKEditor plugins +- [#1295176] by dczepierga: Fix Notice: Undefined index: default in ckeditor_admin_profile_form() - when editing CKEditor profile +- [#1310198] by duozersk: Add plugin to count symbols and words inside CKEditor + +-- 2011-10-04 +- [#1298972] by michal_cksource: Correct messages and add language fixes + +-- 2011-09-26 +- [#1154264] by dczepierga: Fix for deleting profle - after deleting the Advanced profile, Full HTML profile doesn't load + +-- 2011-09-23 +- [#1288084] by dczepierga: Disable Media and IMCE module selection if these modules are not installed + +-- 2011-09-20 +- [#1283788] by dczepierga: Fix Notice: Undefined index: buttons in ckeditor_toolbar_buttons_all() + +-- 2011-09-19 +- [#1219348] by dczepierga: Fix for WYSIWYG filter - add missing argument + +-- 2011-09-15 +- [#1280298] by dczepierga: Add configuration option to disable text format filters in filter/xss request +- [#1270792] by dczepierga: Further improvements to the Drag & Drop toolbar configuration + +-- 2011-09-13 +- [#1173294] by dczepierga: Fix for incorrect file path for uploaded Images + +-- 2011-09-12 +- [#1270792] by michal_cksource: Improved Drag & Drop toolbar configuration - fixed css styles +- [#1270792] by michal_cksource: Improved Drag & Drop toolbar configuration - fixed errors (dragged item was to low in Firefox and validation failed when 'group' button was first in buttons row) + +-- 2011-09-06 +- [#1270792] by dczepierga: Add Drag & Drop toolbar configuration + +-- 2011-08-31 +- [#1264884] by dczepierga: Fix warning: is_dir(): open_basedir restriction in effect + +----------------------------- + 2011-08-29 + Released CKEditor 7.x-1.3 +----------------------------- + +-- 2011-08-29 +- [#1260892] by dczepierga: Add regex to work with new CKEditor toolbar format (toolbar groups compatible with WAI-ARIA) +- [#1258326] by dczepierga: Add configuration option for setting CKEditor plugins directory + +-- 2011-08-25 +- [#1257308] by dczepierga: Add loading sample toolbar to profile configuration +- [#1192622] by dczepierga: Replace static paths to plugins in the database with dynamic paths + +-- 2011-08-16 +- [#1250496] by dczepierga: 'CKEDITOR' is not defined - problem with ckeditor.styles.js + +-- 2011-08-11 +- [#1231130] by dczepierga: The "Use theme style" setting now always uses the "seven" theme (admin menu theme) + +-- 2011-08-10 +- [#1245306] by dczepierga: "Custom JavaScript configuration" field description is wrong + +-- 2011-08-08 +- [#1231338] by dczepierga: Features module support for Drupal 7 (exporting profiles) + +-- 2011-08-02 +- [#1235142] by madmanmax: README.TXT - Installing CKFinder - wrong permission name + +-- 2011-07-12 +- [#1216104] by dczepierga: Bug in custom JavaScript configuration - semicolon problem +- [#1215032] by dczepierga: Bad location of the configuration file in the description of CKEditor profile + +-- 2011-07-04 +- [#1190278] by dczepierga: CKEditor does not work with the Insert module + +-- 2011-06-28 +- [#1198068] by michal_cksource: Confusing behavior with IMCE button implementation + +-- 2011-06-27 +- [#1201180] by dczepierga: SCAYT spelling language does not match node language + +-- 2011-06-22 +- [#1196166] by dczepierga: Bug in custom JavaScript configuration - editor not showing in some cases + +-- 2011-06-17 +- [#1032120] by dczepierga: Formatting is lost when editing a node + +-- 2011-06-14 +- [#1187808] by RolandK: Not formatting text between code tags + +-- 2011-06-13 +- [#1186880] by dczepierga: Handling arrays in the "Custom JavaScript configuration" + +-- 2011-06-09 +- [#1183218] by neclimdul: Fix broken teasers for long paragraphs + +-- 2011-06-06 +- [#1179880] by dczepierga: Add hook to register a plugin +- [#1063646] by dczepierga: Fix calling Undefined index: "loadPlugins" in ckeditor_admin_values_to_settings() + +-- 2011-06-02 +- [#1176212] by dczepierga: Remove not supported linktomenu and linktonode plugins +- [#1176208] by dczepierga: Add plugins management in profile settings + +----------------------------- + 2011-05-30 + Released CKEditor 7.x-1.2 +----------------------------- + +-- 2011-05-27 +- [#1170612] by dczepierga: Add support for autogrow and tableresize plugin + +-- 2011-05-26 +- [#1169402] by dczepierga: Fix duplicated path in the error message displayed when CKEditor is not installed correctly + +-- 2011-05-23 +- [#1165864] by dczepierga: Improve manual selection of the user interface color +- [#1093038] by marhak: CKEDITOR is not defined when using ckeditor_basic.js - Editor is not loading +- [#1039810] by cwc: Fix to predefined styles path errors (fix typo) +- [#1164270] by TommyChris: Fix to work with ckeditor_link module (http://drupal.org/project/ckeditor_link) + +-- 2011-05-16 +- [#1158898] by dczepierga: Add Google PageSpeed and Drupal JS/CSS aggregation support + +-- 2011-05-09 +- [#1134252] by dczepierga: Add HTML Entities configurable option in each profile + +-- 2011-05-04 +- [#1022986] by dczepierga: Add integration with Media Module + +-- 2011-05-02 +- [#1142600] by taite11: Readme file edit - there is no core upload module in Drupal 7 + +-- 2011-04-28 +- [#1022986] by dczepierga: Add integration with Media Module (http://drupal.org/project/media) + +-- 2011-04-11 +- [#1116516] by weboide: Fix to CKEditor and Profile2 - remove call to undefined function ckeditor_user_customize_form_validate() on uid=1 + +-- 2011-04-07 +- [#1093028] by marhak: Text written in rich text editor (WYSIWYG) mode disappears when switching to plain text editor mode +- [#1102824] by dczepierga: CKEditor loses all text when uploading an image or file via field API + +-- 2011-03-31 +- [#1093038] by marhak: CKEDITOR is not defined when using ckeditor_basic.js - Editor is not loading + +-- 2011-03-30 +- [#1109366] by dczepierga: #1052604 Fix remove call to undefined function ckeditor_user_customize_form_validate + +-- 2011-03-29 +- [#1107882] by dczepierga: Add a warning message when the wysiwyg module is enabled in Drupal 7 + +-- 2011-03-28 +- [#1107882] by dczepierga: Add a warning message when the wysiwyg module is enabled in Drupal 7 + +-- 2011-03-23 +- [#1039810] by cwc: Fix to predefined styles path errors + +-- 2011-03-17 +- [#1095954] by dczepierga: Fix to prevent calling "Toggle rich text link" multiple times + +----------------------------- + 2011-03-10 + Released CKEditor 7.x-1.1 +----------------------------- + +-- 2011-02-22 +- [#960576] by dczepierga: Add loading ckeditor.css from theme. +- [#1069012] by dczepierga: CKEditor version could not be determined + +-- 2011-02-21 +- [#1068186] by dczepierga: Added support for CKEditor SWF (http://drupal.org/project/ckeditor_swf) and CKEditor Link (http://drupal.org/project/ckeditor_link) modules + +-- 2011-02-17 +- [#1064422] by dczepierga: All changes to the text are lost when input format is changed + +-- 2011-02-14 +- [#1053222] by dczepierga: Two editors appeared when JavaScript Aggregation was enabled +- [#1037390] by dczepierga: Cannot use CKEditor module to create header/footer in Views +- [#1052604] by dczepierga: Call to undefined function ckeditor_user_customize_form_validate + +-- 2011-02-11 +- [#1056068] by dczepierga: Fix Warning: file_get_contents(/drupal7/sites/all/libraries/ckeditor/ckeditor.js) + +-- 2011-02-08 +- [#1054414] by dczepierga: Added support for elFinder (http://drupal.org/project/elfinder) file manager +- [#1054606] by dczepierga: No detach method in Drupal.behaviors.ckeditor + +-- 2011-02-07 +- [#1037390] by dczepierga: Cannot use CKEditor module to create header/footer in Views +- [#1053358] by dczepierga: Removed option to "Use CKEditor in a popup window" in "My account" settings + +-- 2011-02-04 +- [#1050034] by dczepierga: Disabled editor gets enabled again after ajax calls + +-- 2011-02-03 +- [#1037390] by dczepierga: Cannot use CKEditor module to create header/footer in Views + +-- 2011-02-01 +- [#1037390] by dczepierga: Cannot use CKEditor module to create header/footer in Views + +-- 2011-01-24 +- [#1035544] by dczepierga: Remove double http:// in ckeditor.drush.inc + +-- 2011-01-20 +- [#1006770] by OnkelTem: Fix Notice: Undefined index: filtered_html in ckeditor_profile_load() + +----------------------------- + 2011-01-13 + Released CKEditor 7.x-1.0 +----------------------------- + +-- 2011-01-13 +- Added Upgrade.txt +- Fixed filters description (HTML should be allowed there) +- Link to CKEditor Global Profile was not displayed properly. +- [#1025472] by dczepierga: Starting slash in editor path result in Warnings +- [#1022562] by dczepierga: In IE8 break button icon doesn't appear +- [#1023546] by dczepierga: Useless ajax call when no security filters are checked + +-- 2011-01-11 +- [#1022666] by dczepierga: Teaser break doesn't work with filtered html input format. +- [#1022494] by dczepierga: CKEditor module - Compatibility with Drupal's coding standards + +-- 2011-01-10 +- [#1011112] by Oren_Held: Support RTL also when CSS is not in theme mode (self/none) +- [#1020612] by amateescu: Extra table borders added by the Seven theme +- [#1003462] by dczepierga: CKfinder path customization won't work +- [#1020820] by dczepierga: CKEditor does not work after enabling javascript aggregation +- [#1006230] by amateescu: Editor not loading for Full HTML + +-- 2011-01-05 +- [#1006770] by dczepierga: Notice: Undefined index: filtered_html in ckeditor_profile_load() + +-- 2010-12-29 +- [#1009816] by dczepierga: Access denied: ckeditor/xss +- [#1004822] by dczepierga: Switching text format to filtered html deletes all "p" tags + +-- 2010-12-28 +- [#1006124] by dczepierga: Registered user gets "Undefined index: popup" message +- [#1000330] by dczepierga: No Insert File button in IMCE + +-- 2010-12-20 +- [#1000838] by dczepierga: The Teaser button is absolutely necessary - important functionality has been deleted + +----------------------------- + 2010-12-15 + Released CKEditor 7.x-1.0 RC +----------------------------- + +-- 2010-12-15 +- [#991380] by dczepierga: Language files (D7) +- Removed a link to delete the global profile +- [#999292] by dczepierga: Remove filter_html as default option in Full HTML text format (D7) +- Fixed a typo +- Updated comments, minor corrections + +-- 2010-12-14 +- [#997136] by dczepierga: CKFinder - thumbnails not available +- [#997124] by dczepierga: Invalid error message when CKFinder is enabled but not configured properly. +- [#997116] by dczepierga: D7 Custom formatting options not used +- [#997090] by dczepierga: XSS protection not working as expected +- [#997098] by dczepierga: Error when CKEditor (the editor) is not present in the ckeditor folder + +-- 2010-12-13 +- [#997074] by dczepierga: Corect the default order of Bidi buttons + +-- 2010-12-10 +- [#994372] by dczepierga: Update README.TXT (D7) + +-- 2010-12-09 +- [#993436] by dczepierga: Disable option of using CKEditor in a popup window (D7) +- [#993362] by dczepierga: CKEditor not work in popup window (D7) +- [#993330] by dczepierga: Change editor theme in profile edit form (D7) +- [#993272] by dczepierga: User Interface color change enabled only for Kama skin + +-- 2010-12-07 +- [#991380] by dczepierga: Language files (D7) +- [#984986] by dczepierga: Code syntax after Coder module validation +- [#984978] by dczepierga: Security filters not works (D7) - Security mode fix +- [#984968] by dczepierga: Make sure that the help information is correct (D7) + +-- 2010-12-06 +- [#990368] by dczepierga: Cleanup code - modules not ported to Drupal 7 +- [#985006] by dczepierga: Review README.txt (D7) + +-- 2010-12-04 +- [#984978] by dczepierga: Security filters not works (D7) + +-- 2010-12-03 +- [#984976] by dczepierga: User Interface color not saved in D7 +- [#985002] by dczepierga: Remove DrupalPageBreak button from toolbar + +-- 2010-11-30 +- [#984986] by dczepierga: Code syntax after Coder module validation +- Removed extra information that should be added by the packaging script + +-- 2010-11-29 +- [#984202] by dczepierga: Detecting of summary field in form +- [#966490] by dczepierga: Comment form after ckeditor install. +- [#966492] by dczepierga: CKEditor in edit summary/teaser mode +- [#984096] by dczepierga: Compatibility of DrupalBreaks Plugin +- [#984000] by dczepierga: CKeditor not works in node edit + +-- 2010-11-25 +- [#981624] by dczepierga: Compatibility with drupal 7.0-beta3 +- [#966488] by dczepierga: CKEditor should respect input format changes + +-- 2010-11-23 +- [#976968] by dczepierga: Toolbar config validation in profile + +-- 2010-11-19 +- [#901502] by dczepierga: Multi toolbar configuration, and different settings for each +- [#975360] by dczepierga: Remove Minimum rows +- [#975456] by dczepierga: Remove visibility settings in Global profile in D7 +- [#975458] by dczepierga: Selecting UI Color not working + +-- 2010-11-09 +- [#966598] by dczepierga: CKFinder compatibility + +-- 2010-11-08 +- [#965280] by dczepierga: Profiles after save lose all input formats +- [#965258] by dczepierga: Compatibility with drupal 7.0-beta2 + +-- 2010-10-26 +- Created initial dev version of the CKEditor module for Drupal 7.x diff --git a/docroot/sites/all/modules/ckeditor/LICENSE.txt b/docroot/sites/all/modules/ckeditor/LICENSE.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This 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 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This 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. diff --git a/docroot/sites/all/modules/ckeditor/README.txt b/docroot/sites/all/modules/ckeditor/README.txt new file mode 100644 index 0000000..487230f --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/README.txt @@ -0,0 +1,327 @@ + +CONTENTS OF THIS FILE +--------------------- + + * Overview + * Required Components + * More Information and License + * Requirements + * Installation / Configuration + * Installation Troubleshooting + * Managing Plugins + * Installing Additional Plugins + * Integrating with the CKEditor Module (for Plugin Developers) + * Uploading Images and Files + * Installing CKFinder + * Setting up Filters + * Upgrading Instructions + * Help & Contribution + * Credits + +Overview +-------- +This module allows Drupal to replace textarea fields with CKEditor. +CKEditor is an online rich text editor that can be embedded inside web pages. +It is a WYSIWYG (What You See Is What You Get) editor which means that the +text edited in it looks as similar as possible to the results end users will +see after the document gets published. It brings to the Web popular editing +features found in desktop word processors such as Microsoft Word and +OpenOffice.org Writer. CKEditor is truly lightweight and does not require any +kind of installation on the client computer. + +Required Components +------------------- +To use CKEditor in Drupal, you will need to download CKEditor from the official +download site: http://ckeditor.com/download + +More Information and License +---------------------------- +CKEditor - The text editor for the Internet +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. + +Licensed under the terms of the GNU Lesser General Public License: + http://www.opensource.org/licenses/lgpl-license.php + +For further information visit: + http://ckeditor.com/ + http://drupal.ckeditor.com + +Requirements +------------ + - Drupal 7.x + - PHP 5.2 or greater + - CKEditor 3.4 or greater (http://ckeditor.com/) + +Installation / Configuration +---------------------------- +Note: these instructions assume that you install CKEditor in the + "sites/all/modules" directory (recommended). + + 1. Unzip the files to the "sites/all/modules" directory. It should now + contain a "ckeditor" directory. + 2. Download standalone CKEditor from http://ckeditor.com/download. Unzip the + contents of the "ckeditor" directory from the installation package to the + "sites/all/modules/ckeditor/ckeditor" or "sites/all/libraries/ckeditor" directory. + Note: you can skip uploading the "_samples" and "_source" folders. + 3. Enable the module in the "Administration panel > Modules > User Interface" section. + 4. Grant permissions for using CKEditor in the + "Administration panel > People > Permissions" section. + Note: In order to enable the file browser, refer to the + "Installing CKFinder" section. + 5. Adjust CKEditor profiles in the + "Administration panel > Configuration > Content Authoring > CKEditor" section. + Profiles determine which options are available to users based on the input format system. + 6. For the Rich Text Editing to work you also need to configure your filters + for the users that may access Rich Text Editing. + Either grant those users Full HTML access or use the following tags: +


+

    1. + To make copying the list easier, below all tags were placed in one line: +




      +
       
      +
      + If you are going to use CKEditor with the Filtered HTML input format, + please refer to the "Setting up Filters" section. + 7. To have better control over line breaks, you may disable the Line break converter + for a given Text format in the "Administration panel > Configuration > Content authoring > Text formats" section (recommended). + 8. Modify the ckeditor.config.js file to customize it to your needs (optional). + Configuration options are described here: + http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html + Developer's documentation for CKEditor: + http://docs.cksource.com/CKEditor_3.x/Developers_Guide + WARNING: Remember to clear the browser cache after you have modified any of the JavaScript files. + If you skip this step, you may notice that the browser is ignoring your changes. + + +Installation Troubleshooting +---------------------------- +If CKEditor does not appear on the page, check if all files were +extracted correctly. + +The "/modules/ckeditor/ckeditor/" or "/libraries/ckeditor" directory should contain the following files: +ckeditor.js, config.js, contents.css +and directories: "skins", "themes", "lang", "images". + +Alternatively the "sites/all/libraries/ckeditor" directory can be used. +The CKEditor module will automatically recognize the proper path to the editor. +The "libraries" directory is the default path when drush is used to download the editor JavaScript. + +The correct directory structure is as follows: +modules + ckeditor + ckeditor.module + ckeditor.admin.inc + ... + ckeditor + _source + images + lang + plugins + skins + themes + COPY_HERE.txt + ckeditor.js + ... + +If you are still experiencing problems with your CKEditor installation, scroll down to the "Help & Contribution" section. + +Managing Plugins +---------------- +If you want to manage CKEditor plugins for a profile, go to the "Administration panel > Configuration > Content Authoring > CKEditor" section. +This section lets you choose plugins relevant for each CKEditor profile from a list. +In order to activate a plugin, select the checkbox next to its name. +If a plugin contains toolbar buttons, they will be listed in parentheses next to the plugin description in the following format: (buttons: Button1, Button2). +If this is the case, the button should be added to the CKEditor toolbar by using the method described below: +- Enter the "Editor appearance > Toolbar" section. +- Suppose the toolbar is defined in the following way: + ['Link','Unlink','Anchor'] + You now need to add the button name (for example 'Button1') to the toolbar definition in the following way: + ['Link','Unlink','Anchor','Button1'] + Do not forget to place the button name in single quotes! +- Please note that some plugins require installing additional modules to work correctly. + +Installing Additional Plugins +----------------------------- +The installation process is based on placing the plugin folder in the "plugins" directory of the CKEditor module (usually sites/all/modules/ckeditor). +The plugin folder should contain at least the plugins.js file that is responsible for the plugin logic. +The plugin description will be displayed in the Administration Panel if it is added to the plugins.js file by using the following special comment: +/** + * @file Plugin description + */ +Hint: The Administration Panel automatically detects the toolbar buttons available in the plugin and adds them to the description. + +A plugin can be enabled by using the same method as described above - see the "Managing Plugins" section. + +Integrating with the CKEditor Module (for Plugin Developers) +------------------------------------------------------------ +Integrating your application with the CKEditor module by adding a plugin works through a special hook. +An example of the hook is presented below: + +function MODULENAME_ckeditor_plugin() { + return array( + 'plugin_name' => array( + // Plugin name. + 'name' => 'plugin_name', + // Plugin description - it will be displayed in the plugins management section of profile settings. + 'desc' => t('Description of plugin'), + // The full path to the CKEditor plugin directory, trailing slash included. + 'path' => drupal_get_path('module', 'my_module') . '/plugin_dir/', + // Plugin buttons definition [optional] + 'buttons' => array( + 'button_name' => array('label' => 'Button label', 'icon' => '/path/to/icon/image'), + 'button_name' => array('label' => 'Button label', 'icon' => '/path/to/icon/image'), + ... + ) + ) + ); +} +Please note that MODULENAME in the code above is the name of the module. + +After the hook is used the plugin will automatically appear on the plugin list for each CKEditor profile where you will be able to enable it as described in the "Managing Plugins" section. + +Uploading Images and Files +-------------------------- +There are two ways of uploading files: +- by using a commercial file browser like CKFinder (http://ckfinder.com), an advanced Ajax file manager; +- by using modules like IMCE. + +To select a preferred file browser, adjust CKEditor profiles in the +"Administration panel > Configuration > Content Authoring > CKEditor" section. +In the "File browser settings" section you can choose which file browser will be used for each profile. +Note: to choose an upload module other than CKFinder, you should install an appropriate Drupal module first. + +Installing CKFinder +------------------- +CKFinder is an Ajax-based file manager created by CKEditor developers: http://ckfinder.com/. + + 1. Download CKFinder for PHP: http://ckfinder.com/download + 2. Unpack CKFinder to the directory containing the CKEditor module and place it in the + "sites/all/modules/ckeditor/ckfinder" folder. + The correct directory structure is as follows: + + modules + ckeditor + ckeditor.module + ckeditor.admin.inc + ... + ckfinder + core + ckfinder.php + config.php + ... + ckeditor + _source + images + ckeditor.js + ... + + 3. Grant the "CKFinder access" permission in the "Administration panel > People > Permissions" section. + Note: if you do not see this permission, it means that CKEditor did not find CKFinder + and you have probably uploaded CKFinder into a wrong directory. + 4. Open the CKFinder configuration file (sites/all/modules/ckeditor/ckfinder/config.php) and do the following: + + I) Remove the CheckAuthentication() function: + (do not worry, this function is defined in filemanager.config.php, see below) + + function CheckAuthentication() <- remove it + { <- remove it + //WARNING : DO NOT simply... <- remove it + ... <- remove it + return false; <- remove it + } <- remove it + + II) Add: + + require_once '../../../../includes/filemanager.config.php'; + + straight below the following line: + + $baseDir = resolveUrl($baseUrl); + + 5. Open the Drupal settings file (sites/default/settings.php) and do the following: + + I) Uncomment the $base_url variable and set the base URL of your website (without the trailing slash). + + II) Uncomment the $cookie_domain variable and set the domain name of your website. + + 6. Select CKFinder as a preferred file browser in the "Administration panel > Configuration > Content Authoring > CKEditor" section + (for a selected CKEditor profile scroll down to the "File browser settings" section). + In the "File browser settings" section you may also change destination folders for files uploaded with CKFinder. + +Setting up Filters +------------------ +In the "Administration panel > Configuration > Content Authoring > Text fromats" section, Filtered HTML is the default filter. +Due to security reasons enabling Full HTML is only an option for trusted users. +To take full advantage of using CKEditor you can extend the list of allowed tags in the +HTML filter that is enabled in the Filtered HTML input format. +If you do not do this, you may notice that a page created in CKEditor looks different after saving. + +Unfortunately, even if you extend the list of allowed tags, one problem still remains: +Filtered HTML not only strips disallowed tags, but also strips inline style definitions. +It basically means that you are unable to apply a different font color, size, family, align images etc. +using CKEditor out of the box. You can solve this problem by creating another input format +that will work in a similar way as Filtered HTML (will only allow specified tags), +but in a much better way - i.e. it will not strip inline styles that CKEditor is using when +formatting text or images after the page is saved. +To create such an input format, you will need an HTML filter. The list below presents two +of the most popular modules that provide HTML filters: + + - HTML Purifier - the most popular and powerful, although according to some claims it might be a bit slow + http://drupal.org/project/htmlpurifier + - htmLawed - another alternative, less popular than both modules above + http://drupal.org/project/htmLawed + +It is up to you to decide which one to use. Just make sure that you will only allow to use proper +inline styles, tags, and attributes. +See also http://drupal.ckeditor.com/filters for the latest version of this instruction. + +Upgrading Instructions (CKEditor) +--------------------------------- +This instruction assumes that you are upgrading the CKEditor module [M] and CKEditor (the editor) [E] at the same time. +Instructions specific for module upgrades are tagged with [M]. Steps that must be taken when upgrading CKEditor (the editor) are marked with [E]. + + 1. [M] Download the latest version of the CKEditor module from http://drupal.org/project/ckeditor (it is advised to read the release notes before going further). + 2. [E] Download the latest version of CKEditor from http://ckeditor.com/download (it is advised to read the "what's new" page before going further: http://ckeditor.com/whatsnew). + 3. [M] Back up your database. + 4. [EM] Place the site in the "Off-line" mode to let the database updates run without interruption and to avoid displaying errors to end users of the site. + 5. [E] If you are using CKFinder, make sure you will not delete it, and move it to a safe place. + 6. [E] If you introduced any changes (e.g. custom toolbar definitions etc.) in the sites/all/modules/ckeditor/ckeditor.config.js file (or sites/all/modules/ckeditor/ckeditor/config.js), write down your changes and add them again after uploading new files. + In general, try to avoid making any changes to CKEditor's config.js file and add everything to ckeditor.config.js. + 7. Delete old files: + [EM]* Simply remove the "modules/ckeditor" directory if upgrading both the editor and the module. + [M] If you are upgrading the module only, remember to leave the "modules/ckeditor/ckeditor" directory untouched. + [E] When upgrading the editor, remove the contents of the "modules/ckeditor/ckeditor" directory only. + WARNING: If you do not remove old files and just rename the "ckeditor" directory instead (e.g. to "ckeditor_old"), Drupal may use the module from the renamed "ckeditor_old" directory. + 8. [M] Upload the CKEditor module (extracted files and folders) to the "sites/all/modules" directory. + 9. [E] Upload CKEditor (extracted files and folders from the "ckeditor" directory) to the "sites/modules/ckeditor/ckeditor" directory (i.e. where COPY HERE.txt file exists). + 10. [E] Restore the CKFinder files from where you copied them (see step 5). + 11. [E] Apply your modifications to default configuration in the ckeditor.config.js file (see step 6). + 12. [M] Run update.php. + 13. [EM] Put the site back online. + +Help & Contribution +------------------- +If you are looking for more information, have any trouble with the configuration of the module +or if you found an issue, please visit the official project page: + http://drupal.org/project/ckeditor + +Having problems? Take a look at the list of common problems when installing CKEditor: + http://drupal.ckeditor.com/troubleshooting +You might also check the TROUBLESHOOTING.txt file attached to this module. Note, however, +that the online version is always up to date. + +Learn how to adjust CKEditor to your theme and configure the spellchecker: + http://drupal.ckeditor.com/tricks + +If you would like to help in the development of the module, we encourage you to join our team. +If you are willing to translate the CKEditor module, please use the ckeditor.pot file (located in the "translations" directory) as a template and send us the translated file so that we could attach it. +Any help will be greatly appreciated. + +Credits +------- + - CKEditor for Drupal is currently maintained by the CKEditor team and Jorrit Schippers. + http://ckeditor.com/ + + - CKEditor - The text editor for the Internet + Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. + http://cksource.com/ diff --git a/docroot/sites/all/modules/ckeditor/TROUBLESHOOTING.txt b/docroot/sites/all/modules/ckeditor/TROUBLESHOOTING.txt new file mode 100644 index 0000000..2192eb8 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/TROUBLESHOOTING.txt @@ -0,0 +1,215 @@ + +Note: the HTML version of this file (always up-to-date) is available online: http://drupal.ckeditor.com/troubleshooting + +CONTENTS OF THIS FILE +--------------------- + + * CKEditor does not work in my theme + * Known module incompatibilities + * Images are not displayed when submitted + * I followed the instructions, but CKEditor does not show up (+ debugging instructions) + * Selected toolbar does not show for user 1 + * The CKEditor component is not installed correctly + * CKEditor does not work after upgrading + * Text alignment does not work + * Line breaks removed when editing content previously authored without using CKEditor + * I successfully uploaded an image, but cannot see it in the file browser + * Quote symbols are being changed to quote entities + +CKEditor does not work in my theme +---------------------------------- + +Your theme may be missing the following code: + + + +Add that line of code to the head section of your theme. + +Another possibility is that the following code might be missing in your theme: + + + +The solution is similar as above - you need to add that line to your theme at the end of its code. + +Finally, you can also switch to a different theme. + +Known module incompatibilities +------------------------------ + +At the moment CKEditor will not show up when the following modules are enabled: + + * Theme developer (http://drupal.org/node/318941) + * Theme Builder (http://drupal.org/node/271032) + +Images are not displayed when submitted +--------------------------------------- + +Most probably you need to properly configure the input format. Either set it to "Full HTML" or add the tag to the "Filtered HTML" format. +The full list of tags that should be allowed is available in the README.txt file. +Make sure that you have read the "Setting up filters" section in the README.txt file or on this page: http://drupal.ckeditor.com/filters + +I followed the instructions, but CKEditor does not show up +---------------------------------------------------------- + +First of all make sure that CKEditor is enabled on this specific page. +Take a look into the source code of your page and search for something similar to: + "ckeditor": { "module_path": + +If you cannot find such code, it means that CKEditor is disabled on that page/field. +Make sure that you have the right permissions to use CKEditor and check your CKEditor profile (include/exclude settings, minimum rows value). + +If CKEditor is enabled, but it does not show up, try the following steps: + + 1. Switch to the default theme (Garland). If CKEditor appears, read the "CKEditor does not work in xxx theme" instructions. + If your theme already contains the "closure" and "scripts" statements, read below. + 2. Make sure that you are using a browser that is compatible with CKEditor. + 3. On some occasions other installed modules may cause CKEditor not to show up (although if you look at page source, you will see the CKEditor code). + Instead of CKEditor you may see a very small textarea. + This mostly happens when some other module causes a JavaScript error and CKEditor cannot load because of this. + To check this: + - Write down the list of currently installed modules. + - Disable all additional modules. + - If CKEditor shows up, start enabling the modules that you disabled in the previous step and find out which module is incompatible with CKEditor. + Use the project's site to report a new bug and provide the following details: + * Drupal version, + * CKEditor module version, + * CKEditor version, + * The name and version of the incompatible module. + * If additional steps are required to reproduce this issue, like creating a new special content or configuring this additional module in a special way, provide a detailed list of steps to follow. + - If the step above did not help, disable all additional modules and switch to the Garland theme. Clear the browser cache. + If CKEditor still does not work, it means that it may be corrupted. + Upload CKEditor again using an FTP client that warns you when files are truncated or corrupted. + - If CKEditor works for the Garland theme with all modules enabled, but it does not work for your theme with all modules disabled, then your theme is a problem. + Use the project's site to report a new bug and provide the following details: + * Drupal version, + * CKEditor module version, + * CKEditor version, + * The name and version of the incompatible theme. + 4. Finally, if nothing helped, to find out where exactly the error occurred, you may use Firefox with the Firebug extension. + Use the project's site to create a new support request providing as much information as possible, including the exact JavaScript error message that you got. + +Selected toolbar does not show for user 1 +----------------------------------------- + +There are two reasons why you are seeing a different toolbar (or do not see CKEditor at all): + + - If "Allow users to customize CKEditor appearance" is enabled, each user + may override the profile settings in the "Rich text editor settings" section of the admin/user/N/edit page + ("My Account" -> "Edit") + + - A different profile is used for user 1 than you expect. + User 1 must be assigned a system role that corresponds to the privileges required. + If no role is assigned to User 1, they will have the privileges of an "authenticated user" + (usually it is the "Advanced" profile). + +The CKEditor component is not installed correctly +------------------------------------------------- + +Please remember that installing the CKEditor module is a two-step process. You need to download and unpack: +- the CKEditor module that integrates CKEditor with Drupal; +- CKEditor, the rich text editor. + +If your CKEditor does not show, you should check whether all files were extracted correctly. +The /modules/ckeditor/ckeditor/ directory should contain the following files: +ckeditor.js, config.js, contents.css as well as directories named "skins", "themes", "lang", "images". + +The correct directory structure is as follows: +modules + ckeditor + ckeditor.module + ckeditor.admin.inc + ... + ckeditor + _source + images + lang + plugins + skins + themes + COPY_HERE.txt + ckeditor.js + ... + +CKEditor does not work after upgrading +-------------------------------------- + +This may be caused by the browser cache. Clear your browser cache and restart the browser if clearing the cache did not help. +If you upgraded the CKEditor module, make sure that all roles with "access ckeditor" permissions are assigned to at least one CKEditor profile. + +Text alignment does not work +---------------------------- + +In the ckeditor.config.js file (located in the CKEditor module directory), the following classes are defined to provide the text alignment functionality: +config.justifyClasses = [ 'rteleft', 'rtecenter', 'rteright', 'rtejustify' ]; + +Unfortunately, some themes may override these styles and text alignment may not work as expected. +If you are using the Full HTML input format, you may simply comment out this line: +//config.justifyClasses = [ 'rteleft', 'rtecenter', 'rteright', 'rtejustify' ]; + +CKEditor will then use inline styles instead:

      sample text

      . +The problem is that inline styles may only be used with the Full HTML format. +Filtered HTML will strip that code, so do not use this solution with this input format. + +For Filtered HTML things are a bit more complicated. For example if your theme defines such CSS style: + +.content p { text-align: left; } + +the text-align property set in the .rteright class will not work. +To align the

      tag, you will have to edit the modules/ckeditor/ckeditor.css file and create a style that will be applied to the

      tag: + +.content p.rteleft { + text-align: left; +} +.content p.rteright { + text-align: right; +} +.content p.rtecenter { + text-align: center; +} +.content p.rtejustify { + text-align: justify; +} + +Use DOM inspector (in Firefox) to check why the alignment does not work and to correct your CSS styles. +There is no universal workaround for this situation. + +Line breaks removed when editing content previously authored without using CKEditor +----------------------------------------------------------------------------------- + +The problem lies in the way you configured your input filters. +Before you enabled CKEditor, you probably had the Line break converter enabled. + +Now you are trying to edit the same content with the Line break converter disabled, thus the line breaks are removed. + +Possible workarounds: + * Enable the Line break converter (not recommended). + * Create a new input format with the Line break converter enabled. Use it just for old articles (recommended). + * Start with CKEditor disabled by default, replace all new line characters manually with a
      tag, then use toggle to switch to WYSIWYG mode. + + If you are a PHP programmer, you may try the approach proposed by BakerQ in http://drupal.org/node/240633 + +Quote symbols are being changed to quote entities +------------------------------------------------- + +Some modules like Typogrify or SmartyPants require special handling of HTML entities. +For example, by default CKEditor will convert a double quote character (") to ". +To disable processing of HTML entities, add the following line to the modules/ckeditor/ckeditor.config.js file: + +config.entities = false; + +It is also possible to disable processing of HTML entities for a selected CKEditor profile by adding the following line in "Advanced Options" -> "Custom JavaScript configuration": + +entities = false; + +CKEditor toolbar does not show up +--------------------------------- + +If the CKEditor toolbar does not show up and the styles/themes seem to be corrupted, it is possible that you uploaded the files via FTP in the ASCII mode. +Make sure you are uploading the files in the binary mode. + +CKEditor adds

       

      +--------------------------- + +Sometimes you may notice that when editing nodes, the spacing between paragraphs is being doubled. +This may be caused by the HTML Purifier module when the AutoParagraph option is enabled. +When you disable it, make sure you clear the HTML Purifier cache. \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/UPGRADE.txt b/docroot/sites/all/modules/ckeditor/UPGRADE.txt new file mode 100644 index 0000000..d84b2ec --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/UPGRADE.txt @@ -0,0 +1,30 @@ +## Upgrade vs. Update ## + +Before you continue reading you need to understand the difference between "upgrading" and "updating". + +"Upgrading" refers to moving from one major release to another. +E.g. you are moving from Drupal 6 to Drupal 7. + +"Updating" typically refers to bringing the editor or CKEditor module up to the latest minor version (e.g 7.x-1.0 to 7.x-1.2). +Updating instructions are available in the README.txt file. + +## Upgrading the CKEditor module from 6.x to 7.x ## + +Due to differences between the CKEditor module for Drupal 6 and Drupal 7 there is no way (at least at the moment) +to upgrade without uninstalling the previous version of the module (and losing the configuration settings stored in the database). + +# Upgrading # + +1. Backup the "ckeditor_role" and "ckeditor_settings" tables + and write down your custom configuration settings stored in the CKEditor profiles. +2. Disable and uninstall the CKEditor 6.x module. +3. Make a backup of the "sites/all/modules/ckeditor" folder or at least make sure to make a copy of the "ckeditor.config.js" file. +4. Delete the contents of the "sites/all/modules/ckeditor" folder. +5. Follow the README.txt file to install the CKEditor module for Drupal 7. +6. Adjust CKEditor profiles to your needs. +7. If you made any changes to "ckeditor.config.js" in Drupal 6, check the default configuration file distributed with the module for Drupal 7 and re-apply the changes. + + +## Migrating from the FCKeditor module ## + +Please refer to the "Upgrading the CKEditor module from 6.x to 7.x" section. diff --git a/docroot/sites/all/modules/ckeditor/ckeditor-rtl.css b/docroot/sites/all/modules/ckeditor/ckeditor-rtl.css new file mode 100644 index 0000000..3974a82 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor-rtl.css @@ -0,0 +1,34 @@ +/* Indent & Justify classes */ + +.rteindent1 { + margin-right: 40px; + margin-left: 0; +} +.rteindent2 { + margin-right: 80px; + margin-left: 0; +} +.rteindent3 { + margin-right: 120px; + margin-left: 0; +} +.rteindent4 { + margin-right: 160px; + margin-left: 0; +} +.rteindent1[dir=ltr] { + margin-left: 40px; + margin-right: 0; +} +.rteindent2[dir=ltr] { + margin-left: 80px; + margin-right: 0; +} +.rteindent3[dir=ltr] { + margin-left: 120px; + margin-right: 0; +} +.rteindent4[dir=ltr] { + margin-left: 160px; + margin-right: 0; +} \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/ckeditor.api.php b/docroot/sites/all/modules/ckeditor/ckeditor.api.php new file mode 100644 index 0000000..43bdd91 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor.api.php @@ -0,0 +1,58 @@ + array( + // Name of the plugin used to write it. + 'name' => 'plugin_name', + // Description of the plugin - it would be displayed in the plugins management section of profile settings. + 'desc' => t('Plugin description'), + // The full path to the CKEditor plugins directory, with the trailing slash. + 'path' => drupal_get_path('module', 'my_module') . '/plugin_dir/', + 'buttons' => array( + 'button_name' => array( + 'icon' => 'path to button icon', + 'label' => 'Button Label', + ) + ) + ) + ); +} + +?> diff --git a/docroot/sites/all/modules/ckeditor/ckeditor.config.js b/docroot/sites/all/modules/ckeditor/ckeditor.config.js new file mode 100644 index 0000000..2bd6f10 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor.config.js @@ -0,0 +1,101 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/* + WARNING: clear browser's cache after you modify this file. + If you don't do this, you may notice that browser is ignoring all your changes. + */ +CKEDITOR.editorConfig = function(config) { + config.indentClasses = [ 'rteindent1', 'rteindent2', 'rteindent3', 'rteindent4' ]; + + // [ Left, Center, Right, Justified ] + config.justifyClasses = [ 'rteleft', 'rtecenter', 'rteright', 'rtejustify' ]; + + // The minimum editor width, in pixels, when resizing it with the resize handle. + config.resize_minWidth = 450; + + // Protect PHP code tags () so CKEditor will not break them when + // switching from Source to WYSIWYG. + // Uncommenting this line doesn't mean the user will not be able to type PHP + // code in the source. This kind of prevention must be done in the server + // side + // (as does Drupal), so just leave this line as is. + config.protectedSource.push(/<\?[\s\S]*?\?>/g); // PHP Code + config.protectedSource.push(/[\s\S]*?<\/code>/gi); // Code tags + config.extraPlugins = ''; + + /* + * Append here extra CSS rules that should be applied into the editing area. + * Example: + * config.extraCss = 'body {color:#FF0000;}'; + */ + config.extraCss = ''; + /** + * Sample extraCss code for the "marinelli" theme. + */ + if (Drupal.settings.ckeditor.theme == "marinelli") { + config.extraCss += "body{background:#FFF;text-align:left;font-size:0.8em;}"; + config.extraCss += "#primary ol, #primary ul{margin:10px 0 10px 25px;}"; + } + if (Drupal.settings.ckeditor.theme == "newsflash") { + config.extraCss = "body{min-width:400px}"; + } + + /** + * CKEditor's editing area body ID & class. + * See http://drupal.ckeditor.com/tricks + * This setting can be used if CKEditor does not work well with your theme by default. + */ + config.bodyClass = ''; + config.bodyId = ''; + /** + * Sample bodyClass and BodyId for the "marinelli" theme. + */ + if (Drupal.settings.ckeditor.theme == "marinelli") { + config.bodyClass = 'singlepage'; + config.bodyId = 'primary'; + } +} + +/* + * Sample toolbars + */ + +//Toolbar definition for basic buttons +Drupal.settings.cke_toolbar_DrupalBasic = [ [ 'Format', 'Bold', 'Italic', '-', 'NumberedList','BulletedList', '-', 'Link', 'Unlink', 'Image' ] ]; + +//Toolbar definition for Advanced buttons +Drupal.settings.cke_toolbar_DrupalAdvanced = [ + ['Source'], + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'], + ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'], + ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'], + ['Maximize', 'ShowBlocks'], + '/', + ['Format'], + ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiRtl','BidiLtr'], + ['Link','Unlink','Anchor','Linkit','LinkToNode','LinkToMenu'], + ['DrupalBreak', 'DrupalPageBreak'] +]; + +// Toolbar definiton for all buttons +Drupal.settings.cke_toolbar_DrupalFull = [ + ['Source'], + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'], + ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'], + ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'], + '/', + ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiRtl','BidiLtr'], + ['Link','Unlink','Anchor','Linkit','LinkToNode', 'LinkToMenu'], + '/', + ['Format','Font','FontSize'], + ['TextColor','BGColor'], + ['Maximize', 'ShowBlocks'], + ['DrupalBreak', 'DrupalPageBreak'] +]; \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/ckeditor.css b/docroot/sites/all/modules/ckeditor/ckeditor.css new file mode 100644 index 0000000..3eeba1a --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor.css @@ -0,0 +1,123 @@ +/* Indent & Justify classes */ + +.rteindent1 { + margin-left: 40px; +} +.rteindent2 { + margin-left: 80px; +} +.rteindent3 { + margin-left: 120px; +} +.rteindent4 { + margin-left: 160px; +} +.rteleft { + text-align: left; +} +.rteright { + text-align: right; +} +.rtecenter { + text-align: center; +} +.rtejustify { + text-align: justify; +} +.ibimage_left { + float: left; +} +.ibimage_right { + float: right; +} + +/* CKEditor padding in IE */ +table.cke_editor fieldset { + padding: 0 !important; +} +/* hack with ie and garland editing area size fix - [#733512] */ +.cke_editor{ + display: table !important; +} +.cke_editor,#ie#bug { + display: inline-table !important; +} +/* Fix table border for Drupal's Seven theme - [#1020612] */ +.cke_dialog tr td:last-child { + border-right: 0; +} + +/*toolbar Drag & Drop*/ +#edit-toolbar { + display: none; +} +#edit-toolbar + .grippie { + display: none; +} +div.sortableList { + cursor: n-resize; +} +div.widthMarker { + height: 20px; + border-top: 1px dashed #CCC; + margin: 10px 0px 0px 1px; + padding-left: 1px; + text-align: center; +} +div.sortableList.group { + margin: 20px 0px 0px 0px; +} +div.sortableList div.sortableListDiv { + height: 30px; + margin-bottom: 3px; + width: 900px; +} +div.sortableList div.sortableListDiv span.sortableListSpan { + background-color: #F0F0EE; + height: 30px; + border-right: 1px dashed #CCC; + display: block; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul { + width: 900px; + white-space: nowrap; + border: 1px solid #CCC; + list-style: none; + margin:0px; + padding: 0px 0px 0px 1px; + height: 30px; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul li { + list-style: none; + cursor: move; + height: 18px; + min-width: 18px; + padding: 2px; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul li.group { + min-width: 5px; + padding-left: 2px; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul li img { + border: 0; + padding: 0; + margin: 0 +} +li.sortableItem { + position: relative; + float: left; + margin: 3px 1px 1px 0px; + border: 1px solid #CCC; + background-color: #F0F0EE; + disc-type: none; + z-index: 99; +} + +/* Fix for fieldset for-edit-apperance in Firefox*/ +fieldset#edit-appearance div#groupLayout, div#allButtons { + border: 0; + padding: 0 0 0 0; + margin: 1em 0; + overflow: auto; +} +/* end of toolbar Drag & Drop */ \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/ckeditor.info b/docroot/sites/all/modules/ckeditor/ckeditor.info new file mode 100644 index 0000000..c46cff6 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor.info @@ -0,0 +1,12 @@ +name = CKEditor +description = "Enables CKEditor (WYSIWYG HTML editor) for use instead of plain text fields." +core = 7.x +package = User interface +configure = admin/config/content/ckeditor +files[] = includes/ckeditor.user.inc +; Information added by drupal.org packaging script on 2011-11-09 +version = "7.x-1.6" +core = "7.x" +project = "ckeditor" +datestamp = "1320880530" + diff --git a/docroot/sites/all/modules/ckeditor/ckeditor.install b/docroot/sites/all/modules/ckeditor/ckeditor.install new file mode 100644 index 0000000..25d8dc7 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor.install @@ -0,0 +1,514 @@ +fields(array("name" => "Advanced", "format" => 'filtered_html'))->execute(); + db_insert('ckeditor_input_format')->fields(array("name" => "Full", "format" => 'full_html'))->execute(); + + //insert settings for default role + $arr = array(); + $arr['filebrowser'] = 'none'; + $arr['quickupload'] = 'f'; + + //security + $arr['ss'] = "2"; + $arr['filters']['filter_html'] = 1; + + //appearance + $arr['default'] = "t"; + $arr['show_toggle'] = "t"; + $arr['popup'] = variable_get('ckeditor_popup', 0) ? "t" : "f"; + $arr['skin'] = "kama"; + $arr['toolbar'] = " +[ + ['Source'], + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'], + ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'], + ['Image','Media','Flash','Table','HorizontalRule','Smiley','SpecialChar'], + ['Maximize', 'ShowBlocks'], + '/', + ['Format'], + ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'], + ['Link','Unlink','Anchor', 'Linkit'] +] + "; + $arr['expand'] = variable_get('ckeditor_toolbar_start_expanded', 1) ? "t" : "f"; + $arr['width'] = variable_get("ckeditor_width", "100%"); + $arr['lang'] = "en"; + $arr['auto_lang'] = "t"; + $arr['language_direction'] = "default"; + + //output + $arr['enter_mode'] = "p"; + $arr['shift_enter_mode'] = "br"; + $arr['font_format'] = 'p;div;pre;address;h1;h2;h3;h4;h5;h6'; + $arr['format_source'] = "t"; + $arr['format_output'] = "t"; + $arr['custom_formatting'] = "f"; + $arr['formatting']['custom_formatting_options'] = array('indent' => 'indent', 'breakBeforeOpen' => 'breakBeforeOpen', 'breakAfterOpen' => 'breakAfterOpen', 'breakAfterClose' => 'breakAfterClose'); + + //css + $arr['css_mode'] = "none"; + $arr['css_path'] = variable_get("ckeditor_stylesheet", ""); + + //upload + //get permissions here like in _update_role_permissions + $arr['filebrowser'] = "none"; + $arr['user_choose'] = "f"; + $arr['ckeditor_load_method'] = "ckeditor.js"; + $arr['ckeditor_load_time_out'] = 0; + $arr['scayt_autoStartup'] = "f"; + + db_insert('ckeditor_settings')->fields(array("name" => "Advanced", "settings" => serialize($arr)))->execute(); + + //insert settings for advanced role + $arr['toolbar'] = " +[ + ['Source'], + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'], + ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'], + ['Image','Media','Flash','Table','HorizontalRule','Smiley','SpecialChar'], + '/', + ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'], + ['Link','Unlink','Anchor', 'Linkit'], + ['DrupalBreak'], + '/', + ['Format','Font','FontSize'], + ['TextColor','BGColor'], + ['Maximize', 'ShowBlocks'] +] + "; + + $arr['filters'] = array(); + + db_insert('ckeditor_settings')->fields(array("name" => "Full", "settings" => serialize($arr)))->execute(); + + $arr = array(); + + if ($editor_path) { + $arr['ckeditor_path'] = $editor_path; + } + + db_insert('ckeditor_settings')->fields(array("name" => "CKEditor Global Profile", "settings" => serialize($arr)))->execute(); + + module_load_include('inc', 'ckeditor', 'includes/ckeditor.admin'); +} + +/** + * Implementation of hook_schema(). + */ +function ckeditor_schema() { + $schema['ckeditor_settings'] = array( + 'description' => 'Stores CKEditor profile settings', + 'fields' => array( + 'name' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'default' => '', + 'length' => 128, + 'description' => 'Name of the CKEditor profile', + ), + 'settings' => array( + 'type' => 'text', + 'description' => 'Profile settings', + ), + ), + 'primary key' => array('name') + ); + $schema['ckeditor_input_format'] = array( + 'description' => 'Stores CKEditor input format assignments', + 'fields' => array( + 'name' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'default' => '', + 'length' => 128, + 'description' => 'Name of the CKEditor role', + ), + 'format' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'default' => '', + 'length' => 128, + 'description' => 'Drupal filter format ID', + ) + ), + 'primary key' => array('name', 'format'), + ); + + return $schema; +} + +/** + * Implementation of hook_requirements(). + * + * This hook will issue warnings if: + * - The CKEditor source files are not found. + * - The CKEditor source files are out of date. + * - Quick upload and/or the built-in file browser are used and $cookie_domain is not set. + */ +function ckeditor_requirements($phase) { + $requirements = array(); + + if ($phase == 'runtime') { + module_load_include('module', 'ckeditor'); + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + $requirements['ckeditor'] = array( + 'title' => t('CKEditor'), + 'value' => t('Unknown'), + ); + + $requirements['ckeditor']['severity'] = REQUIREMENT_OK; + + if (!_ckeditor_requirements_isinstalled()) { + $sourcepath = ckeditor_path(TRUE); + + $requirements['ckeditor']['description'] = t('CKEditor was not found in %sourcepath.', array('%sourcepath' => $sourcepath)); + $requirements['ckeditor']['severity'] = REQUIREMENT_ERROR; + } + elseif (($installed_version = _ckeditor_requirements_getinstalledversion()) === NULL) { + $requirements['ckeditor']['description'] = t('CKEditor version could not be determined.'); + $requirements['ckeditor']['severity'] = REQUIREMENT_INFO; + } + else { + $profile_name = _ckeditor_requirements_ckfinder_filebrowser_enabled(); + if ($profile_name !== FALSE) { + if (!_ckeditor_requirements_cookiedomainset()) { + $requirements['ckeditor']['severity'] = REQUIREMENT_ERROR; + $requirements['ckeditor']['description'] = t('You are using a feature that requires $cookie_domain to be set, but it is not set in your settings.php file (CKFinder is enabled in the !profile profile).', array('!profile' => l($profile_name, 'admin/config/content/ckeditor/edit/' . urlencode($profile_name)))); + } + elseif ($error = _ckeditor_requirements_ckfinder_config_check($profile_name)) { + $requirements['ckeditor']['severity'] = REQUIREMENT_ERROR; + $requirements['ckeditor']['description'] = $error; + } + } + } + if ((($installed_version = _ckeditor_requirements_getinstalledversion()) !== NULL) && (-1 == version_compare($installed_version, '3.1 SVN'))) { + $requirements['ckeditor']['description'] = t('Some features are disabled because you are using an older version of CKEditor. Please upgrade to CKEditor 3.1 (or higher).'); + $requirements['ckeditor']['severity'] = REQUIREMENT_INFO; + } + if (!empty($installed_version)) { + $requirements['ckeditor']['value'] = $installed_version; + }else{ + $requirements['ckeditor']['value'] = t('Not found'); + } + } + + return $requirements; +} + +/** + * Fetches the version of the installed CKEditor sources. + * + * It tries to locate the version of the CKEditor sources in + * ckeditor.js. + * + * Releases have a version number such as "3.0.1". + * SVN nightly releases have a minor version number with SVN appended: "3.0 SVN". + * SVN checkouts have the string "[Development]". + * + * This function is used by ckeditor_requirements(). + * + * @return string Version number (eg. 3.0) of CKEditor. Null if not found in ckeditor_basic.js. + */ +function _ckeditor_requirements_getinstalledversion() { + module_load_include('module', 'ckeditor'); + $editor_path = ckeditor_path(TRUE, TRUE); + $jspath = $editor_path . '/ckeditor_basic.js'; + + $configcontents = @file_get_contents($jspath); + if (!$configcontents) { + return NULL; + } + $matches = array(); + if (preg_match('#,version:\'(.*?)\',#', $configcontents, $matches)) { + return $matches[1]; + } + return NULL; +} + +/** + * Executed when the built-in file browser is enabled. + * Returns FALSE if no errors are found in the config.php file, otherwise it returns an error message. + * + * @return string|boolean + */ +function _ckeditor_requirements_ckfinder_config_check($profile_name) { + global $base_url; + module_load_include('module', 'ckeditor'); + $module_drupal_path = drupal_get_path('module', 'ckeditor'); + $config_path = $module_drupal_path . '/ckfinder/config.php'; + + if (!file_exists($config_path)) { + return t('!ckfinder is not installed correctly: !config not found. Make sure that you uploaded all files and did not accidentally remove the configuration file.', array( + '!config' => $module_drupal_path . '/ckfinder/config.php', + '!ckfinder' => 'CKFinder' + )); + } + + if (!is_readable($config_path)) { + return t('CKEditor needs read permission to the !config file.', array('!config' => 'ckfinder/config.php')); + } + + $config_contents = file($config_path); + + //not a 100% valid check, but well... let's have at least some error checking + $require_once_found = FALSE; + $require_once_line = 0; + $userfiles_absolute_path_line = 0; + $force_single_extension_line = 0; + + if ($config_contents) { + foreach ($config_contents as $line_num => $line) { + //make sure it doesn't start with a comment, unfortunately we're not protected if code is commented with /* */ + if (!$require_once_found && strpos($line, "filemanager.config.php") !== FALSE && !preg_match(",^(?://|\#|\*|/\*),", trim($line))) { + $require_once_found = TRUE; + $require_once_line = $line_num; + } + /** + * @todo Finish this + */ + if (!$userfiles_absolute_path_line && strpos($line, '$Config[\'UserFilesAbsolutePath\']') !== FALSE && !preg_match(",^(?://|\#|\*|/\*),", trim($line))) { + $userfiles_absolute_path_line = $line_num; + } + if (!$force_single_extension_line && strpos($line, '$Config[\'ForceSingleExtension\']') !== FALSE && !preg_match(",^(?://|\#|\*|/\*),", trim($line))) { + $force_single_extension_line = $line_num; + } + } + } + + if (!$require_once_found) { + return t('You are using a feature that requires manual integration in the config.php file. Please read the "Installing CKFinder" section in the !readme file carefully and add a require_once ... statement to the %ckfconfig file.', array('%ckfconfig' => drupal_get_path('module', 'ckeditor') . '/ckfinder/config.php', '!readme' => l(t('README.txt'), $base_url . '/' . drupal_get_path('module', 'ckeditor') . '/README.txt', array('absolute' => TRUE)))); + } + + if ($userfiles_absolute_path_line && $force_single_extension_line && ( + $require_once_line < $userfiles_absolute_path_line || $require_once_line > $force_single_extension_line)) { + return t('You are using a feature that requires manual integration in the config.php file. You have added a require_once ... statement to the %ckfconfig file, but in the wrong line.', array('%ckfconfig' => drupal_get_path('module', 'ckeditor') . '/ckfinder/config.php')); + } + + return FALSE; +} + +/** + * Checks if any profile requires an explicit setting of $cookie_domain + * in settings.php. + * + * %cookie_domain is required when the internal file browser or quick upload is used. + * + * This function is used by ckeditor_requirements(). + * + * @return boolean True if any profile requires $cookie_domain. + */ +function _ckeditor_requirements_ckfinder_filebrowser_enabled() { + module_load_include('module', 'ckeditor'); + $profiles = ckeditor_profile_load(); + + foreach ($profiles as $profile) { + if ((isset($profile->settings['filebrowser']) && $profile->settings['filebrowser'] == 'ckfinder')) { + return $profile->name; + } + } + + return FALSE; +} + +/** + * Checks if $cookie_domain was set. + * + * It has to include settings.php again because conf_init() sets + * $cookie_domain regardless of its presence in settings.php, so + * simply checking $GLOBALS['cookie_domain'] is not possible. + * + * This function is used by ckeditor_requirements(). + * + * @return boolean True if $cookie_domain was set in settings.php. + */ +function _ckeditor_requirements_cookiedomainset() { + if (file_exists('./' . conf_path() . '/settings.php')) { + $settings = file_get_contents('./' . conf_path() . '/settings.php'); + + if (preg_match('#^\s*\$cookie_domain#m', $settings)) { + return TRUE; + } + } + + return FALSE; +} + +/** + * Updates broken settings for the 'Full' profile. (Resets toolbar to default) + */ +function ckeditor_update_7000() { + $result = db_query("SELECT settings FROM {ckeditor_settings} WHERE name = :name", array(':name' => 'Full'))->fetchField(); + $settings = unserialize($result); + $settings['toolbar'] = " +[ + ['Source'], + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'], + ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'], + ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'], + '/', + ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'], + ['Link','Unlink','Anchor'], + ['DrupalBreak'], + '/', + ['Format','Font','FontSize'], + ['TextColor','BGColor'], + ['Maximize', 'ShowBlocks'] +] + "; + + $settings = serialize($settings); + + $update = db_update('ckeditor_settings') + ->fields(array( + 'settings' => $settings, + )) + ->condition('name', 'Full', '=') + ->execute(); +} + +/** + * Removes the 'DrupalBreak' button from the 'Advanced' profile. (Resets toolbar to default) + */ +function ckeditor_update_7001() { + $result = db_query("SELECT settings FROM {ckeditor_settings} WHERE name = :name", array(':name' => 'Advanced'))->fetchField(); + $settings = unserialize($result); + $settings['toolbar'] = " +[ + ['Source'], + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'], + ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'], + ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'], + ['Maximize', 'ShowBlocks'], + '/', + ['Format'], + ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'], + ['Link','Unlink','Anchor'] +] + "; + + $settings = serialize($settings); + + $update = db_update('ckeditor_settings') + ->fields(array( + 'settings' => $settings, + )) + ->condition('name', 'Advanced', '=') + ->execute(); +} + +/** + * Rewrites 'Path to CKEditor' to new flags. + */ +function ckeditor_update_7002() { + $result = db_query("SELECT settings FROM {ckeditor_settings} WHERE name = :name", array(':name' => 'CKEditor Global Profile'))->fetchField(); + $settings = unserialize($result); + if ($settings['ckeditor_path'] == '%b/sites/all/libraries/ckeditor') { + $settings['ckeditor_path'] = '%l/ckeditor'; + } + else { + $settings['ckeditor_path'] = str_replace('%b/', '', $settings['ckeditor_path']); + $settings['ckeditor_path'] = str_replace('%b', '', $settings['ckeditor_path']); + } + + $settings = serialize($settings); + + $update = db_update('ckeditor_settings') + ->fields(array( + 'settings' => $settings, + )) + ->condition('name', 'CKEditor Global Profile', '=') + ->execute(); + +} + +/** + * Fixes static paths to plugin files. + */ +function ckeditor_update_7003() { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + + $render = array(); + $render["%base_path%"] = base_path(); + $render["%editor_path%"] = ckeditor_path(FALSE) . '/'; + $render["%ckeditor_path%"] = drupal_get_path('module', 'ckeditor'); + $render["%plugin_dir%"] = $render["%ckeditor_path%"] . '/plugins/'; + + $result = db_query("SELECT * FROM {ckeditor_settings} WHERE name <> :name", array(':name' => 'CKEditor Global Profile'))->fetchAllAssoc('name'); + + foreach ((array) $result as $profile) { + $name = $profile->name; + $settings = unserialize($profile->settings); + + foreach ((array) $settings['loadPlugins'] as $i => $plugin) { + $settings['loadPlugins'][$i]['path'] = str_replace(array_values($render), array_keys($render), $plugin['path']); + } + + $settings = serialize($settings); + + $update = db_update('ckeditor_settings') + ->fields(array( + 'settings' => $settings, + )) + ->condition('name', $name, '=') + ->execute(); + } + +} \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/ckeditor.module b/docroot/sites/all/modules/ckeditor/ckeditor.module new file mode 100644 index 0000000..79ba081 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor.module @@ -0,0 +1,485 @@ + 'XSS Filter', + 'description' => 'XSS Filter.', + 'page callback' => 'ckeditor_filter_xss', + 'file' => 'includes/ckeditor.page.inc', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + $items['ckeditor/disable/wysiwyg'] = array( + 'title' => 'Disable the WYSIWYG module', + 'description' => 'Disable WYSIWYG module.', + 'page callback' => 'ckeditor_disable_wysiwyg', + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + $items['admin/config/content/ckeditor'] = array( + 'title' => 'CKEditor', + 'description' => 'Configure the rich text editor.', + 'page callback' => 'ckeditor_admin_main', + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'type' => MENU_NORMAL_ITEM, + ); + + $items['admin/config/content/ckeditor/add'] = array( + 'title' => 'Add a new CKEditor profile', + 'description' => 'Configure the rich text editor.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('ckeditor_admin_profile_form'), + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'type' => MENU_CALLBACK, + ); + + $items['admin/config/content/ckeditor/clone/%ckeditor_profile'] = array( + 'title' => 'Clone the CKEditor profile', + 'description' => 'Configure the rich text editor.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('ckeditor_admin_profile_clone_form', 5), + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'type' => MENU_CALLBACK, + ); + + $items['admin/config/content/ckeditor/edit/%ckeditor_profile'] = array( + 'title' => 'Edit the CKEditor profile', + 'description' => 'Configure the rich text editor.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('ckeditor_admin_profile_form', 5), + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'type' => MENU_CALLBACK, + ); + + $items['admin/config/content/ckeditor/delete/%ckeditor_profile'] = array( + 'title' => 'Delete the CKEditor profile', + 'description' => 'Configure the rich text editor.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('ckeditor_admin_profile_delete_form', 5), + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'type' => MENU_CALLBACK, + ); + + $items['admin/config/content/ckeditor/addg'] = array( + 'title' => 'Add the CKEditor Global profile', + 'description' => 'Configure the rich text editor.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('ckeditor_admin_global_profile_form', 'add'), + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'type' => MENU_CALLBACK, + ); + + $items['admin/config/content/ckeditor/editg'] = array( + 'title' => 'Edit the CKEditor Global profile', + 'description' => 'Configure the rich text editor.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('ckeditor_admin_global_profile_form', 'edit'), + 'file' => 'includes/ckeditor.admin.inc', + 'access arguments' => array('administer ckeditor'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of hook_permission(). + * + * People -> Permissions + */ +function ckeditor_permission() { + $arr = array(); + $arr['administer ckeditor'] = array( + 'title' => t('Administer CKEditor access'), + 'description' => t('Allow users to change CKEditor settings.') + ); + + $arr['customize ckeditor'] = array( + 'title' => t('Customize CKEditor appearance'), + 'description' => t('Allow users to customize CKEditor appearance.') + ); + + if (file_exists(drupal_get_path('module', 'ckeditor') . "/ckfinder")) { + $arr['allow CKFinder file uploads'] = array( + 'title' => t('CKFinder access'), + 'description' => t('Allow users to use CKFinder.') + ); + } + return $arr; +} + +/** + * Implementation of hook_help(). + * + * This function delegates the execution to ckeditor_help_delegate() in includes/ckeditor.page.inc to + * lower the amount of code in ckeditor.module. + */ +function ckeditor_help($path, $arg) { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.page'); + return module_invoke('ckeditor', 'help_delegate', $path, $arg); +} + +/** + * Implementation of hook_init(). + */ +function ckeditor_init() { + drupal_add_css(drupal_get_path('module', 'ckeditor') . '/ckeditor.css'); +} + +/** + * Implementation of hook_form_alter() + */ +function ckeditor_form_alter(&$form, $form_state, $form_id) { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.user'); + if ( $form_id == 'user_profile_form') { + ckeditor_user_customize($form, $form_state, $form_id); + } +} + +/** + * Implementation of hook_element_info_alter(). + * + * Replace the textarea with CKEditor using a callback function (ckeditor_pre_render_text_format). + */ +function ckeditor_element_info_alter(&$types) { + $types['text_format']['#pre_render'][] = 'ckeditor_pre_render_text_format'; +} + +/** + * This function creates the HTML objects required for CKEditor. + * + * @param $element + * A fully populated form element to add the editor to. + * @return + * The same $element with extra CKEditor markup and initialization. + */ +function ckeditor_pre_render_text_format($element) { + static $init = FALSE; + if (!isset($element['#format'])) { + return $element; + } + + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + if ( $init === FALSE ) { + $input_formats = ckeditor_profiles_compile(); + drupal_add_js(array('ckeditor' => array('input_formats' => $input_formats, 'plugins' => array())), 'setting'); + $init = TRUE; + } + + if (isset($element['value'])) { + if (isset($element['summary'])) { + $element['value'] = ckeditor_load_by_field($element['value'], $element['format']['format'], TRUE, $element['summary']['#id']); + $element['summary'] = ckeditor_load_by_field($element['summary'], $element['format']['format'], FALSE); + } + else { + $element['value'] = ckeditor_load_by_field($element['value'], $element['#format']); + } + } + else { + $element = ckeditor_load_by_field($element, $element['#format']); + } + + return $element; +} + +/** + * Implementation of hook_user(). + * + * This function delegates the execution to ckeditor_user_delegate() in includes/ckeditor.user.inc to + * lower the amount of code in ckeditor.module. + */ +function ckeditor_user($type, $edit, &$user, $category = NULL) { + if (($type == 'form' && $category == 'account') || $type == 'validate') { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.user'); + return ckeditor_user_delegate($type, $edit, $user, $category); + } + return NULL; +} + +/** + * Load all profiles. Just load one profile if $name is passed in. + */ +function ckeditor_profile_load($name = '', $clear = FALSE) { + static $profiles = array(); + global $user; + + if (empty($profiles) || $clear === TRUE) { + $result = db_select('ckeditor_settings', 's')->fields('s')->execute(); + foreach ($result as $data) { + $data->settings = unserialize($data->settings); + $data->input_formats = array(); + + $profiles[$data->name] = $data; + } + $input_formats = filter_formats($user); + $result = db_select('ckeditor_input_format', 'f')->fields('f')->execute(); + foreach ($result as $data) { + if (isset($input_formats[$data->format])) { + $profiles[$data->name]->input_formats[$data->format] = $input_formats[$data->format]->name; + } + } + + } + + return ($name ? (isset($profiles[urldecode($name)]) ? $profiles[urldecode($name)] : FALSE) : $profiles); +} + +/** + * Read the CKEditor path from the Global profile. + * + * @return + * Path to CKEditor folder. + */ +function ckeditor_path($local = FALSE, $refresh = FALSE) { + static $cke_path; + static $cke_local_path; + + if ($refresh || (!$cke_path)) { + $mod_path = drupal_get_path('module', 'ckeditor'); + $lib_path = 'sites/all/libraries'; + $global_profile = ckeditor_profile_load('CKEditor Global Profile', $refresh); + + //default: path to ckeditor subdirectory in the ckeditor module directory (starting from the document root) + //e.g. for http://example.com/drupal it will be /drupal/sites/all/modules/ckeditor/ckeditor + $cke_path = $mod_path . '/ckeditor'; + + //default: path to ckeditor subdirectory in the ckeditor module directory (relative to index.php) + //e.g.: sites/all/modules/ckeditor/ckeditor + $cke_local_path = $mod_path . '/ckeditor'; + + if ($global_profile) { + $gs = $global_profile->settings; + + if (isset($gs['ckeditor_path'])) { + $tmp_path = $gs['ckeditor_path']; + $tmp_path = strtr($tmp_path, array("%b" => base_path(), "%m" => $mod_path, "%l" => $lib_path)); + $tmp_path = str_replace('\\', '/', $tmp_path); + $tmp_path = str_replace('//', '/', $tmp_path); + $cke_path = $tmp_path; + + if (empty($gs['ckeditor_local_path'])) { + //fortunately wildcards are used, we can easily get the right server path + if (FALSE !== strpos($gs['ckeditor_path'], "%m")) { + $gs['ckeditor_local_path'] = strtr($gs['ckeditor_path'], array("%m" => $mod_path)); + } + if (FALSE !== strpos($gs['ckeditor_path'], "%l")) { + $gs['ckeditor_local_path'] = strtr($gs['ckeditor_path'], array("%l" => 'sites/all/libraries')); + } + } + } + + //ckeditor_path is defined, but wildcards are not used, we need to try to find out where is + //the document root located and append ckeditor_path to it. + if (!empty($gs['ckeditor_local_path'])) { + $cke_local_path = $gs['ckeditor_local_path']; + } + elseif (!empty($gs['ckeditor_path'])) { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + $local_path = ckeditor_resolve_url($gs['ckeditor_path'] . "/"); + if (FALSE !== $local_path) { + $cke_local_path = $local_path; + } + } + } + } + if ($local) { + return $cke_local_path; + } + else { + return $cke_path; + } +} + +/** + * Read the CKEditor plugins path from the Global profile. + * + * @return + * Path to CKEditor plugins folder. + */ +function ckeditor_plugins_path($local = FALSE, $refresh = FALSE) { + static $cke_plugins_path; + static $cke_plugins_local_path; + + if ($refresh || (!$cke_plugins_path)) { + $mod_path = drupal_get_path('module', 'ckeditor'); + $lib_path = 'sites/all/libraries'; + $global_profile = ckeditor_profile_load('CKEditor Global Profile', $refresh); + + //default: path to ckeditor subdirectory in the ckeditor module directory (starting from the document root) + //e.g. for http://example.com/drupal it will be /drupal/sites/all/modules/ckeditor/ckeditor + $cke_plugins_path = base_path() . $mod_path . '/plugins'; + + //default: path to plugins subdirectory in the ckeditor module directory (relative to index.php) + //e.g.: sites/all/modules/ckeditor/plugins + $cke_plugins_local_path = $mod_path . '/plugins'; + + if ($global_profile) { + $gs = $global_profile->settings; + + if (isset($gs['ckeditor_plugins_path'])) { + $tmp_path = $gs['ckeditor_plugins_path']; + $tmp_path = strtr($tmp_path, array("%b" => base_path(), "%m" => $mod_path, "%l" => $lib_path)); + $tmp_path = str_replace('\\', '/', $tmp_path); + $tmp_path = str_replace('//', '/', $tmp_path); + $tmp_path = rtrim($tmp_path, ' \/'); + if (substr($tmp_path, 0, 1) != '/') { + $tmp_path = '/' . $tmp_path; //starts with '/' + } + $cke_plugins_path = $tmp_path; + + if (empty($gs['ckeditor_plugins_local_path'])) { + //fortunately wildcards are used, we can easily get the right server path + if (FALSE !== strpos($gs['ckeditor_plugins_path'], "%m")) { + $gs['ckeditor_plugins_local_path'] = strtr($gs['ckeditor_plugins_path'], array("%m" => $mod_path)); + } + if (FALSE !== strpos($gs['ckeditor_plugins_path'], "%b")) { + $gs['ckeditor_plugins_local_path'] = strtr($gs['ckeditor_plugins_path'], array("%b" => ".")); + } + if (FALSE !== strpos($gs['ckeditor_plugins_path'], "%l")) { + $gs['ckeditor_plugins_local_path'] = strtr($gs['ckeditor_plugins_path'], array("%l" => "sites/all/libraries")); + } + } + } + + //ckeditor_plugins_path is defined, but wildcards are not used, we need to try to find out where is + //the document root located and append ckeditor_plugins_path to it. + if (!empty($gs['ckeditor_plugins_local_path'])) { + $cke_plugins_local_path = $gs['ckeditor_plugins_local_path']; + } + elseif (!empty($gs['ckeditor_plugins_path'])) { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + $local_path = ckeditor_resolve_url($gs['ckeditor_plugins_path'] . "/"); + if (FALSE !== $local_path) { + $cke_plugins_local_path = $local_path; + } + } + } + } + + if ($local) { + return $cke_plugins_local_path; + } + else { + return $cke_plugins_path; + } +} + +/** + * Implementation of hook_features_api(). + * + * Allow exporting of CKEditor profiles by the Features module. + */ +function ckeditor_features_api() { + return array( + 'ckeditor_profile' => array( + 'name' => t('CKEditor profiles'), + 'default_hook' => 'ckeditor_profile_defaults', + 'default_file' => FEATURES_DEFAULTS_INCLUDED, + 'file' => drupal_get_path('module', 'ckeditor') . '/includes/ckeditor.features.inc', + ) + ); +} + +/** + * Implementation of hook_file_download(). + * Support for private downloads. + * CKEditor does not implement any kind of potection on private files. + */ +function ckeditor_file_download($uri) { + + if ($path = file_create_url($uri)) { + $result = db_query("SELECT f.* FROM {file_managed} f WHERE uri = :uri", array(':uri' => $path)); + foreach ($result as $record) + { + return NULL; + } + //No info in DB? Probably a file uploaded with FCKeditor / CKFinder + $global_profile = ckeditor_profile_load("CKEditor Global Profile"); + //Assume that files inside of ckeditor directory belong to the CKEditor. If private directory is set, let the decision about protection to the user. + $private_dir_db = $private_dir = isset($global_profile->settings['private_dir']) ? trim($global_profile->settings['private_dir'], '\/') : ''; + $private_dir_db = str_replace(array('\\%u', '\\%n'),array('', '') , $private_dir_db); + $private_dir = preg_quote($private_dir, '#'); + $private_dir = strtr($private_dir, array('%u' => '(\d+)', '%n' => '([\x80-\xF7 \w@.-]+)')); // regex for %n taken from user_validate_name() in user.module + $private_dir = trim($private_dir, '\/'); + + $regex = '#^'. preg_quote(file_default_scheme() . '://' , '#') . $private_dir .'#'; + + if (!strstr($uri, 'private://') && !strstr($uri,'public://')) + { + $path = file_default_scheme() . '://' .$uri ; + }else{ + $path = $uri ; + } + if (!$private_dir && variable_get('file_default_scheme', '') == 'private' && strcmp(isset($global_profile->settings['ckeditor_allow_download_private_files']) ? $global_profile->settings['ckeditor_allow_download_private_files']: '', 't') != 0 ) return -1; + if (preg_match($regex, $path)) + { + $info = image_get_info($uri); + return array('Content-Type' => $info['mime_type']); + } + } +} diff --git a/docroot/sites/all/modules/ckeditor/ckeditor.styles.js b/docroot/sites/all/modules/ckeditor/ckeditor.styles.js new file mode 100644 index 0000000..9d1993e --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor.styles.js @@ -0,0 +1,91 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/* + * This file is used/requested by the 'Styles' button. + * The 'Styles' button is not enabled by default in DrupalFull and DrupalFiltered toolbars. + */ +if(typeof(CKEDITOR) !== 'undefined') { + CKEDITOR.addStylesSet( 'drupal', + [ + /* Block Styles */ + + // These styles are already available in the "Format" drop-down list, so they are + // not needed here by default. You may enable them to avoid placing the + // "Format" drop-down list in the toolbar, maintaining the same features. + /* + { name : 'Paragraph' , element : 'p' }, + { name : 'Heading 1' , element : 'h1' }, + { name : 'Heading 2' , element : 'h2' }, + { name : 'Heading 3' , element : 'h3' }, + { name : 'Heading 4' , element : 'h4' }, + { name : 'Heading 5' , element : 'h5' }, + { name : 'Heading 6' , element : 'h6' }, + { name : 'Preformatted Text', element : 'pre' }, + { name : 'Address' , element : 'address' }, + */ + + { name : 'Blue Title' , element : 'h3', styles : { 'color' : 'Blue' } }, + { name : 'Red Title' , element : 'h3', styles : { 'color' : 'Red' } }, + + /* Inline Styles */ + + // These are core styles available as toolbar buttons. You may opt enabling + // some of them in the "Styles" drop-down list, removing them from the toolbar. + /* + { name : 'Strong' , element : 'strong', overrides : 'b' }, + { name : 'Emphasis' , element : 'em' , overrides : 'i' }, + { name : 'Underline' , element : 'u' }, + { name : 'Strikethrough' , element : 'strike' }, + { name : 'Subscript' , element : 'sub' }, + { name : 'Superscript' , element : 'sup' }, + */ + + { name : 'Marker: Yellow' , element : 'span', styles : { 'background-color' : 'Yellow' } }, + { name : 'Marker: Green' , element : 'span', styles : { 'background-color' : 'Lime' } }, + + { name : 'Big' , element : 'big' }, + { name : 'Small' , element : 'small' }, + { name : 'Typewriter' , element : 'tt' }, + + { name : 'Computer Code' , element : 'code' }, + { name : 'Keyboard Phrase' , element : 'kbd' }, + { name : 'Sample Text' , element : 'samp' }, + { name : 'Variable' , element : 'var' }, + + { name : 'Deleted Text' , element : 'del' }, + { name : 'Inserted Text' , element : 'ins' }, + + { name : 'Cited Work' , element : 'cite' }, + { name : 'Inline Quotation' , element : 'q' }, + + { name : 'Language: RTL' , element : 'span', attributes : { 'dir' : 'rtl' } }, + { name : 'Language: LTR' , element : 'span', attributes : { 'dir' : 'ltr' } }, + + /* Object Styles */ + + { + name : 'Image on Left', + element : 'img', + attributes : + { + 'style' : 'padding: 5px; margin-right: 5px', + 'border' : '2', + 'align' : 'left' + } + }, + + { + name : 'Image on Right', + element : 'img', + attributes : + { + 'style' : 'padding: 5px; margin-left: 5px', + 'border' : '2', + 'align' : 'right' + } + } + ]); +} \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/ckeditor/COPY_HERE.txt b/docroot/sites/all/modules/ckeditor/ckeditor/COPY_HERE.txt new file mode 100644 index 0000000..21920c7 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/ckeditor/COPY_HERE.txt @@ -0,0 +1,3 @@ +Go to http://ckeditor.com and download the latest version. Then +uncompress the contents of the "ckeditor" directory of the downloaded file to +this folder (modules/ckeditor/ckeditor). \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/about.png b/docroot/sites/all/modules/ckeditor/images/buttons/about.png new file mode 100644 index 0000000000000000000000000000000000000000..0322c35825efb2e77ebc4422dee1414baafa70f8 GIT binary patch literal 1221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBWxr;B4q z#hldhihKB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBW`r;B4q z#hm1X15C?o>+^cfh|esGx-Fq(lq=B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBX8r;B4q z#hl~>CsrOF3zkWX7f+tZ%CpVTNJ@dz<#bw#L7uaaKy=x$`cIoqNECtmPAWL9X<4^>bP0l+XkK D;(?@> literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/bidiLeft.png b/docroot/sites/all/modules/ckeditor/images/buttons/bidiLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..f10b36070d3cc72ec057203aec947b1eb342876f GIT binary patch literal 1149 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDthr;B4q z#hm1X1xgW|Y%6NmRvaj8VQ~5MtCWXv1xFXx1c8_aM&Aa;=?pg+7);Y-HssH}xdddG Mr>mdKI;Vst02$(TivR!s literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/bidiRight.png b/docroot/sites/all/modules/ckeditor/images/buttons/bidiRight.png new file mode 100644 index 0000000000000000000000000000000000000000..ba1ec2e958faa3420f4502ec54e459e91b8df0de GIT binary patch literal 1149 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDthr;B4q z#hm1X1ws*=Y%6Nmd>92@Tg^J~^)-j8LgVWK#svbaxMnagw=qm*V6a!0*>Jh`MmNYX MPgg&ebxsLQ01t0=UH||9 literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/blockJustify.png b/docroot/sites/all/modules/ckeditor/images/buttons/blockJustify.png new file mode 100644 index 0000000000000000000000000000000000000000..a3f3a83754d46d6ac400d1445317c5a3dacd2776 GIT binary patch literal 1124 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt@r;B4q m#hl~>1)h0|&5G-qfF;M4wQi!ib5st3^mw}ZxvXB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt|r;B4q z#hl~>1#X?_Z9INXKToSUd(LPOjX1!omtb0H6e6LObo3CDlKNp539kcdQVZ-3r>F=? b&;P~1AU;WEm56qc9>{D@S3j3^P6B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt^r;B4q z#hl~>1^xm@MyCfxECq_33@1+~2=VASv+kI{5>Rr0B_Jfh{ISt4u@c6Xg-aM2{6&qp T?=HH!9Au`atDnm{r-UW|1UPqR literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/bulletedList.png b/docroot/sites/all/modules/ckeditor/images/buttons/bulletedList.png new file mode 100644 index 0000000000000000000000000000000000000000..8d0896a1ca1c6d7b8a5671556e1e5cadd2ec6d1b GIT binary patch literal 1131 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtnr;B4q t#hm1X11#s~*&Y_DU}L=zD!}G^B!EG2h3;kRg1&zst)8xaF6*2UngH{>aE1T? literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/button.png b/docroot/sites/all/modules/ckeditor/images/buttons/button.png new file mode 100644 index 0000000000000000000000000000000000000000..21484f8c0b9d558062bb9fe7c37d38a4d5905f8f GIT binary patch literal 1191 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBW=r;B4q z#hm1X1#A|qY)ni{zkaRyqrljB)Pdp23N7EyO&lsJ4Lcm_5;#H}M31n3TJPJ)@j{#N z;L8ICvacr{WLl-aH*VjTPh6axy}8WXAC#F_?T{8`V9?W%_LONoIS*v5r>mdKI;Vst E0LX%f>;M1& literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/centerJustify.png b/docroot/sites/all/modules/ckeditor/images/buttons/centerJustify.png new file mode 100644 index 0000000000000000000000000000000000000000..b4d9f9696e2716c614f12cbcb2596c22f398c73f GIT binary patch literal 1128 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDu0r;B4q q#hl~>1umOrCZ|tFR!C+Te_&$R@!s@h-RwelkUmdWKbLh*2~7Z_D{trk literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/checkSpelling.png b/docroot/sites/all/modules/ckeditor/images/buttons/checkSpelling.png new file mode 100644 index 0000000000000000000000000000000000000000..8e580c7ae115e14a60a2cd676a73a5467c0ce888 GIT binary patch literal 1193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBWsr;B4q z#hl*0gS-a}c$jYf@1Ahu!0eKBLFQA1_MbXzD6TC1Ly>F3u1OzNLm4QOmti-RSmM()78&q Iol`;+0E$SGdH?_b literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/checkbox.png b/docroot/sites/all/modules/ckeditor/images/buttons/checkbox.png new file mode 100644 index 0000000000000000000000000000000000000000..5592a45c55e915bf11c92453c953c1b6f7a80d5a GIT binary patch literal 1171 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtmr;B4q z#hkh44Y?Q;c$@>@+jp}*PRw0=ZCA&S?KUqiOxdRuCFi?B`wn9UJ3}e+4(1gv%1)Fe kSTk+6Fj3M_PL8kY1107rywglUHx3vIVCg!0Gj!O1^@s6 literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/copy.png b/docroot/sites/all/modules/ckeditor/images/buttons/copy.png new file mode 100644 index 0000000000000000000000000000000000000000..fd5bb461d99e896dcac4e202fb56ee61260f0a0a GIT binary patch literal 1193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBWsr;B4q z#hldsjl2g8I9P7(FJ7w1xIH+=raHYb`t%2eck80u7*0?8XwNX!A;!aegXvF(ub<1D#RPtz1zGIr>gTe~ HDWM4fH{6fU literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/createDivContainer.png b/docroot/sites/all/modules/ckeditor/images/buttons/createDivContainer.png new file mode 100644 index 0000000000000000000000000000000000000000..5b13638f6ac259a15e6682dc66b54662812935a8 GIT binary patch literal 1166 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt=r;B4q z#hm1X1KeVbC#QP+am}a^h~o_0A{2Vm%fvWrUCWBb&h;q=^cdVcm=g3{Ql5J4V3?$w e(Dm_iCo_ZGD*4KXQ{RPwO!sv4b6Mw<&;$U&=zrb- literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/cut.png b/docroot/sites/all/modules/ckeditor/images/buttons/cut.png new file mode 100644 index 0000000000000000000000000000000000000000..24b5d57c65229daad1cbb3cac14238a1e60b93dd GIT binary patch literal 1233 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBWrr;B4q z#hlWf-CQjO0u^weW&t~>?h6k z6VJP4$FFJpR>j7=iGSC;iQbAn9TlAd$32!;ynm>&yzNDc&Tqd}+ADt)+MKRfF*WFV x2|rWA!Xl<`H+H9P7pSnm_V1`r^&<_r`Mfh@9YnS?m2Lw$(9_k=Wt~$(69ALnrAhz* literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/decreaseIndent.png b/docroot/sites/all/modules/ckeditor/images/buttons/decreaseIndent.png new file mode 100644 index 0000000000000000000000000000000000000000..c23a31b9af982018b22a6bbea2c747658cfbe312 GIT binary patch literal 1153 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtUr;B4q z#hm1X1B_~qCpDa6QWQxD-N3MhOK~rQZvvylf)@@e8ng}xC>)k``N7J{z>pTDENH(t QPzhw9r>mdKI;Vst0Ot^PQ2+n{ literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/drupalbreak.png b/docroot/sites/all/modules/ckeditor/images/buttons/drupalbreak.png new file mode 100644 index 0000000000000000000000000000000000000000..97dfea4913a42c4fd5610bbd8960d0554c8a3c96 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh<3?#J|q#XfLjKx9jP7LeL$-D$|I0Jk_TqS@E z28JID4Ek%d4+2??B|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gg{;GcwGY1JcS~ z;_2(kew&e(lhJDR!<1N{kdmj1V+hCfJPE{9O Z7-sHc-ySJA`djQ v4jede;?#*l2M!!MaflB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBW^r;B4q z#hkf)ied*0IGn5NB^x77aW2X(-^Q4{HlD?^{$zEJ;3n?sYqt-WOi7LEKCaby{FVEb z7rJ-fur60QA^kzLsN|^e?Kztr*A%IIV7_Gjfxn`8hXL~j|Gz8O|78%|;M;gL^+5#4 NdQVqBmvv4FO#py3lZ^lX literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/flash.png b/docroot/sites/all/modules/ckeditor/images/buttons/flash.png new file mode 100644 index 0000000000000000000000000000000000000000..09c0da07c85dadd79985f55e25c4ffb084de4db9 GIT binary patch literal 1226 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBX2r;B4q z#hl#!)10ja0KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000AeNklnm{Y*s|@av&lQefE<& zr>eu@@apQy%+Agh3I*q!s=gFg772Vm3PbvYu>#3t5_a)9($e#Ri_{#A_Wvm zEc)mBcalhyN+ke>nIDu_B_ijXa}Izp=JRG!jgR7f@g%xL#@b{uA=W?v2M|F4KnVg2 zCZoI2oiRpL|3S#}yhfvOaBz^%=dHCnJ3H1|X7+twRgE!3q^crPtJM}37K+7U6h%)L zSVX*3%8(FqB9R0f01ze#51naH^?2zGaOE2WYjMe!~~ z#QF%%xpuqVYPF7!kGtLOn>TOD;LOy5MvUFM4U}O{_y>;N59P$^2^IhkskoCz9j-P zGxLLYjWP9ly;`lVudf5Ryu3U=KL^lkHp}I5yWK7pi{tS)48v3^H5!dlsg&>g&kzj? zVltj3Vn7|}yY21Jg#;yIS=dZ`@WZ{FLPRbuE~?dP?Ao|K_V@QYozCXwW~~Q-2ZMo#&@%wcV#F9R##j+{q{2dM*;p~wu<$+4AP62e;e7_j?hb+=c1Y}& z`E9^J^73*RhUTL{{b(Jh-KR6pSb+p`gqwb! zL0~|Ym{bW+g)(us*UQh(PaXU8yYh5=l}=|0v+w_S=OPD8Yxsk)6~y!N^QsCWy1u^7 zX0vgPz3hu@JejCE0_jxs4|(Nz)))Z2Ue7d}P2cyk+3c4p_y2*aCKCxFQs`rWKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000AYNklc>0Av6LMkDz1r%T~D zrBVq1Bz-G45oxWN*>zoJHpVbBecuu!a$VP(^MsVZ3kU!jFUu4$;|R^ zOr1{W;^Kmt*Vfjyx3{O$>DAR$wOTdCAmVH`GsZ|Mg%EZR%tA`X^#lnL!gF0_W5t|m z&CE__=*b}Y+NvzeTCLW>!GTih@bIuwsa#)QZ)|Lwo}Lbe!z4+n)oK`q&1SRL>(y$t zQmMoMl7#EJuH*K4z2AO6@_j$evNTQifBvPsxS-P%pFsQyLWm#;PEJlbolc|C@O{72 z=}ab*t*xz#x@j^jj8w7k6B?RH0_ky46~ zq>_&7+1`Ks`0@0QKbPOVTU~vh=@}qOtq_5Ti0H*LrPT59@%s9DrBb=SzrVY?D;A5s z@6XN6MNw3#RLbS@a5&88^NmKM+wE>{ZaR)*m`MobD73ji`su@mEK8YLN=1T{RPYop z)LK8MBaY*YLavMfVHyGkhmKx=Ie7-Nud z96wCQV-g4qjDU>H0Av7&kOuJpr3%9^P1A3pZ;Y|x+Wm6}0AOh>y;AD=00J7|K^zMr zKwvNg#DEM807TgD4;D%#n+f?ZAND^YKR-X7Bv+q11`IMHz{`|mgF@Kx0RY(V_vh#5 z|IZ+{nCK}mBcQ$I$v}3LBZNT2e!nkoZf>;J`F!4r^Je_udBDiXmWjbmWw0|Zj^n#8 bU;Y{ZL($1NVJ|%)00000NkvXXu0mjfJxSuI literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/form.png b/docroot/sites/all/modules/ckeditor/images/buttons/form.png new file mode 100644 index 0000000000000000000000000000000000000000..35e055b801380224145e2b0e463b2059f47b7f4b GIT binary patch literal 1141 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtdr;B4q z#hm1X1-vtiQn}{L;1zS2bVRS=zRjAbwDa?NeF7L67(#XVE;to;+y@!r>FVdQ&MBb@ E0DQ4@NdN!< literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/format.png b/docroot/sites/all/modules/ckeditor/images/buttons/format.png new file mode 100644 index 0000000000000000000000000000000000000000..3d813f613a22dbee3f3d1498acc3b67b56a7870b GIT binary patch literal 3815 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000CMNkl;v{F0RCEk|ax0{DiRp1VI1*VHg@?R2YViDE`al zzPheN-A?DPjg4NnOGtnK0&u}aGHZ*o-%oveJIm5sE~l9J8g&H#B5IwSB;Bs(c_3m1 z5D`%T1O$m?XZtPt{^aB&04O5*pu7koT5GMf0HBomVk25>2W%H1Dy@USXRSa0EC3=1 z0DvGcz*+CSbKX%(iO5HUJkQ(T-+%V(+1S{a*81_|$69M5N|HoG+y{;X5gB8c84-;! z0N^T(F~*n|FJ3%+_%Kb=0k_A@-i;dy8Hs#90I&c62)$kcB3cCTLQ{2BgCt4z_xD#< zS4T!hthH&HK7aoF?CflLd0A^+tyX>Ccgof4^~J@-?d|O>%N7dtUQ6{`L3YhK7bRYg1!ZR#v7bCzC95BoUG13aqv7-o2~W z>n~rvJU%{t_3BljP$-wnl}ZH>E0szvmy6?gb8~Zke*Wpxr@34X5qEZWj*gCQ-n_ZA zw6wmye(TmPt+fmeYndnr0@muALZMJ7#HXiYQMCBO;#6UhmG(Rj0bT6}?}~`l8UU=d z%pAvYyWL(|T5|pEcDu8)v(wYldwY8i9z2MmC=A0pckaA-^XB~gJP3knwVEUeGanor z+`W5OM6OQ7e(NreA*k>5s~vqtRHYbURB70O&*`0y*?QQ%copwPLY2H#b)< zm%}i016QlnrlzJgHa5!Ta--4cbUHILGrPOHr3kb;U%0f#bVL9)*T;Do;+zZ8s&1? z_kE=lGY<_7A!5B=FO^D3k{Dy|-McqFKEAfL)@(M1hlf4S+uYoAQ#crah!rcvN-51u z7KMqCG%3wWD`M*NbaUMgpuQ^3-NqQ_5a*VDO~0}~1kMR=%`D3XbOHb%VXuAOX|;$6 zL<9i=#R8HQAVNB6od|KMR7%tIqaeH5L3i!K>(iS4!~ShQqz8BH1zkXkaMEfKAP|5E z5{e*z2nZn^$MM+2#D!x&Yw53q;ao0^Mz^=#+ROr69K)B!7C@Sqm=F;_#AdUZ&*$A# zUGE=Rx7QP~2q+h-U*?tPX{7)lj$>7;)siI1=ks5D=HN2veVPk d!$#xp0RVqkJ}qy^akBsb002ovPDHLkV1l@uAg}-c literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/group.png b/docroot/sites/all/modules/ckeditor/images/buttons/group.png new file mode 100644 index 0000000000000000000000000000000000000000..977e58ef90e9cba247801460c543444a121a5593 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^EI=&4!2~4tUGZE3q}WP={DK+&gP?hYbS+SXv%n*= zn1O*?7=#%aX3dcR3dVW5IEGZrS$cjUUxR@F^M!lU5)3PB{_8*c(UQvfL3n}sjWX99 z;RMU?leV4Y^!#GX@J(P!PQ={cw-rZ|geLYG-_l}Eko&yB!!&%ud>|CO$Z$p77a4nUh2JYD@<);T3K0RSg#Kd1lz literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/hiddenField.png b/docroot/sites/all/modules/ckeditor/images/buttons/hiddenField.png new file mode 100644 index 0000000000000000000000000000000000000000..4714544810089fc7afbe6b1aad730d23d867a540 GIT binary patch literal 1313 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcF?tPZ!6K ziaE&%0^(b4Xl>+TlaP?8(tgh1sv^LoC>-?MW=caR1M9r=p0h2FGpR9&%uvgjy_0_( zx5k1g8Y#1H>TrlMX6{^98&>gnpYXwGM<)fw-q+jG<+sLL3CeJZFlJ7SFxCFi@?ewq z>SCvG&L);M>5PpJIzJt{TD*LB>(^b literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/horizontalLine.png b/docroot/sites/all/modules/ckeditor/images/buttons/horizontalLine.png new file mode 100644 index 0000000000000000000000000000000000000000..2453110d232414df7fb1a31c6e9961f421d0346d GIT binary patch literal 1158 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt+r;B4q z#hm1X0}Ph~89WliI6T%c1q(2?{E=zl;+WyQhO5xxfT}~&!r~7rXD~Bf-dM@U%fR5> Vm*w5PXT2oIR8Lnwmvv4FO#nUUc~k%Z literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/icon.png b/docroot/sites/all/modules/ckeditor/images/buttons/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..99606b29b31aef6f734bbb22c36004205490497f GIT binary patch literal 4405 zcmV-55z6j~P)HgRT=-z%)NW}?%iig zY3YkTXq7I7ZfSvSDP17=4;nR56r(Yb5H&#)B@qz?OBKZ^F}{#T@If?+Axfjh7kwj8 zz(T79Yzys{zL$OPea@WY?>pzrbMNjJMRYdb&fJ-EXTJCM`@Xs2hSMeDO(`M?@=1}D ze5`OJNa2Hr>%J1i7o@}Ia1GaeDX>E7z2bZDAJ+KF97}soeJ|Wo-$Lp8H{;9&xOOcr zulA)H@+JKY&)%fyjcplvYc?13Hqd2|s|VtCgZaf!f?&n5G9cS^LeWjQA+VU96$Az3BV7Q=5QJq?#c@4X%KX|qr?haYxi)q zhJ%_iE~R3772C_;JgMs;?0-*yfMM*L!0I73YuhO1b`@!&<@ zAvNAoiSsyEOH#1Q`EQB<0mHbP;}D&fg&*exUD+r^cY{mk3FWvxm}M?*F$0h%wCDY^Y*YUWoO1ht}m?XBjkIP?||-8BecRW^0yN z&9EkEkCnb3UoT3fg@NU$L70c7T?zX}tnXHDQ~;$@B|))tNdZ1wa70f*h>IJ^o#v3y zPL;JBGHSFg&G)c3?!xPMU%>@txMmqXE921erVQnghL2W!dUCj;pXtqj`Ww|61?$H_@f&jyw(ysJ8K7V*dp04d^q%DIL%0S3QSmuEfMap3>mEk(newdM{ z2S@izDF6o_tXgJ_llE<9zJw30;PTxqIqCw_>=x`+2f^eca1CaBf7z$g2!g7V+Mk)4 zU7_#OkHx=-zkdiqY#pl54$!Qu!zhdHJUpxey3sLfDXPd!7b_t;a5yl907N5-cB9y= zls4P=)|?g4G%)hH@4YsP>|`uJCI(oB+4$cD+B~TMj?@A?UUJn9!sdTz z(;~;mRR}oFDBnC)qUTGVeSjbb$O{F{zy#}dWe}%JX6$g;(>XbVH7x8${yBgwl&8hW zOvmB#+O=lp>GShi=+RR}SkTuQB?@FM%$2a` zO{bMm(qpHKRN$8xL*di%XS{ke`4YDNLs{rf3_xfx$t> zEm#}-kYRv-bjmCWDQ7J#ZU!m6>twti9z__`?+R3WizRH{A|D_mS$4ppW0?@qW!O(V<5h5T5t zWA|l^9)Q5twC0et9D4A?m=@%QSp{0z+(2WVNVT|6j%k1;_p+zqMt_sKCyp#I06#eZH@W~7H%kE?inJdJ zZ2vrp)$9gGLj@BDG402i70&s;=`U%>@kwZ%`C*uFH}d=%Smj-Cr(sWqPU2VvJpn7M zg#hiGf+TGy=X-!WFNG!ed%u7i{R8K}gsj9_%Cn%yHuJQ3phPnnqBLc790YYB@N@9dQ`K;O zJUPDSQ$RIO?m;E(jpHGHKyTH9rW9R>K=Z77dDcP}J(@;{`%Jja4^I>|w76w%vo3fg zEZl&sG%x4UjYzLLpjBkGU2r?zE<-k|aFE&R9uStSfs5wZP16L_3JC*}YGhQ>t_bJz z4J08p=mk{ai*!R``UBr)EJYM`R2H9eRlWPQ5n6=;_3mkTz3y?i$)?v!^jTEiMX)48 zaQ+TwxPyQvT)D68$lC@dieeiF3!#Tjp<^vcj>py2lF#W>(&lO`ol0B4o*AoYm@p^n z>THoWmm zHbKn^ab3MZfTK_Z0^)*DQ({M1X<%tw#impCVcxh=Df_XaM6rIBLX+zpzY#!f4t)DY z1T-t!Pp{HARPy(`A&pmq73sg0`%KQM(O=%E7!I*Xl*`% z3jH@=pgR|L=-kfB}qb@W~bJ1JZ{ODdWkk>Ol22v6+LAy@_L5{|=5oedbBMul& ztcIUfBgh+br}0^d1^)iA5#4!hT+|M23yn^1JJ3(_;Z`@zYtzMz<7~_8Man|^T_}2- zrNT@UJ>UvuP(w(LLIl;JUNHDVFrcytgO0*?UxKOE0JmfUV3uMyEf6y{fbZS@${?)* zW7i{q*>YR@i}cGAqx882?X;BRiYxv|MQ5jL;6^fGP2*13R!E2DfhZtH>ZW8IDL{s8 zK^%C&R098=gy}o=1j5yjp)T`@X`6x-&?B50qn)S)w=Znh>6qKkjj#0U^;m@*Uf67OWPXtv+q36M_)bodX$7ztkE~nqld!L z0XJHyv=k8T^&B+c7eET7<3NO6R5#qH7Gjm;z&6&9m~IKg8r?Nirk@-$ZnFY$^*7%NrGEGC5r$_L<$!6?UoIn~K(k>S&Jtm0Jtb99ycS#t;9@b7s zg0`k+mO37`4_9dk;$RLcP&K6?iofJiD#Z927ejz!=-RG&_9*?aZ%j`uzOZ<@&OCpH z<{gnJTv75&BJ3Poa$Vp>8IqH}9M~=`I?(N)9_67PKmcbBQbM7D_7{tK#*<8=Dp8dg zmy~^}HQfPCcLDn|{(s-BW?F%~e}C^FJ$7=$%t+H6nZ0r1PpWR5yL z9R?E%R2Tfbk3mB?G&q2>45oLVG%x@w^UX-gXaH=%#%q z=|KpP3Evk`5(klrKwVJSP?ZBiXOx=s#U^@v@iZ#*g20u6E{aEl@94S3f!whRZjAQfXiUSFb^3Vex? zO*q(6a;i78Vk=gBAaEfjPNzRQ!ChCL9$MN#-#jv+A9yi3FlL%F3~O`$N8b?rSp)d0BD_t5Ms)eujY%-n~8Z#FDw z4c`OQbTzHgR%mzUK!x^>R_G*x*0+sI*46~uCWdWg0=UV*6=g#EcFhRrE-d(ZD8TaF zQwo6Rs^@Tn<#7RgJ03hYm!YM3SGxko#%pks5{_BB%(NSG4QVIAlG5`XN`AJ2n00gt z=bi&?ky38Lsh5+pQ8neueV*Mufo03nZy9--b_5zeSgdISXRK>9xFRZS6vr|_ioZ=TV`gauxrlZsmLYkOB zQPEJ4Ui}l-{t8xj5{;xGUR9JXDia9sP6XYi{<1DAu9)y$@h&}uSJaX~pDO->I_Vaq z(s({GDmjGvJ%bC|!1PWC{}R?z48C~-KlhLtF(|qZ4aQx)qq=!1)VBs_&m9P?H8M5; zRw@>3VE}T#$&_DHAND-;+krJZal9J>3<(<-_Pv;WOB49N?t`PuqkrXMMlO1)j5YJy z^5!k&$I*1Z9nj$3<3*j{*%G;=ApFhWV82F2zl{jX{P+f(N;vpC`!LpSBMw4R$KQZr z&A?d7=tMA1bR1fDb_>00b{l>4-08*w@oftP*l>85UPMM=wR3s5qI5tZ+oAmnWGZXm zoQH!0xcy&wzyOf73tBv&0v!gHVP0(4SF-}w?5Hsc5J@?JxrKl!O^z83EGpz^Q9esE zP{CKWH&OTWLKL6%D)9*XgI|ko9<0(%;GU`tbU@byzLa<4LFa;L-ul4IW+|X$srG@{ zvUV+KimS4jY5-FBhFP|%tMsc;YR|g*o)dxbb@gSw_^p0N*0JN0w}8_(LxBIsEi-umCXxC~Q=Ai1{B}wZjVrOL&gXj9 z)INxe-?Gth)IM=|JqE(JX589l@=WPvCp#3v7f2K>|_F@&(~Y$ z)Uh7bVNS)EObZb(DeT@!oeMCB3SvN{+(y(n=cLX#len6gzL<- vdE<Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0WL{IK~y+TW7xR= z^nVN>Vrz>j2oYhZo3Ij>99D4#G|{TH>8%}m{8Ntu(Ui3tcb%?4Q-GqOx4{&sVd27g z1=H8N7Wd`MybRQ{dwm5E!L^}iD6c34+0Zi)VgnF$OkW1H1gH&*2B12i4M2lK!dC)G z2m+J;?&o_7}z0kuI8L<3NBcHa8w)2FXpyAT>maJ%@l5`ZWpBLnCv2m-nXVjIM5 z=o)~=+xbUBypbMf0%QQ~k&WIA(SyYgKn*|}GK*?}s)2fd8i4A6fu-gDJBc%wW0zyI<6Q;~Wjyps=e0cik(eXn!ZrnU|>eRAzJAi1*wrxP} zg9i_QBz7kOMS~ literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/image.png b/docroot/sites/all/modules/ckeditor/images/buttons/image.png new file mode 100644 index 0000000000000000000000000000000000000000..28e09de6df59ddc46cc907e151e2b6ad192a11c3 GIT binary patch literal 1267 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcF?~PZ!6K ziaE&%3Owf;4yI@@aGuecz|<5ORsC&_J-;Bs$E7S=zG=L-e9tDd;Tr?DhPJiE8^+Ze z?4B-MCbo=+Wl~W>VtA*%-GJ=jP07WZAKEzHPNxB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBW^r;B4q z#hm1X1#A|qY)ni{zkaRyqrk|>uc;sq5LQ-j!&q9U;FPnku8$;#%2Nd3W}TV6e5_aDY))cdc#po48dgS30u%XlxMnVenkFLt2=DVb^DIj`OE~tAece MboFyt=akR{0Fv#8WdHyG literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/increaseIndent.png b/docroot/sites/all/modules/ckeditor/images/buttons/increaseIndent.png new file mode 100644 index 0000000000000000000000000000000000000000..4341b2f78aa5562cfb4079248b1f7b94e6cedc50 GIT binary patch literal 1156 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt^r;B4q z#hm1X1B_~qCpDa6QWQxD-^j3pE3)b!Q%WOiLc=oFWlZZj8XFsQTkbmE(AQvKNRUz% T6sh|w1Txdp)z4*}Q$iB}gPwTk literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/index.html b/docroot/sites/all/modules/ckeditor/images/buttons/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/images/buttons/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/italic.png b/docroot/sites/all/modules/ckeditor/images/buttons/italic.png new file mode 100644 index 0000000000000000000000000000000000000000..8ada3d1c263ad0ccde5f3524e080dd342120f1f9 GIT binary patch literal 1142 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt-r;B4q z#hl~>1@V}DXO5Oiy0*MF(vqLeASLhIkRB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDu0r;B4q q#hl~>1tyzjrbAiTU!8 literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/link.png b/docroot/sites/all/modules/ckeditor/images/buttons/link.png new file mode 100644 index 0000000000000000000000000000000000000000..0c2052d8beb07cafc87c4bc2a5d08f4c8eea7429 GIT binary patch literal 1224 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBXMr;B4q z#hl)rjl9f`94!7y44qmUPm8}lxFfoEg7t=NbJri|p0kvHFX#4R=Ip=XEAOnnDSPtu z&kc>zGa{L#1^%q({jF(usDgFf4fWLKj%;R0h6Axjtl#vVSyTS(I3rVdsFj7q0+y4G on*85%81^ijJL%W6%Ch$x_f6fY5Ir@P^ESv`p00i_>zopr0Es%DH~;_u literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/linkit.png b/docroot/sites/all/modules/ckeditor/images/buttons/linkit.png new file mode 100644 index 0000000000000000000000000000000000000000..dd250230ba9a6c4a355f0605ce0d11a275394163 GIT binary patch literal 608 zcmV-m0-ybfP)u<$b&sBkk_m>4jk%YlHrgam`HixDGM17RBERMZ(< z9J#;}drm)LSbOjQ!`&CZ{_}CLV8|UhdH}@yk8UU?IzbM8M#!{H+b8P;#u#ULoa z#}F9c16RZ+BFXUS&2xr%3zmW992_iwvzyIugup#e1d;)vV%*u)(+Q*C$CU@=abcPT=FR*%lodSlQJ*i;!#x1)U z4o`RhaV5w=VzGCX!T+sSX8%V98!t`yZw`<%}BO^L%*~E2rvM;HWy3D=}rUy0000A9tsSCCgwkk>t@ARu_|6%~~nm7E-P%_-`h zSJZQ_WFW{cPQDkE{5~o>yEr?$I=i?!`*~3I_w3^5$<^ey?V~~p0(fS zto=V_>;I+4&Ye5)hydjY296aB zj2to^8x|aF=HN9ma8znJ+|K7YWkSM*mcDKYs$J&E}6 zyhd`jYzG2-0i!fE{cz+4IaJ4a3gJ$IF{NYR+uXtI)LvekrB3nnVJ^9Xyb zj50O6pxnFC$U!eu>)WaWLgJ}Ub}ZPE#V2L5!EdiZfKxM@_r`mBs~y+z@Ud-wy3O literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/linktonode.gif b/docroot/sites/all/modules/ckeditor/images/buttons/linktonode.gif new file mode 100644 index 0000000000000000000000000000000000000000..f09db7ce43eb24f48f0bd2913513fce02dc6483d GIT binary patch literal 979 zcmW+!J&4~$6r70W{zVd0j%Y55ga|@5O&q~9ijYE03PHp*VjK)r~V5wzGs(I$RC8Y>&I7=L$LJofE_oq03!$gzhP?_HY5JWd|Q zzJIUZhUpyKESqmqGs6ZuZpeCwNjRrKL1zMsB&FDZUdY~t| z(2W5MVgyEF2*cCgFyVj`7Cbc*Hi;mT&@^KK3t56CS;S&iu#z=clU1x{0~^_bE!o6o zcCeE@*pprC<^Tsdf+IP^VHz~)ppzCo@tD?TAOacCL@NrSFiJ$pD2n2!h{~uDHKQu3 zqahljMYN2jXpWBPj2_W5x}rMQ81< z2q6VcW~e}gDxs1pQn4yjsT!)ODpjjNjcTEmYErX0)TtiosV;SEK!X~gks8vl44HDs zDNFWd5GFS!NhV&?aEd~K3thq`UF2d{xY9LT(^al^gB#t#E#2g1cev9%+|ym|_J9XH z!XrK8u?aQ>ZE|~(eA;^pd@J=^WwwfKv)hiYe(=@Hvz^}_-M{_OZ_e)eY30(=jX$iv zb}OG*S$a(CCl-z@|MAq1SJ(G0pM3Sw^Ec0}ot``V_oo-%`0Km#|6O=)WA^5qM_#|{ z@<;RMe}CnR(+|#F_uIKcPd|QU_d^HXees{GPvkA$U(de0Y5(?d==)t8i>nv*)wLV09pD2m{Jgwz`|*$W Rl>0vX^UB-2W5*2l{}1u;%Xa_( literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/maximize.png b/docroot/sites/all/modules/ckeditor/images/buttons/maximize.png new file mode 100644 index 0000000000000000000000000000000000000000..8ea2a6212685c32b7cb78e907b142ad33801b0e6 GIT binary patch literal 1184 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDu7r;B4q z#hlds+q?`49Lz8O?LWf0t2el_iT{a@&yEm>i42n%Cv+`n5iBqM(v>$s(cq}xf!nhe y$bO9s{@}Sr?hdErquGnj3Eodi{rYR?mjVX9M0GEpx1PBm`#fF!T-G@yGywn#UyJzw literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/newPage.png b/docroot/sites/all/modules/ckeditor/images/buttons/newPage.png new file mode 100644 index 0000000000000000000000000000000000000000..58071d939098d66694ab3c6253572a9441854a49 GIT binary patch literal 1142 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt-r;B4q z#hm1X11#-|36cU1tZ4@iCeOM}K#j)tSJc^Cw@B|LiQt|SXG#naW#Wt~$( F6957mb$9>( literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/numberedList.png b/docroot/sites/all/modules/ckeditor/images/buttons/numberedList.png new file mode 100644 index 0000000000000000000000000000000000000000..651395eb530bdf7c00be70ec6c016e6ea24f28fa GIT binary patch literal 1149 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDthr;B4q z#hm1X11#s~C3ZBpDl+IbEM(F@U?Q@Fef`4o8(t{B2r6;D=&PEb#<06dZSh(6H3vb4 NdAjB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBWor;B4q z#hl*0oxBVN9L#&`XESLoI;W&5sqp#B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBXMr;B4q z#hl!JL%s$D9@m}!Z!ij#E?DNCpq^+bbKvNagR^hMw;23b_V4KDeK3KEWEC#vD)78&qol`;+01OwOF8}}l literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/pastePlainText.png b/docroot/sites/all/modules/ckeditor/images/buttons/pastePlainText.png new file mode 100644 index 0000000000000000000000000000000000000000..5a7a4ee0fb0d90f899745f3011fd8f9d9d5b099f GIT binary patch literal 1246 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBXCr;B4q z#hl#!yV!q&W{{ug)0%qlry{EF=yD*WnwR!&g2H~ltys1H}E;G9< zKe^I{>&*+dy{!8V_W2)I%B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBX4r;B4q z#hl#p8@ZSjc^VS$*Ov$gaY+?)&Ytj-<)KB(Y%4LVl9$C-R>-t|n?H%)=*WzE+pXEF zx9&4hnpLft>cp{SLI2)-h3%Wl8afU~N+}4*ylasBZ1?a*f%FE=6CYm`u%9n@B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBWsr;B4q z#hljjj(i6cI9vkX*EbrbnC*I?6tkwm^itWy{f|`za^KEQy?a|h`=7&_P=iSunBC$P zw=l&EER<)c(No~^=k7Qb{5)m@-;YBQir)|JnXn-8=bg>mGbg3&^{RjP6=boetDnm{ Hr-UW|>(-Cl literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/print.png b/docroot/sites/all/modules/ckeditor/images/buttons/print.png new file mode 100644 index 0000000000000000000000000000000000000000..07489b39a8abc1034130e85e188afabec1cc98a1 GIT binary patch literal 1183 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtyr;B4q z#hl(Vj$91}JT4dS)JL|7s7QY`vz=;q*`+YBX7|sQjyqKo-0$BpzhO1w=I?eZhPB@u wtHsXDRXo?}dfamr&x*N@+|I=tV_H@0WBwHQ&QHl`jsRKb>FVdQ&MBb@0GVowFaQ7m literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/radioButton.png b/docroot/sites/all/modules/ckeditor/images/buttons/radioButton.png new file mode 100644 index 0000000000000000000000000000000000000000..af40a3d062f7ad4c5ee578e5b45d45f275aeb02f GIT binary patch literal 1164 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt|r;B4q z#hl~>1>qIk+?<&!ls`W$6?!_+rR8ZlW8)u_9SsxCt+}~5{pAC}0~eT#Lfq?SF?4Oc dJmKdRHin}PLPg=sE380fd%F6$taD0e0suvdfzAK` literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/readmoreButton.png b/docroot/sites/all/modules/ckeditor/images/buttons/readmoreButton.png new file mode 100644 index 0000000000000000000000000000000000000000..76bcf5eac581ca9f7f312b5c113cbc5ce9118d55 GIT binary patch literal 1145 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+3?vf;>QWgPm>B|mLR^7d2?mBAKx!0>hQP=R zfsJd_O&J&%8A^iug8wu8AJJf~^)qc?3efO$aSW-LlbmpbfhVF>B7i|J^oPl#&{oAG mKyaeNDM5JA{MVkBI2ca6XVf}0TYU*A)p)x4xvXB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDu5r;B4q z#hm1X1xhmvnPU@P6`4$2>7jIbx!+tKCWBbx1A9(71a@%DU_KUL>%bRLqvgZiV$Yn% gbhzlvI|Vrgh6^q7irZxiCVB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDu3r;B4q z#hkf)J9!xtc#dqUuk|WU-IgdiP2q{-6pr$3BC#%Vj)xu}HdNL(FJIfR^XgtdgSj7g pBz8IOKA`j=$3goG%k1m(?IU(SvvMypJKYJg$J5o%Wt~$(697hXhJ*kB literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/replace.png b/docroot/sites/all/modules/ckeditor/images/buttons/replace.png new file mode 100644 index 0000000000000000000000000000000000000000..8263ebbb4e8f96e5d4ba70a766b230419d190447 GIT binary patch literal 1182 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt?r;B4q z#hkgl8wC#-a4>JJ_grn)ox-HGK3R{Wc*&P=g+>;RMTrJ2=lL&giHM!>*S2-ff->fR vg?CFnWq)#rGut^Q)c2m|%_;igdz#ak=c-uBzS!Fl3bM`9)z4*}Q$iB}g`kNX literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/rightJustify.png b/docroot/sites/all/modules/ckeditor/images/buttons/rightJustify.png new file mode 100644 index 0000000000000000000000000000000000000000..19871825e699488369fb1db41bdd0f2f0f2600e2 GIT binary patch literal 1128 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDu0r;B4q q#hl~>1tFVerazl@gz~5ve_&wfJ#YF_KC8SCq|ejU&t;ucLK6U#v2PCm literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/save.png b/docroot/sites/all/modules/ckeditor/images/buttons/save.png new file mode 100644 index 0000000000000000000000000000000000000000..753415b278136a200517174f3895b699072b7c37 GIT binary patch literal 1197 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBW!r;B4q z#hlhYL#_h`91NfT2fBEuDHgsA)7ZB@ODHJFD}T51#VP+5vNBYx2x4n8mT{bTz2%MY z{lxglF9ECn3dp4&jhU-s!8CE(u{mdzC$Oj438p!i?iX=uP=Cp0Q(1AdP+T$)WVxrS KpUXO@geCxe&y1Y_ literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/selectAll.png b/docroot/sites/all/modules/ckeditor/images/buttons/selectAll.png new file mode 100644 index 0000000000000000000000000000000000000000..ed9665a54fc45111e194047476c130adc83a88eb GIT binary patch literal 1165 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtgr;B4q z#hl~>3ma}pon!{CHL=`J86^W6mEEs7adaG5qikT%ozb{8;9t}nCYG}Y3fSAcFaF)c c!)hSF!rzopr0G!5rod5s; literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/selectionField.png b/docroot/sites/all/modules/ckeditor/images/buttons/selectionField.png new file mode 100644 index 0000000000000000000000000000000000000000..dd6715b0c9267ca69c618a2ce3fb91fdf9faa41d GIT binary patch literal 912 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTq8mPzH)5S5QV$RgF8+i{na5!JQ-FQ{7weVqJ z@kv*g3s0xNP+Tvu)B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBW!r;B4q z#hkgl8+i{HaIoC0XIvuQdpFQX!umB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBXJr;B4q z#hl!}jl2y8JS?$)+4SZpEe=pwbXGvJUC@R}JH>L2zyXDI8%oq8%`Vy-*u4_w+N__z z7ZbDbz(L){&{FoCR~lm5b}?kHHJ;KWU1+|$>x_QV^%;Ke72TEN6Ga}EExH!u^=XG< a{#TiZT;V`RxkvXvZt-;Wb6Mw<&;$S!oRRAQ literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/source.png b/docroot/sites/all/modules/ckeditor/images/buttons/source.png new file mode 100644 index 0000000000000000000000000000000000000000..1c550581ef3f54e199db4507f010a9b8716693d8 GIT binary patch literal 1171 zcmeAS@N?(olHy`uVBq!ia0vp^Za^%+!3-qlsQ-)sQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`6_P!Id>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC!N4G1FlSew4Fdx+ zLx4|+tEZ=@mzS5fx3_0*u2){3cYc0$U0n_k)z{}WH2mA{J$LThdGqGYpFe-Wf(3^T z9XfpY@aNB;zkdDt?c2BS-@pI(@#E*upTBVJQM+2uQ%pOzLof9h0;nuTmNZYZ<^A)hI>y< z*7_>j>o2aEb&PE}pGD;s8{hlS3ce`Yx!mWhc{}g8M@YxZj*IgYJd)KvZQaxG_=kJ; pEH&fo*0vcrNk^}*oqBHe2d2;Vp^{%W%oGE~oTsaw%Q~loCIHOB(B%LC literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/spacer.png b/docroot/sites/all/modules/ckeditor/images/buttons/spacer.png new file mode 100644 index 0000000000000000000000000000000000000000..cca2392ac0dafabb11fe1a91316463985fcadf11 GIT binary patch literal 1233 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~d!3-ofWcl9%QjEnx?oJHr&dIz4$)r2_Ix;Y9 z?C1WI$jZRL%n;xc;tCYcEa@w$?CEUooZQiI<^1_87cTt%^Y_o+zkmM$!GEBFQ7{?; z!!-n+IkN8u<`agJAiv=MBO5RTe`i+(#xrMuM`SSr1Gf+eGhVt|_Xj8_S>hT|5}cn_ zQl40p$`Fv4nOCCc=Nh6=W~^tbXJKyL5DQeK>FMGaA`zbaqn}OU-{wsl3^o}UZf-EV qUC*XhR#v80=EqmY@$Y=YI#!157Rv31qJAoYl9i{cpUXO@geCy=EKgB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtur;B4q z#hhNBoq`Ms9E*M5tN9&{E7Mu+@nK6~@PzLIKU-J5+s10f?|$%8aMhk)&OGNbE7`6# o85=Bq5Im{j68|Cw<|og(_!jbtM92ON?*Lij>FVdQ&MBb@015Yov;Y7A literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/strike.png b/docroot/sites/all/modules/ckeditor/images/buttons/strike.png new file mode 100644 index 0000000000000000000000000000000000000000..b295a96139d2cd67cf0dadfc9fccb1000889c803 GIT binary patch literal 1147 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtpr;B4q z#hl~>1)()Z)HeumD6lZkXgIMxr9r8KDTQGwqtGLR$s1-m)-y1q?vX!X5YVRzGRo7{ K&t;ucLK6TEw{-#l literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/styles.png b/docroot/sites/all/modules/ckeditor/images/buttons/styles.png new file mode 100644 index 0000000000000000000000000000000000000000..54e1f7b72ea502e1d807e642f0ee9b04e874cae4 GIT binary patch literal 3822 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000CTNkley}w0hLIpk_tx=Qhq^xY1K+7PdpJN z2oaSikp&3q^a0BVu#Fe5?ftlS`mheAY5HO%;ykUibEPxq&N*}O+OH|5DW%{1PH(YLoRHry;uJ6?hgfH;#4Xng%CHWD*zDDWv3Gk23l)i zwhV}f$N&tCB>1mSHQ_k9Tn+#v5q)tu3_}3WT3c%o@p?1NoLs`y$2XvhD3x+uM<@vl zU;z+;0RR|50Ca&z3W8v7Z|~*H zmx#Eru|Y%!2M7Ir|H+dlsZ^?7uSZeT>-Eaz^4{KFtyWuJUY?tq>-YO_-n@D6;KB6t z^eBuGr4WvGl-3um_OHMHHa0e9tc{~+ZEY=|%Z0`yBoUGL8XU(-rBZL-zCAuZe*XOV z+}zyk>}(i@zVC-&xWB(YHZ~T=ajVs`)~>Cs9UUF@dcDof&54N#&-08iJOZp0M6T-! zC8uX*W@cvEo|m1Pdi?X_yE8c-GBK;o-xF54+v2wYJe{ zEG{lK8jU2LcXxMv-`84et((o}ix)3Colc|C2*a>asf^%SBpP(PUaOU4ljG=}cYjPy zWsAjv2_pdTy1sDTQmGWj@jpJ(TJP-aoSdBG^Z9Hx+v#+g&F1*{c%e|(-rf#^pin5( z>-AhNr<8j3?AiVM_bZi3y3pApCL%F0T$T7C8EmGArW^YgCjR;$%Qp)eQ>mX?+P;Qai2VPRo$aq;!**GET3 zsZ^?5E}x#BuCK2@dh|#sg`)t7gcMQ=DWwvEEV3Yhq(~|ul_Wt|JfkSO?$E^GQc5C1 zM9=fyzkh%G_U+~6y`7?T9wNNWNEzu&vOBtgK;2nfg)kSqfc zQs=V6B#Omi9LN6(GGh!8B}trwuH!hxVlki38)K5VP0FN{Nlju{Ddos1hJY5Kb9qUC zKmg20$czBYz=YIlx3hQd42u&UUmq%FL?oi*Me+T%G!mVkpMCnXW{m|HuHnyv&49GB z@>7y-cyV!&$z(>><{Q4q20_4V5s-(f4<%DtD=7h>-EPao+L=ryx!;=tGrNw1hzxvP k;3RR4F`nn0pPl_Z09AotNq@KGQUCw|07*qoM6N<$f*`vswg3PC literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/subscript.png b/docroot/sites/all/modules/ckeditor/images/buttons/subscript.png new file mode 100644 index 0000000000000000000000000000000000000000..e60bf6cc527803c8fd2312c3d64a48bc8689ea27 GIT binary patch literal 1170 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt$r;B4q z#hhMWM?MAxjz;G*mpSI@Omgb!+nHd}RxvW);ZChfUDde_uwuI_5K07DNkdCFj ihf~*Qg|*NBUT@0i*T(hjx1aGPkPV)$elF{r5}E)zA%m^} literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/superscript.png b/docroot/sites/all/modules/ckeditor/images/buttons/superscript.png new file mode 100644 index 0000000000000000000000000000000000000000..b5ac6ee2d2749af6a8767b3e890be81efb0b911b GIT binary patch literal 1172 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt`r;B4q z#hj^qhFlB=9L&Z~{&&}(u+A1;a?8_E@u3BanDV5xA3S(9xbA9e&UBIN4zid$(?rDh l&o|oz^FEp>9@&!fjA6PTcWWZ^w}&7*JYD@<);T3K0RWyVf(-xw literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/table.png b/docroot/sites/all/modules/ckeditor/images/buttons/table.png new file mode 100644 index 0000000000000000000000000000000000000000..d86417d64ba790b019c14725557c1fe7cfc5a7f9 GIT binary patch literal 1182 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDt?r;B4q z#hl~>1s=ZUgGL$*oIZ|Brypn~WH~TxPCFaLd*rgbUCjwA$<+r+SQ=K(;Gg1pu}NtI uPwZ)<6^$IC5=?767<4w|+)QCP@I{-Ud0uX6vYc=M$Tm+`KbLh*2~7ZO)q_j` literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/templates.png b/docroot/sites/all/modules/ckeditor/images/buttons/templates.png new file mode 100644 index 0000000000000000000000000000000000000000..c208cd2d6f49e5fb7c6b11b86d2e80aa2317eed7 GIT binary patch literal 1165 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDtgr;B4q z#hm1X11$N932FiktZ4@sViGPcikz(O?zopr0M8zL6aWAK literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/textColor.png b/docroot/sites/all/modules/ckeditor/images/buttons/textColor.png new file mode 100644 index 0000000000000000000000000000000000000000..006ed6422337abae57854edf357ed683cac0609c GIT binary patch literal 1201 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBWqr;B4q z#hl~>1umV44GeSpwV0mB#Wx%>PrYE`Dim1|GdZ#IS)mGJu)@Nf44%iEB+kxwyldAk zp0uB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBW!r;B4q z#hl~>2lmSX30xcoKC^q7mNBxXDKeKZs)%lG{m8*_cHUaMY_kb1t2YG9-B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTq8mOn-)5S5QVovPYje>_2cpL(6ZTZA7rNEu- z#JrDzFS41QeRP=UU)>N`b+uhA=CYaQdB@nKuN0e41#DC67R&!wYXHI*Nqex@)x ze!FVdQ&MBb@0Bmrtz5oCK literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/underline.png b/docroot/sites/all/modules/ckeditor/images/buttons/underline.png new file mode 100644 index 0000000000000000000000000000000000000000..52b93cef0f0047fb8d7aabe87c8270a9a5649293 GIT binary patch literal 1143 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDttr;B4q z#hl~>1@3~_eLXH0BOVwnV-TO@?7(oYz4JlYuT+ZzY77j2g-uI;i9V798RO~d=d#Wz Gp$PzuDt0&k literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/images/buttons/undo.png b/docroot/sites/all/modules/ckeditor/images/buttons/undo.png new file mode 100644 index 0000000000000000000000000000000000000000..90587f86070afd43ab36b656daabb50268d90796 GIT binary patch literal 1173 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcDter;B4q z#hkUh2RRuOc$jzpH<#JrX#VmxZ;Wfmk}ul#^f_bB)ID7LY+=-n5aSEhpY9xWN)c8J miB|mLR^7dIcMkp{~4HlkBi#b z&6qLc`$TPK1B2igO9bZfa;R3<+PUZoKZ} z#^9+N{`~p#Kb`UI_2@TKRIXSt$~ZZl4rQA<y?RIF;}Fac*_jqk`7fA1BKE zXJD9k<=ux5pDyj3FJbTS=l_5ILN*qOw)Zbi9BM4MmBG7s$&&AJ+FdFP{;9_w9X}*y zXD5;Q?)>v-yG~aK`JLDE@(OvEaHmY-Lsz(ekn`^K74oTfc7?mVdi9pq_4N1e-}m3X zxqQW%10EI(#%KQhW%~1n`9-?~o5k^62kr*GiJP$F%cBRcSdEPS|6_c9^NOjjPe(_` zkKezHeS8=dV_ohBe|pFB?Af!sH-uKNS@Z87)Az5>D=NxQ&u;kEFJ|cFuj%3XZIPL* zqx-W*!iGK`iY_iiMMbk_&8k|PE@|iYQm%YjK}Ka;Be z+O-Sq0sS`H`jaP3x`|sa3;pkh^Qd3)dCNepl z`#DFM+5JLhQO&g_5idVJR&jM__qqD@>sLMRE+MzQTs{{kOqnTUV`EnF+-$;j@!&Jh zUOs&G_RspYt5>X8v1-*CU}7c}?AgTqnt_3lp(MyJm;o4kBM4vw)j?H%TcBXEr;B4q z#hl#UgPaEpc$j(XPE1(&>pb7z@%filename or %file.', array('%filename' => $ckconfig_file, '%file' => 'sites/all/libraries/ckeditor/ckeditor.js'))); + drupal_set_message(t('The CKEditor component is not installed correctly. Please go to the !ckeditorlink in order to download the latest version. After that you must extract the files to the %ckeditorpath or %librarypath directory and make sure that the %ckeditorfile or %ckeditorlibrary file exists. Refer to the !readme file for more information.', array('!ckeditorlink' => l(t('CKEditor homepage'), 'http://ckeditor.com/download'), '!readme' => l(t('README.txt'), $base_url . '/' . drupal_get_path('module', 'ckeditor') . '/README.txt', array('absolute' => TRUE)), '%ckeditorpath' => 'sites/all/modules/ckeditor/ckeditor', '%ckeditorsubdir' => $editor_path . '/editor', '%ckeditorfile' => 'sites/all/modules/ckeditor/ckeditor/ckeditor.js', '%ckeditorlibrary' => 'sites/all/libraries/ckeditor/ckeditor.js', '%librarypath' => 'sites/all/libraries/ckeditor')), 'error'); + drupal_set_message(t('If you have CKEditor already installed, edit the !editg and update the CKEditor path.', array('!editg' => l(t('CKEditor Global Profile'), 'admin/config/content/ckeditor/editg'))), 'warning'); + return ''; + } + + if (module_exists('wysiwyg')) { + drupal_set_message(t('The WYSIWYG module was detected. Using both modules at the same time may cause problems. It is recommended to turn the WYSIWYG module off (@wysiwygdisablelink).', array('@wysiwygdisablelink' => l(t('click here to disable'), 'ckeditor/disable/wysiwyg'))), 'warning'); + } + + //find profile other than Global + $result = db_select('ckeditor_settings', 's')->fields('s', array('name'))->condition('name', 'CKEditor Global Profile', '<>')->range(0, 1)->execute()->fetchAssoc(); + if (!$result) { + drupal_set_message(t('No CKEditor profiles found. Right now nobody is able to use CKEditor. Create a new profile below.'), 'error'); + } + + return ckeditor_profile_overview(); +} + +/** + * Controller for CKEditor profiles. + */ +function ckeditor_profile_overview() { + $output = ''; + $profiles = ckeditor_profile_load(); + if ($profiles) { + $access_ckeditor_roles = user_roles(FALSE, 'access ckeditor'); + $header = array(t('Profile'), t('Input format'), t('Operations')); + foreach ($profiles as $p) { + if ($p->name !== "CKEditor Global Profile") { + $rows[] = array( + array('data' => $p->name, 'valign' => 'top'), + array('data' => implode("
      \n", $p->input_formats)), + array('data' => + l(t('edit'), 'admin/config/content/ckeditor/edit/' . urlencode($p->name)) . ' ' . + l(t('clone'), 'admin/config/content/ckeditor/clone/' . urlencode($p->name)) . ' ' . + l(t('delete'), 'admin/config/content/ckeditor/delete/' . urlencode($p->name)), 'valign' => 'top' + ) + ); + } + } + $output .= '

      ' . t('Profiles') . '

      '; + $output .= theme('table', array("header" => $header, "rows" => $rows)); + $output .= '

      ' . l(t('Create a new profile'), 'admin/config/content/ckeditor/add') . '

      '; + } + else { + drupal_set_message(t('No profiles found. Click here to %create.', array('%create' => l(t('create a new profile'), url('admin/config/content/ckeditor/add'))))); + } + + $rows = array(); + if (!isset($profiles['CKEditor Global Profile'])) { + drupal_set_message(t('The global profile can not be found. Click here to %create.', array('%create' => l(t('create the global profile'), url('admin/config/content/ckeditor/addg'))))); + } + else { + $output .= "

      " . t("Global settings") . "

      "; + $rows[] = array( + array('data' => t('CKEditor Global Profile')), + array('data' => l(t('edit'), 'admin/config/content/ckeditor/editg'), 'valign' => 'top') + ); + $output .= theme('table', array("header" => array(t('Profile'), t('Operations')), "rows" => $rows)); + } + return $output; +} + +/** + * Form builder for a global profile + */ +function ckeditor_admin_global_profile_form($form, $form_state, $mode = 'add') { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + if ($mode == 'edit') { + $profile = ckeditor_profile_load('CKEditor Global Profile'); + + $form['_profile'] = array( + '#type' => 'value', + '#value' => $profile, + ); + } + else { + $profile = new stdClass(); + } + + if ($mode == 'add') { + $data = ckeditor_profile_load('CKEditor Global Profile'); + if (!empty($data)) { + drupal_set_message(t('The global profile already exists. Only one global profile is allowed.'), 'error'); + drupal_not_found(); + } + + $btn = t('Create a global profile'); + } + else { + $btn = t('Update the global profile'); + } + + $orig_formats = filter_formats(); + $formats = array(); + foreach ($orig_formats AS $format) { + $formats[$format->format] = $format->name; + } + + $form['ckeditor_advanced_settings'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced settings'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + + $module_drupal_path = drupal_get_path('module', 'ckeditor'); + + $form['ckeditor_advanced_settings']['ckeditor_path'] = array( + '#type' => 'textfield', + '#title' => t('Path to CKEditor'), + '#default_value' => !empty($profile->settings['ckeditor_path']) ? $profile->settings['ckeditor_path'] : '%m/ckeditor', + '#size' => 40, + '#maxlength' => 128, + '#description' => t('The path to CKEditor (the WYSIWYG rich text editor downloaded from ckeditor.com) relative to the document root.') . + '
      ' . + t('Available placeholders:!m – path where the CKEditor module is stored (!files).!l – path to the libraries directory (sites/all/libraries)
      Current path: !path', + array( + '!m' => '
      %m', + '!l' => '
      %l', + '!path' => ckeditor_path(FALSE), + '!files' => $module_drupal_path, + '!ckeditorcom' => 'http://ckeditor.com/download' + ) + ), + '#required' => TRUE + ); + + $form['ckeditor_advanced_settings']['ckeditor_local_path'] = array( + '#type' => 'textfield', + '#title' => t('Local path to CKEditor'), + '#default_value' => isset($profile->settings['ckeditor_local_path']) ? $profile->settings['ckeditor_local_path'] : '', + '#size' => 40, + '#maxlength' => 128, + '#description' => t('The path to the local directory (on the server) that points to the path defined above. Enter either an absolute server path or a path relative to the index.php file. If left empty, the CKEditor module will try to find the right path.
      Current path: !path', array('!path' => ckeditor_path(TRUE))), + ); + + $form['ckeditor_advanced_settings']['ckeditor_plugins_path'] = array( + '#type' => 'textfield', + '#title' => t('Path to the CKEditor plugins directory'), + '#default_value' => !empty($profile->settings['ckeditor_plugins_path']) ? $profile->settings['ckeditor_plugins_path'] : '%m/plugins', + '#size' => 40, + '#maxlength' => 128, + '#description' => t('Path to the CKEditor plugins directory relative to the document root.') . + '
      ' . + t('Available placeholders:!m – the base URL path where the CKEditor module is stored (!files).!l – the base URL path to the libraries directory (!library).
      Current path: !path', array( + '!m' => '
      %m', + '!l' => '
      %l', + '!path' => ckeditor_plugins_path(), + '!files' => $module_drupal_path, + '!library' => 'sites/all/libraries/' + )) + ); + + $form['ckeditor_advanced_settings']['ckeditor_plugins_local_path'] = array( + '#type' => 'textfield', + '#title' => t('Local path to the CKEditor plugins directory'), + '#default_value' => isset($profile->settings['ckeditor_plugins_local_path']) ? $profile->settings['ckeditor_plugins_local_path'] : '', + '#size' => 40, + '#maxlength' => 128, + '#description' => t('The path to the local directory (on the server) that points to the path defined above. Enter either an absolute server path or a path relative to the index.php file. If left empty, the CKEditor module will try to find the right path.
      Current path: !path', array('!path' => ckeditor_plugins_path(TRUE))), + ); + + //@todo DOWNLOAD API + if (variable_get('file_default_scheme', '') == 'private') + { + $form['ckeditor_advanced_settings']['ckeditor_allow_download_private_files'] = array( + '#type' => 'checkbox', + '#title' => t('Enable access to files located in the private folder'), + '#default_value' => !empty($profile->settings['ckeditor_allow_download_private_files']), + '#return_value' => 't', + '#description' => t('Use this option with care. If checked, CKEditor will allow anyone knowing the URL to view a file, if it located inside of the private path ('.variable_get('file_private_path' , '').') and if there is no information about the file in the Drupal database.'), + '#required' => FALSE + ); + $current_private_dir = !empty($profile->settings['private_dir']) ? $profile->settings['private_dir'] : ''; + $form['ckeditor_advanced_settings']['private_dir'] = array( + '#type' => 'textfield', + '#title' => t('Location of files uploaded with CKEditor to the private folder'), + '#default_value' => !empty($profile->settings['private_dir']) ? $profile->settings['private_dir'] : '', + '#size' => 40, + '#maxlength' => 255, + '#description' => t('The path relative to the location of the private directory where CKEditor should store uploaded files.') . '
      ' . t('Available wildcard characters:') . '
      %u – ' . t('User ID') . '
      %n – ' . t('Username') . '
      ' . t('System path to the private folder is: !system_path.', array('!system_path' => realpath(variable_get('file_private_path', conf_path() . '/files')) . DIRECTORY_SEPARATOR)) . '
      ' . t('Warning: CKEditor does not implement any kind of access protection for files available in this location. All files stored in the directory defined above might be accessible to unauthenticated users if there is no information about the file in the Drupal\'s database.'), + ); + } + + if (function_exists('linktocontent_node_menu') && function_exists('pathfilter_filter')) { + $form['ckeditor_advanced_settings']['linktoc'] = array( + '#type' => 'select', + '#options' => array('p' => t('Link to paths only'), 'n' => t('Link using internal: links'), 'pn' => t('Allow the user to select between paths and internal links')), + '#title' => t('Path Filter & Link To Content integration'), + '#default_value' => empty($profile->settings['linktoc']) ? 'p' : $profile->settings['linktoc'], + '#description' => t('With the !plink extension it is possible to use internal: links. By default the !link extension is linking to nodes using paths.', array('!plink' => l(t('Path Filter'), 'http://drupal.org/project/pathfilter'), '!link' => l(t('Link To Content'), 'http://drupal.org/project/linktocontent'))), + ); + } + + $form['submit'] = array( + '#type' => 'submit', + '#value' => $btn + ); + + return $form; +} + +/** + * Form validation for a global profile + */ +function ckeditor_admin_global_profile_form_validate($form, &$form_state) { + +} + +/** + * Submit form for a global profile + */ +function ckeditor_admin_global_profile_form_submit($form, &$form_state) { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + $edit = & $form_state['values']; + $edit['name'] = 'CKEditor Global Profile'; + + if (isset($edit['_profile'])) { + ckeditor_profile_delete($edit['_profile']->name); + } + + //strip whitespaces + if (empty($edit['ckeditor_local_path'])) { + $edit['ckeditor_local_path'] = ''; + } + else { + $edit['ckeditor_local_path'] = trim($edit['ckeditor_local_path']); + } + + //strip slash from the end + if (empty($edit['ckeditor_path'])) { + $edit['ckeditor_path'] = ''; + } + $edit['ckeditor_path'] = trim(rtrim($edit['ckeditor_path'], "/")); + if ($edit['ckeditor_path'] && 0 !== strpos($edit['ckeditor_path'], "/") && 0 !== strpos($edit['ckeditor_path'], "%")) { + //ensure that slash is at the beginning + $edit['ckeditor_path'] = "/" . $edit['ckeditor_path']; + } + //no slash at the end + $edit['ckeditor_local_path'] = trim(rtrim($edit['ckeditor_local_path'], "/")); + + //strip whitespaces + if (empty($edit['ckeditor_plugins_local_path'])) { + $edit['ckeditor_plugins_local_path'] = ''; + } + else { + $edit['ckeditor_plugins_local_path'] = trim($edit['ckeditor_plugins_local_path']); + } + + //strip slash from the end + if (empty($edit['ckeditor_plugins_path'])) { + $edit['ckeditor_plugins_path'] = ''; + } + $edit['ckeditor_plugins_path'] = trim(rtrim($edit['ckeditor_plugins_path'], "/")); + if ($edit['ckeditor_plugins_path'] && 0 !== strpos($edit['ckeditor_plugins_path'], "/") && 0 !== strpos($edit['ckeditor_plugins_path'], "%")) { + //ensure that slash is at the beginning + $edit['ckeditor_plugins_path'] = "/" . $edit['ckeditor_plugins_path']; + } + //no slash at the end + $edit['ckeditor_plugins_path'] = trim(rtrim($edit['ckeditor_plugins_path'], "/")); + + $settings = ckeditor_admin_values_to_settings($edit); + db_insert('ckeditor_settings') + ->fields(array( + "name" => $edit["name"], + "settings" => $settings + )) + ->execute(); + + drupal_set_message(t('The CKEditor global profile was saved.')); + $form_state['redirect'] = 'admin/config/content/ckeditor'; +} + +/** + * Form builder for a profile + */ +function ckeditor_admin_profile_form($form, $form_state, $profile = NULL) { + global $theme; + + if ($profile != NULL) { + $form['_profile'] = array( + '#type' => 'value', + '#value' => $profile, + ); + } + else { + $profile = new stdClass(); + } + + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + + $skin_options = ckeditor_load_skin_options(); + $lang_options = ckeditor_load_lang_options(); + + $form['basic'] = array( + '#type' => 'fieldset', + '#title' => t('Basic setup'), + '#collapsible' => TRUE, + '#collapsed' => TRUE + ); + + switch (arg(4)) { + case 'clone': + //load all profiles to check their names + $profiles = ckeditor_profile_load(); + $oldname = $profile->name; + $maxsize = 128; //default max name length + + $res = array(); + $pat = "/^(.*?)_([0-9]+)$/"; + if (preg_match($pat, $oldname, $res)) { // oldname like 'name_nr' + $name = $res[1]; + $num = $res[2] + 1; + } + else { + $name = $oldname; + $num = 2; + } + + $newname = substr($name, 0, $maxsize - 3) . '_' . $num; // +limit + while (isset($profiles[$newname])) { //find next free number + $num++; + $newname = substr($name, 0, $maxsize - 3) . '_' . $num; + } + break; + case 'edit': + $newname = $profile->name; + break; + } + + $form['basic']['name'] = array( + '#type' => 'textfield', + '#title' => t('Profile name'), + '#default_value' => !empty($profile->name) ? $newname : '', + '#size' => 40, + '#maxlength' => 128, + '#description' => t('Enter a name for this profile. This name is only visible within the CKEditor administration page.'), + '#required' => TRUE + ); + + $orig_formats = filter_formats(); + + if (arg(4) == 'edit' && !empty($profile->name)) { + $used_formats = db_select('ckeditor_input_format', 'f')->fields('f', array("format"))->distinct()->condition("f.name", array($profile->name), 'NOT IN')->execute()->fetchAllAssoc('format'); + } + else { + $profile->input_formats = array(); + $used_formats = db_select('ckeditor_input_format', 'f')->fields('f', array("format"))->distinct()->execute()->fetchAllAssoc('format'); + } + + $formats = array(); + foreach ($orig_formats AS $format) { + if ( (arg(4) == 'edit' && !empty($profile->input_formats) && array_key_exists($format->format, $profile->input_formats)) || !array_key_exists($format->format, $used_formats) ) { + $formats[$format->format] = $format->name; + } + } + + $form['basic']['input_formats'] = array( + '#type' => 'checkboxes', + '#title' => t('Input formats'), + '#default_value' => !empty($profile->input_formats) ? array_keys((array) $profile->input_formats) : array(), + '#options' => $formats, + '#description' => t('Choose the input formats where you want to load CKEditor.') + ); + + $form['security'] = array( + '#type' => 'fieldset', + '#title' => t('Security'), + '#description' => '

      ' . t('The CKEditor security system protects you from executing malicious code that is already in your database. In plain textareas database content is harmless because it is not executed, but the CKEditor WYSIWYG editor interprets HTML like a web browser and thus the content needs to be filtered before it is loaded.') . '

      ', + '#collapsible' => TRUE, + '#collapsed' => TRUE + ); + + $form['security']['filters'] = array( + '#type' => 'fieldset', + '#title' => t('Security filters'), + '#description' => t('Please choose all filters that protect your content (probably not all filters listed below are security filters).'), + '#tree' => TRUE, + ); + + $all_filters = filter_get_filters(); + + if (!isset($profile->settings['ss'])) { + $profile->settings['filters']['filter/0'] = 1; + } + + if (array_key_exists('filter_htmlcorrector', $all_filters)) { + $form['security']['filters']['filter_htmlcorrector'] = array( + '#type' => 'checkbox', + '#title' => t("@data", array('@data' => $all_filters['filter_htmlcorrector']['title'])), + '#default_value' => !empty($profile->settings['filters']['filter_htmlcorrector']), + '#description' => t("@data", array('@data' => $all_filters['filter_htmlcorrector']['description'])), + ); + } + + if (array_key_exists('filter_html', $all_filters)) { + $form['security']['filters']['filter_html'] = array( + '#type' => 'checkbox', + '#title' => t("@data", array('@data' => $all_filters['filter_html']['title'])), + '#default_value' => !empty($profile->settings['filters']['filter_html']), + '#description' => t("@data", array('@data' => $all_filters['filter_html']['description'])), + ); + } + + $form['security']['textformat_filters'] = array( + '#type' => 'radios', + '#title' => t('Use Drupal text format filters'), + '#default_value' => !empty($profile->settings['textformat_filters']) ? $profile->settings['textformat_filters'] : 't', + '#options' => array( + 't' => t('Enabled'), + 'f' => t('Disabled') + ), + '#description' => t('If this option is selected (enabled), the content displayed in the editor when you are editing the page will be filtered through the filters associated with a given "text format". When this option is disabled, the editor will show the full unfiltered page content.'), + ); + + $form['security']['ss'] = array( + '#type' => 'radios', + '#title' => t('Security settings'), + '#default_value' => isset($profile->settings['ss']) ? $profile->settings['ss'] : '2', + '#options' => array( + '2' => t('Always run security filters for CKEditor.'), + '1' => t('Run security filters only when CKEditor is set to start automatically.'), + ), + //'#description' => t('There are two ways of starting CKEditor: automatically and manually (via toggle or in a popup). If you decide to apply security filters only when CKEditor starts automatically, you will not be protected when toggling manually from a plain textarea to CKEditor or when using CKEditor in a popup mode. Choose this option only if you can detect various attacks (mainly XSS) by yourself just by looking at the HTML code.'), + '#description' => t('There are two ways of starting CKEditor: automatically and manually (via toggle). If you decide to apply security filters only when CKEditor starts automatically, you will not be protected when toggling manually from plain textarea to CKEditor. Choose this option only if you can detect various attacks (mainly XSS) by yourself just by looking at the HTML code.'), + ); + + $form['appearance'] = array( + '#type' => 'fieldset', + '#title' => t('Editor appearance'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['appearance']['default'] = array( + '#type' => 'radios', + '#title' => t('Default state'), + '#default_value' => !empty($profile->settings['default']) ? $profile->settings['default'] : 't', + '#options' => array( + 't' => t('Enabled'), + 'f' => t('Disabled') + ), + //'#description' => t('Default editor state. If disabled, the rich text editor may still be enabled by using toggle or popup window.'), + '#description' => t('Default editor state. If disabled, the rich text editor may still be enabled by using toggle.'), + ); + + $form['appearance']['show_toggle'] = array( + '#type' => 'radios', + '#title' => t('Show the disable/enable rich text editor toggle'), + '#default_value' => !empty($profile->settings['show_toggle']) ? $profile->settings['show_toggle'] : 't', + '#options' => array( + 't' => t('Show'), + 'f' => t('Hide') + ), + //'#description' => t('Whether or not to show the disable/enable rich text editor toggle below the textarea. Works only if CKEditor is not running in a popup window (see below).'), + '#description' => t('Whether or not to show the disable/enable rich text editor toggle below the textarea.'), + ); + /* + $form['appearance']['popup'] = array( + '#type' => 'radios', + '#title' => t('Use CKEditor in a popup window'), + '#default_value' => !empty($profile->settings['popup']) ? $profile->settings['popup'] : 'f', + '#options' => array( + 'f' => t('No'), + 't' => t('Yes') + ), + '#description' => t('If this option is enabled, a link to a popup window will be used instead of a textarea replace.'), + ); + */ + $form['appearance']['skin'] = array( + '#type' => 'select', + '#title' => t('Skin'), + '#default_value' => !empty($profile->settings['skin']) ? $profile->settings['skin'] : 'kama', + '#options' => $skin_options, + '#description' => t('Choose a CKEditor skin.'), + ); + + $ui_colors = array( + "default" => t('CKEditor default'), + "custom" => t('Select manually') + ); + if (function_exists('color_get_palette')) { + // apparently $theme is not initialized (?) + if (empty($theme)) { + init_theme(); + } + $palette = @color_get_palette($theme, FALSE); //[#652274] + $color_palette['default'] = '#D3D3D3'; + if (!empty($palette)) { + if (!empty($palette['base'])) { + $color_palette['color_base'] = $palette['base']; + $ui_colors["color_base"] = t('Color module: base'); + } + if (!empty($palette['top'])) { + $color_palette['color_top'] = $palette['top']; + $ui_colors["color_top"] = t('Color module: top'); + } + if (!empty($palette['bottom'])) { + $color_palette['color_bottom'] = $palette['bottom']; + $ui_colors["color_bottom"] = t('Color module: bottom'); + } + } + drupal_add_js(array('ckeditor_uicolor' => $color_palette), 'setting'); + } + + $editor_path = ckeditor_path(FALSE); + $module_drupal_path = drupal_get_path('module', 'ckeditor'); + drupal_add_js('window.CKEDITOR_BASEPATH = "' . base_path() . $editor_path . '/"', array('type' => 'inline', 'weight' => -100)); + drupal_add_js($editor_path . '/ckeditor.js', array('type' => 'file', 'preprocess' => FALSE)); + drupal_add_js($module_drupal_path . '/ckeditor.config.js', 'file'); + drupal_add_js($module_drupal_path . '/includes/ckeditor.admin.js', 'file'); + if (module_exists('jquery_ui')){ + jquery_ui_add(array('jquery.ui.widget.js', 'jquery.ui.sortable.js')); + } + else { + drupal_add_js($module_drupal_path . '/includes/jqueryUI/jquery-ui.js', 'file'); + drupal_add_js($module_drupal_path . '/includes/jqueryUI/jquery.ui.widget.js', 'file'); + drupal_add_js($module_drupal_path . '/includes/jqueryUI/jquery.ui.sortable.js', 'file'); + } + drupal_add_js($module_drupal_path . '/includes/jqueryUI/sort.js', 'file'); + + $form['appearance']['uicolor'] = array( + '#type' => 'select', + '#title' => t('User interface color'), + '#default_value' => !empty($profile->settings['uicolor']) ? $profile->settings['uicolor'] : 'default', + '#options' => $ui_colors, + '#description' => t('Works only with the "!skin" skin.', + array( + '!skin' => 'Kama' + )), + ); + $form['appearance']['uicolor_textarea'] = array( + '#type' => 'textarea', + '#title' => '', + '#default_value' => 'Click the UI Color Picker button to set your color preferences.', + '#attributes' => array('style' => 'display:none', 'class' => array('ckeditor_ui_demo')), + '#resizable' => FALSE, + '#wysiwyg' => FALSE + ); + $form['appearance']['uicolor_user'] = array( + '#type' => 'hidden', + '#default_value' => !empty($profile->settings['uicolor_user']) ? $profile->settings['uicolor_user'] : 'default', + ); + + $form['appearance']['toolbar'] = array( + '#type' => 'textarea', + '#title' => t('Toolbar'), + '#default_value' => !empty($profile->settings['toolbar']) ? $profile->settings['toolbar'] : '', + '#description' => t('Load sample toolbar: Basic | Advanced | Full'), + '#wysiwyg' => FALSE, + '#rows' => 15 + ); + + $form['appearance']['toolbar_wizzard_used'] = array( + '#markup' => '
      ' . t('Used buttons') . '

      ', + '#description' => t('Currently used buttons'), + ); + + drupal_add_js(array('cke_toolbar_buttons_all' => ckeditor_toolbar_buttons_all()), 'setting'); + + $form['appearance']['toolbar_wizzard_all'] = array( + '#markup' => '
      ' . t('All buttons') . '

      ', + '#description' => t('All available buttons'), + ); + + $plugin_list = ckeditor_load_plugins(); + $plugins = array(); + if (isset($profile->settings['loadPlugins'])) { + foreach ($plugin_list AS $key => $val) { + $plugins[$key] = $val['desc']; + } + } + else { + $default_plugins = array(); + foreach ($plugin_list AS $key => $val) { + $plugins[$key] = $val['desc']; + if (isset($val['default']) && $val['default'] == 't') { + $default_plugins[] = $key; + } + } + } + + $form['appearance']['loadPlugins'] = array( + '#type' => 'checkboxes', + '#title' => t('Plugins'), + '#default_value' => isset($profile->settings['loadPlugins']) ? array_keys((array) $profile->settings['loadPlugins']) : $default_plugins, + '#options' => $plugins, + '#description' => t('Choose the plugins that you want to enable in CKEditor.') + ); + + $form['appearance']['expand'] = array( + '#type' => 'radios', + '#title' => t('Toolbar state on startup'), + '#default_value' => !empty($profile->settings['expand']) ? $profile->settings['expand'] : 't', + '#options' => array( + 't' => t('Expanded'), + 'f' => t('Collapsed') + ), + '#description' => t('The toolbar will start in an expanded or collapsed state.'), + ); + + $form['appearance']['width'] = array( + '#type' => 'textfield', + '#title' => t('Editor width'), + '#default_value' => !empty($profile->settings['width']) ? $profile->settings['width'] : '100%', + '#description' => t("Editor interface width in pixels or percent. Examples: 400, 100%."), + '#size' => 40, + '#maxlength' => 128, + ); + + $form['appearance']['lang'] = array( + '#type' => 'select', + '#title' => t('Language'), + '#default_value' => !empty($profile->settings['lang']) ? $profile->settings['lang'] : 'en', + '#options' => $lang_options, + '#description' => t('The language for the CKEditor user interface.') + ); + + $form['appearance']['auto_lang'] = array( + '#type' => 'radios', + '#title' => t('Auto-detect language'), + '#default_value' => !empty($profile->settings['auto_lang']) ? $profile->settings['auto_lang'] : 't', + '#options' => array( + 't' => t('Enabled'), + 'f' => t('Disabled') + ), + '#description' => t('Automatically detect the user language.') + ); + + $form['appearance']['language_direction'] = array( + '#type' => 'select', + '#title' => t('Language direction'), + '#default_value' => !empty($profile->settings['language_direction']) ? $profile->settings['language_direction'] : 'default', + '#options' => array( + 'default' => t('Get from current locale (default)'), + 'ltr' => t('Left-To-Right'), // language like English + 'rtl' => t('Right-To-Left') // languages like Arabic + ), + '#description' => t('Choose the language direction used in the editing area. Even when CKEditor automatically detects the user language and adjusts its user interface, the editing area is not automatically changed into the LTR or RTL mode. To be able to type LTR (like English) and RTL (like Arabic, Hebrew, Persian) content at the same time, please make sure that the BidiLtr and BidiRtl buttons are enabled in the toolbar.') + ); + + $form['output'] = array( + '#type' => 'fieldset', + '#title' => t('Cleanup and output'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['output']['enter_mode'] = array( + '#type' => 'select', + '#title' => t('Enter mode'), + '#default_value' => !empty($profile->settings['enter_mode']) ? $profile->settings['enter_mode'] : 'p', + '#options' => array( + 'p' => '

      ', + 'br' => '
      ', + 'div' => '

      ' + ), + '#description' => t('Set which tag should be used by CKEditor when the Enter key is pressed.') + ); + + $form['output']['shift_enter_mode'] = array( + '#type' => 'select', + '#title' => t('Shift+Enter mode'), + '#default_value' => !empty($profile->settings['shift_enter_mode']) ? $profile->settings['shift_enter_mode'] : 'br', + '#options' => array( + 'p' => '

      ', + 'br' => '
      ', + 'div' => '

      ' + ), + '#description' => t('Set which tag should be used by CKEditor when the Shift+Enter key combination is pressed.') + ); + + $form['output']['font_format'] = array( + '#type' => 'textfield', + '#title' => t('Font formats'), + '#default_value' => !empty($profile->settings['font_format']) ? $profile->settings['font_format'] : 'p;div;pre;address;h1;h2;h3;h4;h5;h6', + '#size' => 40, + '#maxlength' => 250, + '#description' => t('Semicolon-separated list of HTML font formats. Allowed values are: p;div;pre;address;h1;h2;h3;h4;h5;h6'), + ); + + if (!empty($profile->settings['formatting']['custom_formatting_options'])) { + foreach ($profile->settings['formatting']['custom_formatting_options'] as $k => $v) { + if ($v === 0) { + unset($profile->settings['formatting']['custom_formatting_options'][$k]); + } + } + } + + $form['output']['custom_formatting'] = array( + '#type' => 'radios', + '#title' => t('Use custom formatting options'), + '#default_value' => !empty($profile->settings['custom_formatting']) ? $profile->settings['custom_formatting'] : 'f', + '#options' => array( + 't' => t('Yes'), + 'f' => t('No'), + ), + ); + + $form['output']['formatting'] = array( + '#type' => 'fieldset', + '#title' => t('Custom formatting options'), + '#tree' => TRUE, + ); + + $form['output']['formatting']['custom_formatting_options'] = array( + '#type' => 'checkboxes', + '#default_value' => isset($profile->settings['formatting']['custom_formatting_options']) ? array_keys((array) $profile->settings['formatting']['custom_formatting_options']) : array('indent' => 'indent', 'breakBeforeOpen' => 'breakBeforeOpen', 'breakAfterOpen' => 'breakAfterOpen', 'breakAfterClose' => 'breakAfterClose'), + '#options' => array( + 'indent' => t('Indent the element contents.'), + 'breakBeforeOpen' => t('Break line before the opening tag.'), + 'breakAfterOpen' => t('Break line after the opening tag.'), + 'breakBeforeClose' => t('Break line before the closing tag.'), + 'breakAfterClose' => t('Break line after the closing tag.'), + 'pre_indent' => t('Indent the <pre> element contents.'), + ), + ); + + $form['css'] = array( + '#type' => 'fieldset', + '#title' => t('CSS'), + '#collapsible' => TRUE, + '#collapsed' => TRUE + ); + + $form['css']['css_mode'] = array( + '#type' => 'select', + '#title' => t('Editor CSS'), + '#default_value' => !empty($profile->settings['css_mode']) ? $profile->settings['css_mode'] : 'theme', + '#options' => array( + 'theme' => t('Use theme CSS'), + 'self' => t('Define CSS'), + 'none' => t('CKEditor default') + ), + '#description' => t('Defines the CSS to be used in the editor area.
      Use theme CSS – load the style.css file from the current site theme.
      Define CSS – enter the CSS file path below.
      CKEditor default – use the default editor CSS.') + ); + + $form['css']['css_path'] = array( + '#type' => 'textfield', + '#title' => t('CSS file path'), + '#default_value' => !empty($profile->settings['css_path']) ? $profile->settings['css_path'] : "", + '#size' => 40, + '#maxlength' => 255, + '#description' => t('Enter the path to the CSS file (Example: !example1) or a list of CSS files separated with a comma (Example: !example2). Make sure you select the Define CSS option above.', + array( + '!example1' => '"css/editor.css"', + '!example2' => '"/themes/garland/style.css,http://example.com/style.css"', + )) . + '
      ' . + t('Available placeholders:!h – host name (!host).!t – path to theme (!theme).', + array( + '!h' => '
      %h', + '!t' => '
      %t', + '!host' => base_path(), + '!theme' => base_path() . path_to_theme() . '/' + )) + ); + + $form['css']['css_style'] = array( + '#type' => 'select', + '#title' => t('Predefined styles'), + '#default_value' => !empty($profile->settings['css_style']) ? $profile->settings['css_style'] : 'theme', + '#options' => array( + 'theme' => t('Use theme ckeditor.styles.js'), + 'self' => t('Define path to ckeditor.styles.js'), + 'default' => t('CKEditor default') + ), + '#description' => t('Define the location of the ckeditor.styles.js file. It is used by the Style drop-down list available in the default toolbar. Copy the !ckeditor.styles.js file into your theme directory (!theme) and adjust it to your needs.', array('!ckeditor.styles.js' => ckeditor_path(TRUE) . '/ckeditor.styles.js', '!theme' => path_to_theme() . '/ckeditor.styles.js')) + ); + + $form['css']['styles_path'] = array( + '#type' => 'textfield', + '#title' => t('Predefined styles path'), + '#default_value' => !empty($profile->settings['styles_path']) ? $profile->settings['styles_path'] : "", + '#size' => 40, + '#maxlength' => 255, + '#description' => t('Enter the path to a file with predefined styles (Example: !example1). Make sure you select the Define path to ckeditor.styles.js option above.', + array( + '!example1' => '/ckeditor.styles.js' + ) + ) . + '
      ' . + t('Available placeholders:!h – host name (!host).!t – path to theme (!theme).!m – path to the CKEditor module (!module).', + array( + '!h' => '
      %h', + '!t' => '
      %t', + '!m' => '
      %m', + '!host' => base_path(), + '!theme' => base_path() . path_to_theme() . '/', + '!module' => drupal_get_path('module', 'ckeditor') + ) + ) + ); + + $form['ckeditor_upload_settings'] = array( + '#type' => 'fieldset', + '#title' => t('File browser settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + //'#description' => t('Set the file browser settings. A file browser will allow you to browse the files stored on the server and embed them as links, images, or Flash movies. CKEditor is compatible with such Drupal modules as IMCE, Image Browser, or Web File Manager. CKEditor can be also integrated with CKFinder, an advanced Ajax file manager.', array('!imce' => url('http://drupal.org/project/imce'), '!ib' => url('http://drupal.org/project/imagebrowser'), '!webfm' => url('http://drupal.org/project/webfm'), '!readme' => url('admin/help/ckeditor'), '!ckfinder' => url('http://ckfinder.com'))) + '#description' => t('Set the file browser settings. A file browser will allow you to browse the files stored on the server and embed them as links, images, or Flash movies. CKEditor is compatible with such Drupal modules as IMCE or elFinder. CKEditor can be also integrated with CKFinder, an advanced Ajax file manager.', array('!imce' => url('http://drupal.org/project/imce'), '!elfinder' => url('http://drupal.org/project/elfinder'), '!readme' => url('admin/help/ckeditor'), '!ckfinder' => url('http://ckfinder.com'))) + ); + + $filebrowsers = array( + 'none' => t('None'), + 'ckfinder' => t('CKFinder'), + ); + + $filebrowsers_dialogs = array( + '' => t('Same as in the Link dialog window'), + 'ckfinder' => t('CKFinder'), + ); + + if (module_exists('imce')) { + $filebrowsers['imce'] = t('IMCE'); + $filebrowsers_dialogs['imce'] = t('IMCE'); + } + + if (module_exists('elfinder')) { + $filebrowsers['elfinder'] = t('elFinder'); + $filebrowsers_dialogs['elfinder'] = t('elFinder'); + } + + /* MODULES NOT PORTED TO D7 + if (module_exists('tinybrowser')) { + $filebrowsers['tinybrowser'] = t('TinyBrowser'); + $filebrowsers_dialogs['tinybrowser'] = t('TinyBrowser'); + } + + if (module_exists('imagebrowser')) { + $filebrowsers['ib'] = t('Image Browser'); + $filebrowsers_dialogs['ib'] = t('Image Browser'); + } + + if (module_exists('webfm_popup')) { + $filebrowsers['webfm'] = t('Web File Manager'); + $filebrowsers_dialogs['webfm'] = t('Web File Manager'); + } + */ + $form['ckeditor_upload_settings']['filebrowser'] = array( + '#type' => 'select', + '#title' => t('File browser type (Link dialog window)'), + '#default_value' => !empty($profile->settings['filebrowser']) ? $profile->settings['filebrowser'] : 'none', + '#options' => $filebrowsers, + '#description' => t('Select the file browser that you would like to use to upload files.'), + ); + + $form['ckeditor_upload_settings']['filebrowser_image'] = array( + '#type' => 'select', + '#title' => t('File browser type (Image dialog window)'), + '#default_value' => !empty($profile->settings['filebrowser_image']) ? $profile->settings['filebrowser_image'] : 'none', + '#options' => $filebrowsers_dialogs, + '#description' => t('Select the file browser that you would like to use to upload images.'), + ); + + $form['ckeditor_upload_settings']['filebrowser_flash'] = array( + '#type' => 'select', + '#title' => t('File browser type (Flash dialog window)'), + '#default_value' => !empty($profile->settings['filebrowser_flash']) ? $profile->settings['filebrowser_flash'] : 'none', + '#options' => $filebrowsers_dialogs, + '#description' => t('Select the file browser that you would like to use to upload Flash movies.'), + ); + + if (variable_get('file_default_scheme', '') != 'private') + { + + $current_user_files_path = empty($profile->settings['UserFilesPath']) ? "" : strtr($profile->settings['UserFilesPath'], array("%f" => variable_get('file_public_path', conf_path() . '/files'), "%u" => "UID", "%b" => base_path(), "%n" => "UNAME")); + $current_user_files_absolute_path = empty($profile->settings['UserFilesAbsolutePath']) ? "" : strtr($profile->settings['UserFilesAbsolutePath'], array("%f" => variable_get('file_public_path', conf_path() . '/files'), "%u" => "UID", "%b" => base_path(), "%d" => ckeditor_get_document_root_full_path(), "%n" => "UNAME")); + + $form['ckeditor_upload_settings']['UserFilesPath'] = array( + '#type' => 'textfield', + '#prefix' => '
      ' . t('CKFinder settings') . '', + '#title' => t('Path to uploaded files'), + '#default_value' => !empty($profile->settings['UserFilesPath']) ? $profile->settings['UserFilesPath'] : "%b%f/", + '#size' => 40, + '#maxlength' => 255, + '#description' => t('Path to uploaded files relative to the document root.') . + '
      ' . + t('Available placeholders:!b – the base URL path of the Drupal installation (!base).!f – the Drupal file system path where the files are stored (!files).!u – User ID.!n – Username.
      Current path: !path', + array( + '!n' => '
      %n', + '!u' => '
      %u', + '!f' => '
      %f', + '!b' => '
      %b', + '!path' => $current_user_files_path, + '!files' => variable_get('file_public_path', conf_path() . '/files'), + '!base' => base_path() + ) + ) + ); + + $form['ckeditor_upload_settings']['UserFilesAbsolutePath'] = array( + '#type' => 'textfield', + '#title' => t('Absolute path to uploaded files'), + '#default_value' => !empty($profile->settings['UserFilesAbsolutePath']) ? $profile->settings['UserFilesAbsolutePath'] : "%d%b%f/", + '#size' => 40, + '#maxlength' => 255, + '#suffix' => '
      ', + '#description' => t('The path to the local directory (on the server) which points to the path defined above. If left empty, CKEditor will try to discover the right path.') . + '
      ' . + t('Available placeholders:!d – the server path to the document root (!root).!b – the base URL path of the Drupal installation (!base).!f – the Drupal file system path where the files are stored (!files).!u – User ID.!n – Username.
      Current path: !path', + array( + '!u' => '
      %u', + '!n' => '
      %n', + '!d' => '
      %d', + '!b' => '
      %b', + '!f' => '
      %f', + '!path' => $current_user_files_absolute_path, + '!files' => variable_get('file_public_path', conf_path() . '/files'), + '!base' => base_path(), + '!root' => ckeditor_get_document_root_full_path() + ) + ) + ); + } + if (variable_get('file_default_scheme', '') == 'private') + { + $form['ckeditor_upload_settings']['private_path_descrption'] = array( + '#markup' => '
      '.t('Setting a relative path to uploaded files was disabled because private downloads are enabled and thus this path is calculated automatically. To change the location of uploaded files in the private file system, edit the CKEditor Global Profile.', array('!url' => url('admin/config/content/ckeditor/editg'))).'
      ', + ); + } + + $form['advanced'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced options'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['advanced']['ckeditor_load_method'] = array( + '#type' => 'select', + '#title' => t('Loading method'), + '#default_value' => !empty($profile->settings['ckeditor_load_method']) ? $profile->settings['ckeditor_load_method'] : 'ckeditor.js', + '#options' => _ckeditor_load_methods(), + '#description' => t('Select the loading method of CKEditor. If the ckeditor_basic.js file is used, only a small file is loaded initially and the rest of the editor is loaded later (see Loading timeout). This might be useful if CKEditor is disabled by default.'), + ); + $form['advanced']['ckeditor_load_time_out'] = array( + '#type' => 'textfield', + '#title' => t('Loading timeout'), + '#default_value' => !empty($profile->settings['ckeditor_load_time_out']) ? $profile->settings['ckeditor_load_time_out'] : "0", + '#size' => 40, + '#maxlength' => 255, + '#description' => t('The time to wait (in seconds) to load the full editor code after the page is loaded, if the ckeditor_basic.js file is used. If set to zero, the editor is loaded on demand.'), + ); + $form['advanced']['forcePasteAsPlainText'] = array( + '#type' => 'select', + '#title' => t('Force pasting as plain text'), + '#default_value' => !empty($profile->settings['forcePasteAsPlainText']) ? $profile->settings['forcePasteAsPlainText'] : "f", + '#options' => array( + 't' => t('Enabled'), + 'f' => t('Disabled') + ), + '#description' => t('If enabled, HTML content will be automatically changed to plain text when pasting.'), + ); + $form['advanced']['html_entities'] = array( + '#type' => 'radios', + '#title' => t('HTML Entities'), + '#default_value' => !empty($profile->settings['html_entities']) ? $profile->settings['html_entities'] : 't', + '#description' => t('Convert all applicable characters to HTML entities.'), + '#options' => array( + 'f' => t('No'), + 't' => t('Yes') + ), + ); + $form['advanced']['scayt_autoStartup'] = array( + '#type' => 'radios', + '#title' => t('Spellchecker'), + '#default_value' => !empty($profile->settings['scayt_autoStartup']) ? $profile->settings['scayt_autoStartup'] : 'f', + '#description' => t('If enabled, turns on SCAYT (Spell Check As You Type) automatically after loading the editor.'), + '#options' => array( + 'f' => t('No'), + 't' => t('Yes') + ), + ); + $form['advanced']['theme_config_js'] = array( + '#type' => 'radios', + '#title' => t('Load ckeditor.config.js from the theme path'), + '#default_value' => !empty($profile->settings['theme_config_js']) ? $profile->settings['theme_config_js'] : 'f', + '#options' => array( + 't' => t('Yes'), + 'f' => t('No') + ), + '#description' => t('When enabled, the editor will try to load the ckeditor.config.js file from the theme directory.'), + ); + $form['advanced']['js_conf'] = array( + '#type' => 'textarea', + '#title' => t('Custom JavaScript configuration'), + '#default_value' => !empty($profile->settings['js_conf']) ? $profile->settings['js_conf'] : "", + '#cols' => 60, + '#rows' => 5, + '#description' => t('In order to change CKEditor configuration globally, you should modify the !ckeditor_config configuration file. Sometimes it is required to change the CKEditor configuration for a single profile only. Use this box to define settings that are unique for this profile. Available options are listed in the CKEditor documentation. Add the following code snippet to change the fonts available in the CKEditor Font and Size drop-down lists:
      @code
      Warning: If you make a mistake here, CKEditor may not load correctly.', array('!ckeditor_config' => drupal_get_path('module', 'ckeditor') . "/ckeditor.config.js", '!docs' => 'http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html', '@code' => "config.font_names = 'Arial;Times New Roman;Verdana'\nconfig.fontSize_sizes = '16/16px;24/24px;48/48px;'")), + '#wysiwyg' => FALSE, + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Save') + ); + + return $form; +} + +/** + * Form validation for a profile. + */ +function ckeditor_admin_profile_form_validate($form, &$form_state) { + $edit = & $form_state['values']; + /* + if ($edit['default'] == 't' && $edit['popup'] == 't') { + form_set_error('popup', t('If CKEditor is enabled by default, the popup window must be disabled.')); + } + + if ($edit['show_toggle'] == 't' && $edit['popup'] == 't') { + form_set_error('popup', t('If toggle is enabled, the popup window must be disabled.')); + } + */ + if (!$edit['name']) { + form_set_error('name', t('You must give a profile name.')); + } + elseif (!preg_match('/^[A-Za-z0-9_]+$/', $edit['name'])) { + form_set_error('name', t('Enter a valid profile name. Only alphanumeric and underscore characters are allowed.')); + } + elseif ($edit['name'] == 'CKEditor Global Profile') { + form_set_error('name', t('This profile name is reserved. Please choose a different name.')); + } + elseif (!isset($edit['_profile']) || ($edit['_profile']->name != $edit['name'])) { + $result = ckeditor_profile_load($edit['name']); + if (!empty($result)) { + form_set_error('name', t('The profile name must be unique. A profile with this name already exists.')); + } + } + + if (!preg_match('/^\d+%?$/', $edit['width'])) { + form_set_error('width', t('Enter a valid width value. Examples: 400, 100%.')); + } + + if (!empty($edit['css_path'])) { + if ($edit['css_mode'] != 'self') { + form_set_error('css_path', t('The CSS path is not empty. Please set the Editor CSS option to the Define CSS mode.')); + } + elseif (FALSE !== strpos($edit['css_path'], '"')) { + form_set_error('css_path', t('Double quotes are not allowed in the CSS path.')); + } + elseif (substr($edit['css_path'], 0, 1) == "'" && substr($edit['css_path'], -1) == "'") { + form_set_error('css_path', t('Enter a valid CSS path, do not surround it with quotes.')); + } + } + + if (!empty($edit['styles_path'])) { + if ($edit['css_style'] != 'self') { + form_set_error('styles_path', t('The path to predefined styles is not empty. Please set the Predefined styles option to the Define path to ckeditor.styles.js mode.')); + } + elseif (FALSE !== strpos($edit['styles_path'], '"')) { + form_set_error('styles_path', t('Double quotes are not allowed in the styles path.')); + } + elseif (substr($edit['styles_path'], 0, 1) == "'" && substr($edit['styles_path'], -1) == "'") { + form_set_error('styles_path', t('Enter a valid styles path, do not surround it with quotes.')); + } + } + + if (!empty($edit['font_format'])) { + if (!preg_match("/^((p|div|pre|address|h1|h2|h3|h4|h5|h6);)*(p|div|pre|address|h1|h2|h3|h4|h5|h6)$/", $edit['font_format'])) { + form_set_error('font_format', t('Enter a valid, semicolon-separated list of HTML font formats (no semicolon at the end of the list is expected).')); + } + } + // @todo DOWNLOAD API + if (!empty($edit['UserFilesAbsolutePath']) && empty($edit['UserFilesPath'])) { + form_set_error('UserFilesPath', t('The path to uploaded files is required.')); + } + if (!empty($edit['UserFilesPath']) && empty($edit['UserFilesAbsolutePath'])) { + form_set_error('UserFilesPath', t('An absolute path to uploaded files is required.')); + } + + $load_methods = _ckeditor_load_methods(); + if (!isset($load_methods[$edit['ckeditor_load_method']])) { + form_set_error('ckeditor_load_method', t('Set a valid loading method.')); + } + if (!preg_match('#\d+#', $edit['ckeditor_load_time_out'])) { + form_set_error('ckeditor_load_time_out', t('Enter a valid loading timeout in seconds.')); + } + + if (!preg_match('#^\s*\[(?:\s*(?:\{\s*[\w:\'" ,]*\s*\[(?:\s*([\'\"\"])(?:\w+|-)\1\s*[,]?\s*)+\]\s*\}|([\'\"\"])\/\2)\s*[,]?\s*)+\]\s*$#U', $edit['toolbar']) && !preg_match('#^\s*\[(?:\s*(?:\[(?:\s*([\'\"\"])(?:\w+|-)\1\s*[,]?\s*)+\]|([\'\"\"])\/\2)\s*[,]?\s*)+\]\s*$#', $edit['toolbar'])) { + form_set_error('toolbar', t('Enter a valid toolbar configuration.')); + } +} + +/** + * Form submit for a profile + */ +function ckeditor_admin_profile_form_submit($form, &$form_state) { + $edit = & $form_state['values']; + + if (isset($edit['_profile'])) { + ckeditor_profile_delete($edit['_profile']->name); + drupal_set_message(t('Your CKEditor profile was updated.')); + } + else { + drupal_set_message(t('Your CKEditor profile was created.')); + } + + $settings = ckeditor_admin_values_to_settings($edit); + db_insert('ckeditor_settings') + ->fields(array( + "name" => $edit['name'], + "settings" => $settings + )) + ->execute(); + + if (!empty($edit['input_formats'])) { + foreach (array_keys($edit['input_formats']) as $format) { + if ($edit['input_formats'][$format] != '0') { + db_insert('ckeditor_input_format')->fields(array("name" => $edit['name'], "format" => $format))->execute(); + } + } + } + + $form_state['redirect'] = 'admin/config/content/ckeditor'; +} + +/** + * Form builder for a clone profile + */ +function ckeditor_admin_profile_clone_form($form, $form_state, $oldprofile) { + return ckeditor_admin_profile_form($form, $form_state, $oldprofile); +} + +/** + * Form validation for a clone profile + */ +function ckeditor_admin_profile_clone_form_validate($form_state, $oldprofile) { + ckeditor_admin_profile_form_validate($form_state, $oldprofile); +} + +/** + * Form submit for a clone profile + */ +function ckeditor_admin_profile_clone_form_submit($form, &$form_state) { + $edit = & $form_state['values']; + drupal_set_message(t('Your CKEditor profile was created.')); + $settings = ckeditor_admin_values_to_settings($edit); + db_insert('ckeditor_settings') + ->fields(array( + "name" => $edit['name'], + "settings" => $settings + )) + ->execute(); + + if (!empty($edit['input_formats'])) { + foreach (array_keys($edit['input_formats']) as $format) { + if ($edit['input_formats'][$format] != 0) { + db_insert('ckeditor_input_format')->fields(array("name" => $edit['name'], "format" => $format))->execute(); + } + } + } + + $form_state['redirect'] = 'admin/config/content/ckeditor'; +} + +/** + * Form builder for a profile delete + */ +function ckeditor_admin_profile_delete_form($form, $form_state, $profile) { + $form = array(); + + $form['_profile'] = array( + '#type' => 'value', + '#value' => $profile, + ); + + $form['question'] = array( + '#type' => 'item', + '#markup' => t('Are you sure that you want to delete the CKEditor profile %profile?', array('%profile' => $profile->name)), + ); + + $form['delete'] = array( + '#type' => 'submit', + '#id' => 'delete', + '#value' => t('Delete'), + ); + + $form['back'] = array( + '#type' => 'submit', + '#id' => 'back', + '#value' => t('Cancel'), + ); + + return $form; +} + +/** + * Submit form for a profile delete + */ +function ckeditor_admin_profile_delete_form_submit($form, &$form_state) { + $v = & $form_state['values']; + + if ($form_state['clicked_button']['#id'] == 'delete') { + ckeditor_profile_delete($v['_profile']->name); + drupal_set_message(t('The CKEditor profile was deleted.')); + } + + $form_state['redirect'] = 'admin/config/content/ckeditor'; +} + +/** + * Converts an array of form values to a serialized array that does not + * contain Drupal Form API values + */ +function ckeditor_admin_values_to_settings($values) { + $plugins = array(); + if (isset($values['loadPlugins'])) { + $plugins = $values['loadPlugins']; + } + unset($values['name'], $values['input_formats'], $values['_profile'], $values['op'], $values['submit'], $values['form_build_id'], $values['form_token'], $values['form_id'], $values['loadPlugins']); + + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + $plugin_list = ckeditor_load_plugins(); + $values['loadPlugins'] = array(); + if (!empty($plugins)) { + foreach (array_keys($plugins) as $plugin) { + if ($plugins[$plugin] != '0') { + $values['loadPlugins'][$plugin] = $plugin_list[$plugin]; + } + } + } + + return serialize($values); +} + +/** + * Remove a profile from the database. + */ +function ckeditor_profile_delete($name) { + db_delete('ckeditor_settings') + ->condition('name', $name) + ->execute(); + db_delete('ckeditor_input_format') + ->condition('name', $name) + ->execute(); +} + +/* + * List of CKEditor librares to load + */ +function _ckeditor_load_methods() { + module_load_include('module', 'ckeditor'); + $result = array('ckeditor.js' => 'ckeditor.js'); + if (file_exists(ckeditor_path(TRUE) . '/ckeditor_basic.js')) { + $result['ckeditor_basic.js'] = 'ckeditor_basic.js'; + } + if (file_exists(ckeditor_path(TRUE) . '/ckeditor_source.js')) { + $result['ckeditor_source.js'] = 'ckeditor_source.js (' . t('for developers only') . ')'; + } + return $result; +} + +/* + * Disable WYSIWYG module + */ +function ckeditor_disable_wysiwyg() { + module_disable(array('wysiwyg')); + drupal_set_message(t('The WYSIWYG module is disabled.')); + + drupal_goto('admin/config/content/ckeditor'); +} + +/* + * Get all available toolbar buttons + */ +function ckeditor_toolbar_buttons_all() { + $path = base_path() . drupal_get_path('module', 'ckeditor'); + + //CKEditor default buttons + $buttons = array( + 'Source' => array('name' => 'Source', 'icon' => $path . '/images/buttons/source.png', 'title' => 'Source', 'row' => 1), + 'Save' => array('name' => 'Save', 'icon' => $path . '/images/buttons/save.png', 'title' => 'Save', 'row' => 1), + 'NewPage' => array('name' => 'NewPage', 'icon' => $path . '/images/buttons/newPage.png', 'title' => 'New Page', 'row' => 1), + 'Preview' => array('name' => 'Preview', 'icon' => $path . '/images/buttons/preview.png', 'title' => 'Preview', 'row' => 1), + 'Templates' => array('name' => 'Templates', 'icon' => $path . '/images/buttons/templates.png', 'title' => 'Templates', 'row' => 1), + 'Cut' => array('name' => 'Cut', 'icon' => $path . '/images/buttons/cut.png', 'title' => 'Cut', 'row' => 1), + 'Copy' => array('name' => 'Copy', 'icon' => $path . '/images/buttons/copy.png', 'title' => 'Copy', 'row' => 1), + 'Paste' => array('name' => 'Paste', 'icon' => $path . '/images/buttons/paste.png', 'title' => 'Paste', 'row' => 1), + 'PasteText' => array('name' => 'PasteText', 'icon' => $path . '/images/buttons/pastePlainText.png', 'title' => 'Paste as plain text', 'row' => 1), + 'PasteFromWord' => array('name' => 'PasteFromWord', 'icon' => $path . '/images/buttons/pasteWord.png', 'title' => 'Paste from Word', 'row' => 1), + 'Print' => array('name' => 'Print', 'icon' => $path . '/images/buttons/print.png', 'title' => 'Print', 'row' => 1), + 'SpellChecker' => array('name' => 'SpellChecker', 'icon' => $path . '/images/buttons/checkSpelling.png', 'title' => 'Check Spelling', 'row' => 1), + 'Scayt' => array('name' => 'Scayt', 'icon' => $path . '/images/buttons/checkSpelling.png', 'title' => 'Spell Check As you Type', 'row' => 1), //TODO sprawdzic ta opcje + 'Undo' => array('name' => 'Undo', 'icon' => $path . '/images/buttons/undo.png', 'title' => 'Undo', 'row' => 1), + 'Redo' => array('name' => 'Redo', 'icon' => $path . '/images/buttons/redo.png', 'title' => 'Redo', 'row' => 1), + 'Find' => array('name' => 'Find', 'icon' => $path . '/images/buttons/find.png', 'title' => 'Find', 'row' => 1), + 'Replace' => array('name' => 'Replace', 'icon' => $path . '/images/buttons/replace.png', 'title' => 'Replace', 'row' => 1), + 'SelectAll' => array('name' => 'SelectAll', 'icon' => $path . '/images/buttons/selectAll.png', 'title' => 'Select All', 'row' => 1), + 'RemoveFormat' => array('name' => 'RemoveFormat', 'icon' => $path . '/images/buttons/removeFormat.png', 'title' => 'Remove Format', 'row' => 1), + 'Form' => array('name' => 'Form', 'icon' => $path . '/images/buttons/form.png', 'title' => 'Form', 'row' => 1), + 'Checkbox' => array('name' => 'Checkbox', 'icon' => $path . '/images/buttons/checkbox.png', 'title' => 'Checkbox', 'row' => 1), + 'Radio' => array('name' => 'Radio', 'icon' => $path . '/images/buttons/radioButton.png', 'title' => 'Radio Button', 'row' => 1), + 'TextField' => array('name' => 'TextField', 'icon' => $path . '/images/buttons/textField.png', 'title' => 'Text Field', 'row' => 1), + 'Textarea' => array('name' => 'Textarea', 'icon' => $path . '/images/buttons/textarea.png', 'title' => 'Textarea', 'row' => 1), + 'Select' => array('name' => 'Select', 'icon' => $path . '/images/buttons/selectionField.png', 'title' => 'Selection Field', 'row' => 1), + 'Button' => array('name' => 'Button', 'icon' => $path . '/images/buttons/button.png', 'title' => 'Button', 'row' => 1), + 'ImageButton' => array('name' => 'ImageButton', 'icon' => $path . '/images/buttons/imageButton.png', 'title' => 'Image Button', 'row' => 1), + 'HiddenField' => array('name' => 'HiddenField', 'icon' => $path . '/images/buttons/hiddenField.png', 'title' => 'Hidden Field', 'row' => 1), + 'Bold' => array('name' => 'Bold', 'icon' => $path . '/images/buttons/bold.png', 'title' => 'Bold', 'row' => 2), + 'Italic' => array('name' => 'Italic', 'icon' => $path . '/images/buttons/italic.png', 'type' => 'command' , 'title' => 'Italic', 'row' => 2), + 'Underline' => array('name' => 'Underline', 'icon' => $path . '/images/buttons/underline.png', 'title' => 'Underline', 'row' => 2), + 'Strike' => array('name' => 'Strike', 'icon' => $path . '/images/buttons/strike.png', 'title' => 'Strike Through', 'row' => 2), + 'Subscript' => array('name' => 'Subscript', 'icon' => $path . '/images/buttons/subscript.png', 'title' => 'Subscript', 'row' => 2), + 'Superscript' => array('name' => 'Superscript', 'icon' => $path . '/images/buttons/superscript.png', 'title' => 'Superscript', 'row' => 2), + 'NumberedList' => array('name' => 'NumberedList', 'icon' => $path . '/images/buttons/numberedList.png', 'title' => 'Insert/Remove Numbered List', 'row' => 2), + 'BulletedList' => array('name' => 'BulletedList', 'icon' => $path . '/images/buttons/bulletedList.png', 'title' => 'Insert/Remove Bulleted List', 'row' => 2), + 'Outdent' => array('name' => 'Outdent', 'icon' => $path . '/images/buttons/decreaseIndent.png', 'title' => 'Decrease Indent', 'row' => 2), + 'Indent' => array('name' => 'Indent', 'icon' => $path . '/images/buttons/increaseIndent.png', 'title' => 'Increase Indent', 'row' => 2), + 'Blockquote' => array('name' => 'Blockquote', 'icon' => $path . '/images/buttons/blockQuote.png', 'title' => 'Block Quote', 'row' => 2), + 'CreateDiv' => array('name' => 'CreateDiv', 'icon' => $path . '/images/buttons/createDivContainer.png', 'title' => 'Create Div Container', 'row' => 2), + 'JustifyLeft' => array('name' => 'JustifyLeft', 'icon' => $path . '/images/buttons/leftJustify.png', 'title' => 'Left Justify', 'row' => 2), + 'JustifyCenter' => array('name' => 'JustifyCenter', 'icon' => $path . '/images/buttons/centerJustify.png', 'title' => 'Center Justify', 'row' => 2), + 'JustifyRight' => array('name' => 'JustifyRight', 'icon' => $path . '/images/buttons/rightJustify.png', 'title' => 'Right Justify', 'row' => 2), + 'JustifyBlock' => array('name' => 'JustifyBlock', 'icon' => $path . '/images/buttons/blockJustify.png', 'title' => 'Block Justify', 'row' => 2), + 'BidiLtr' => array('name' => 'BidiLtr', 'icon' => $path . '/images/buttons/bidiLeft.png', 'title' => 'Text direction from left to right', 'row' => 2), + 'BidiRtl' => array('name' => 'BidiRtl', 'icon' => $path . '/images/buttons/bidiRight.png', 'title' => 'Text direction from right to left', 'row' => 2), + 'Link' => array('name' => 'Link', 'icon' => $path . '/images/buttons/link.png', 'title' => 'Link', 'row' => 2), + 'Unlink' => array('name' => 'Unlink', 'icon' => $path . '/images/buttons/unlink.png', 'title' => 'Unlink', 'row' => 2), + 'Anchor' => array('name' => 'Anchor', 'icon' => $path . '/images/buttons/anchor.png', 'title' => 'Anchor', 'row' => 2), + 'Image' => array('name' => 'Image', 'icon' => $path . '/images/buttons/image.png', 'title' => 'Image', 'row' => 2), + 'Flash' => array('name' => 'Flash', 'icon' => $path . '/images/buttons/flash.png', 'title' => 'Flash', 'row' => 2), + 'Table' => array('name' => 'Table', 'icon' => $path . '/images/buttons/table.png', 'title' => 'Table', 'row' => 2), + 'HorizontalRule' => array('name' => 'HorizontalRule', 'icon' => $path . '/images/buttons/horizontalLine.png', 'title' => 'Insert Horizontal Line', 'row' => 2), + 'Smiley' => array('name' => 'Smiley', 'icon' => $path . '/images/buttons/smiley.png', 'title' => 'Smiley', 'row' => 2), + 'SpecialChar' => array('name' => 'SpecialChar', 'icon' => $path . '/images/buttons/specialCharacter.png', 'title' => 'Inseert Special Character', 'row' => 2), + 'PageBreak' => array('name' => 'PageBreak', 'icon' => $path . '/images/buttons/pageBreakPrinting.png', 'title' => 'Insert Page Break for Printing', 'row' => 2), + 'Styles' => array('name' => 'Styles', 'icon' => $path . '/images/buttons/styles.png', 'title' => 'Formatting Styles', 'row' => 3), + 'Format' => array('name' => 'Format', 'icon' => $path . '/images/buttons/format.png', 'title' => 'Paragraph Format', 'row' => 3), + 'Font' => array('name' => 'Font', 'icon' => $path . '/images/buttons/font.png', 'title' => 'Font Name', 'row' => 3), + 'FontSize' => array('name' => 'FontSize', 'icon' => $path . '/images/buttons/fontSize.png', 'title' => 'Font Size', 'row' => 3), + 'TextColor' => array('name' => 'TextColor', 'icon' => $path . '/images/buttons/textColor.png', 'title' => 'Text Color', 'row' => 3), + 'BGColor' => array('name' => 'BGColor', 'icon' => $path . '/images/buttons/backgroundColor.png', 'title' => 'Background Color', 'row' => 3), + 'Maximize' => array('name' => 'Maximize', 'icon' => $path . '/images/buttons/maximize.png', 'title' => 'Maximize', 'row' => 3), + 'ShowBlocks' => array('name' => 'ShowBlocks', 'icon' => $path . '/images/buttons/showBlocks.png', 'title' => 'Show Blocks', 'row' => 3), + 'Iframe' => array('name' => 'Iframe', 'icon' => $path . '/images/buttons/iframe.png', 'title' => 'Read more', 'row' => 3), + 'About' => array('name' => 'About', 'icon' => $path . '/images/buttons/about.png', 'title' => 'About', 'row' => 3), + '__spacer' => array('name' => false, 'icon' => $path . '/images/buttons/spacer.png', 'title' => 'Spacer', 'row' => 4), + '__group' => array('name' => false, 'icon' => $path . '/images/buttons/group.png', 'title' => 'Group', 'row' => 4) + ); + + $plugins = ckeditor_load_plugins(TRUE); + foreach ($plugins as $plugin_name => $plugin) { + if (!isset($plugin['buttons']) || $plugin['buttons'] == FALSE) continue; + foreach ((array) $plugin['buttons'] as $button_name => $button) { + $buttons[$button_name] = array('name' => $button_name, 'icon' => $plugin['path'] . $button['icon'], 'title' => t($button['label']), 'row' => 4); + } + } + + return $buttons; +} \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.admin.js b/docroot/sites/all/modules/ckeditor/includes/ckeditor.admin.js new file mode 100644 index 0000000..885a0f1 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.admin.js @@ -0,0 +1,159 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +(function ($) { + CKEDITOR.on( 'dialogDefinition', function( ev ) + { + var dialogName = ev.data.name; + var dialogDefinition = ev.data.definition; + + if ( dialogName == 'uicolor' ) + { + // Get a reference to the configBox and hide it (cannot be removed). + var configBox = dialogDefinition.getContents( 'tab1' ).get( 'configBox' ); + configBox.style = 'display:none'; + } + }); + + $(document).ready(function() { + if (typeof(CKEDITOR) == "undefined") + return; + + $('#edit-uicolor-textarea').show(); + + Drupal.ckeditorUiColorOnChange = function() { + var color = CKEDITOR.instances["edit-uicolor-textarea"].getUiColor(); + $("#edit-uicolor").val("custom"); + if (typeof(color) != "undefined") { + if (color == "default"){ + $("#edit-uicolor").val("default"); + } + $('input[name$="uicolor_user"]').val(color); + } + }; + + if ( $("#edit-skin").val() == "kama" ){ + $("#edit-uicolor").removeAttr('disabled'); + $("#edit-uicolor").parent().removeClass('form-disabled'); + CKEDITOR.replace("edit-uicolor-textarea", + { + extraPlugins : 'uicolor', + height: 60, + uiColor: $('input[name$="uicolor_user"]').val() || '#D3D3D3', + width: 400, + toolbar : [[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList'],[ 'UIColor' ]], + skin: $("#edit-skin").val(), + on: + { + focus : Drupal.ckeditorUiColorOnChange, + blur : Drupal.ckeditorUiColorOnChange + } + }); + } + else { + $("#edit-uicolor").attr('disabled', 'disabled'); + $("#edit-uicolor").parent().addClass('form-disabled'); + CKEDITOR.replace("edit-uicolor-textarea", + { + height: 60, + uiColor: $('input[name$="uicolor_user"]').val() || '#D3D3D3', + width: 400, + toolbar : [[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList']], + skin: $("#edit-skin").val(), + on: + { + focus : Drupal.ckeditorUiColorOnChange, + blur : Drupal.ckeditorUiColorOnChange + } + }); + } + + $("#edit-skin").bind("change", function() { + CKEDITOR.instances["edit-uicolor-textarea"].destroy(); + if ( $("#edit-skin").val() == "kama" ){ + $("#edit-uicolor").removeAttr('disabled'); + $("#edit-uicolor").parent().removeClass('form-disabled'); + CKEDITOR.replace("edit-uicolor-textarea", + { + extraPlugins : 'uicolor', + height: 60, + uiColor: $('input[name$="uicolor_user"]').val() || '#D3D3D3', + width: 400, + toolbar: [[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList'],[ 'UIColor' ]], + skin: $("#edit-skin").val(), + on: + { + focus : Drupal.ckeditorUiColorOnChange, + blur : Drupal.ckeditorUiColorOnChange + } + }); + } + else { + $("#edit-uicolor").attr('disabled', 'disabled'); + $("#edit-uicolor").parent().addClass('form-disabled'); + CKEDITOR.replace("edit-uicolor-textarea", + { + height: 60, + uiColor: $('input[name$="uicolor_user"]').val() || '#D3D3D3', + width: 400, + toolbar: [[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList']], + skin: $("#edit-skin").val(), + on: + { + focus : Drupal.ckeditorUiColorOnChange, + blur : Drupal.ckeditorUiColorOnChange + } + }); + } + }); + + $("#edit-uicolor").bind("change", function() { + if (typeof(Drupal.settings.ckeditor_uicolor) != "undefined") { + CKEDITOR.instances["edit-uicolor-textarea"].setUiColor(Drupal.settings.ckeditor_uicolor[$(this).val()]); + } + if ($(this).val() != "custom") { + $('input[name$="uicolor_user"]').val(""); + } + else { + var color = CKEDITOR.instances["edit-uicolor-textarea"].getUiColor(); + if (typeof(color) != "undefined") { + $('input[name$="uicolor_user"]').val(color); + } + } + }); + + $(".cke_load_toolbar").click(function() { + var buttons = eval('Drupal.settings.'+$(this).attr("id")); + var text = "[\n"; + for(i in buttons) { + if (typeof buttons[i] == 'string'){ + text = text + " '/',\n"; + } + else { + text = text + " ["; + max = buttons[i].length - 1; + rows = buttons.length - 1; + for (j in buttons[i]) { + if (j < max){ + text = text + "'" + buttons[i][j] + "',"; + } else { + text = text + "'" + buttons[i][j] + "'"; + } + } + if (i < rows){ + text = text + "],\n"; + } else { + text = text + "]\n"; + } + } + } + + text = text + "]"; + text = text.replace(/\['\/'\]/g,"'/'"); + $("#edit-toolbar").attr('value',text); + Drupal.ckeditorToolbarReload(); + return false; + }); + }); +})(jQuery); \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.drush.inc b/docroot/sites/all/modules/ckeditor/includes/ckeditor.drush.inc new file mode 100644 index 0000000..785b09b --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.drush.inc @@ -0,0 +1,68 @@ + 'ckeditor_drush_download', + 'description' => dt('Downloads the required CKEditor library from svn.ckeditor.com.'), + 'arguments' => array( + 'path' => dt('Optional. The path to the download folder. If omitted, Drush will use the default location (sites/all/libraries/ckeditor).'), + ), + ); + return $items; +} + +/** + * Downloads + */ +function ckeditor_drush_download() { + $args = func_get_args(); + if ($args[0]) { + $path = $args[0]; + } + else { + $path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries/ckeditor'; + } + + if (drush_shell_exec('svn checkout http://svn.ckeditor.com/CKEditor/releases/stable/ ' . $path)) { + drush_log(dt('CKEditor was downloaded to @path.', array('@path' => $path)), 'success'); + } + else { + drush_log(dt('Drush was unable to download CKEditor to @path.', array('@path' => $path)), 'error'); + } +} + +/** + * Implements drush_MODULE_post_COMMAND(). + */ +function drush_ckeditor_post_enable() { + $modules = func_get_args(); + if (in_array('ckeditor', $modules)) { + ckeditor_drush_download(); + } +} diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.features.inc b/docroot/sites/all/modules/ckeditor/includes/ckeditor.features.inc new file mode 100644 index 0000000..1fc9b55 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.features.inc @@ -0,0 +1,109 @@ + $profile) { + $options[$name] = $profile->name; + } + return $options; +} + +/** + * Implementation of hook_features_export() + */ +function ckeditor_profile_features_export($data, &$export, $module_name = '') { + $pipe = array(); + foreach ((array)$data as $name) { + $profile = ckeditor_profile_load($name); + if ($profile) { + $export['features']['ckeditor_profile'][$name] = $name; + + // Write dependencies on all the roles referenced by this profile + foreach ((array) $profile->input_formats as $input_format => $input_format_name) { + $pipe['input_formats'][] = $input_format; + } + } + } + $export['dependencies'][] = 'ckeditor'; + return $pipe; +} + +/** + * Implementation of hook_features_export_render() + */ +function ckeditor_profile_features_export_render($module_name, $data) { + $profiles = array(); + $roles = user_roles(); + foreach ($data as $name) { + $profile = (array) ckeditor_profile_load($name); + + $profiles[$name] = $profile; + } + $code = ' $data = ' . features_var_export($profiles, ' ') . ';' . PHP_EOL; + $code .= ' return $data;'; + + return array('ckeditor_profile_defaults' => $code); +} + +/** + * Implementation of hook_features_revert() + */ +function ckeditor_profile_features_revert($module) { + $data = module_invoke($module, 'ckeditor_profile_defaults'); + $input_formats = filter_formats(); + foreach ($data as $name => $profile) { + // Restore the profile settings + db_query("DELETE FROM {ckeditor_settings} WHERE name = :name", array(':name' => $name)); + db_query("INSERT INTO {ckeditor_settings} (name, settings) VALUES(:name, :settings)", array(':name' => $name, ':settings' => serialize($profile['settings']))); + + // Restore the profile roles + foreach ($profile["input_formats"] as $input_format => $input_format_name) { + if (isset($input_formats[$input_format])) { + if (!db_query("SELECT name FROM {ckeditor_input_format} WHERE format = :format AND name = :name", array(':name' => $name, ':format' => $input_format))->fetchField()) { + db_query("INSERT INTO {ckeditor_input_format} (name, format) VALUES(:name, :format)", array(':name' => $name, ':format' => $input_format)); + } + } + else { + // Make sure they don't have access + db_query("DELETE FROM {ckeditor_input_format} WHERE format = :format AND name = :name", array(':name' => $name, ':format' => $input_format)); + } + } + } +} \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.lib.inc b/docroot/sites/all/modules/ckeditor/includes/ckeditor.lib.inc new file mode 100644 index 0000000..b04d399 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.lib.inc @@ -0,0 +1,1537 @@ += 3) { + return $document_root_dir; + } + else { + return FALSE; + } +} + +/** + * Emulates the asp Server.mapPath function. + * Given an url path return the physical directory that it corresponds to. + * + * Returns absolute path or false on failure + * + * @param string $path + * @return string|boolean + */ +function ckeditor_resolve_url($path) { + if (function_exists('apache_lookup_uri')) { + $info = @apache_lookup_uri($path); + if (!$info) { + return FALSE; + } + return $info->filename . $info->path_info; + } + + $document_root = ckeditor_get_document_root_full_path(); + if ($document_root !== FALSE) { + return $document_root . $path; + } + + return FALSE; +} + +/** + * List of configured CKEditor toolbars + * + * @return array + */ +function ckeditor_load_toolbar_options() { + $arr = array('Basic' => 'Basic', 'Full' => 'Full'); + $module_drupal_path = drupal_get_path('module', 'ckeditor'); + $editor_local_path = ckeditor_path(TRUE); + $ckconfig_js = $editor_local_path . '/config.js'; + $ckeditor_config_js = $module_drupal_path . '/ckeditor.config.js'; + if (file_exists($ckconfig_js) && is_readable($ckconfig_js)) { + $fp = @fopen($ckconfig_js, "r"); + if ($fp) { + while (!feof($fp)) { + $line = fgets($fp, 1024); + $matches = array(); + if (preg_match('/config.toolbar_([a-z0-9_]+)/i', $line, $matches)) { + $arr[$matches[1]] = drupal_ucfirst($matches[1]); + } + } + fclose($fp); + } + } + if (file_exists($ckeditor_config_js) && is_readable($ckeditor_config_js)) { + $fp = @fopen($ckeditor_config_js, "r"); + if ($fp) { + while (!feof($fp)) { + $line = fgets($fp, 1024); + $matches = array(); + if (preg_match('/config.toolbar_([a-z0-9_]+)/i', $line, $matches)) { + $arr[$matches[1]] = drupal_ucfirst($matches[1]); + } + } + fclose($fp); + } + } + + //oops, we have no information about toolbars, let's use hardcoded array + if (empty($arr)) { + $arr = array( + 'Basic' => 'Basic', + 'Default' => 'Default', + ); + } + asort($arr); + + return $arr; +} + +/** + * List of installed CKEditor skins + * + * @return array + */ +function ckeditor_load_skin_options() { + $arr = array(); + $editor_local_path = ckeditor_path(TRUE); + $skin_dir = $editor_local_path . '/skins'; + if (is_dir($skin_dir)) { + $dh = @opendir($skin_dir); + if (FALSE !== $dh) { + while (($file = readdir($dh)) !== FALSE) { + if (in_array($file, array(".", "..", "CVS", ".svn"))) { + continue; + } + if (is_dir($skin_dir . DIRECTORY_SEPARATOR . $file)) { + $arr[$file] = drupal_ucfirst($file); + } + } + closedir($dh); + } + } + + //oops, we have no information about skins, let's use only default + if (empty($arr)) { + $arr = array( + 'kama' => 'Kama', + ); + } + asort($arr); + + return $arr; +} + +/** + * List of installed CKEditor languages + * + * @return array + */ +function ckeditor_load_lang_options() { + $arr = array(); + $editor_local_path = ckeditor_path(TRUE); + $lang_file = $editor_local_path . '/lang/_languages.js'; + if (file_exists($lang_file)) + { + $f = fopen($lang_file, 'r'); + $file = fread($f, filesize($lang_file)); + $tmp = explode('{', $file); + if (isset($tmp[2])) + { + $tmp = explode('}', $tmp[2]); + } + $langs = explode(',', $tmp[0]); + foreach ($langs AS $key => $lang) + { + preg_match("/(\w+-?\w+):'(\w+)'/i",$lang, $matches); + if (isset($matches[1]) && isset($matches[2])) + $arr[$matches[1]] = $matches[2]; + } + } + //oops, we have no information about languages, let's use those available in CKEditor 2.4.3 + if (empty($arr)) { + $arr = array( + 'af' => 'Afrikaans', + 'ar' => 'Arabic', + 'bg' => 'Bulgarian', + 'bn' => 'Bengali/Bangla', + 'bs' => 'Bosnian', + 'ca' => 'Catalan', + 'cs' => 'Czech', + 'da' => 'Danish', + 'de' => 'German', + 'el' => 'Greek', + 'en' => 'English', + 'en-au' => 'English (Australia)', + 'en-ca' => 'English (Canadian)', + 'en-uk' => 'English (United Kingdom)', + 'eo' => 'Esperanto', + 'es' => 'Spanish', + 'et' => 'Estonian', + 'eu' => 'Basque', + 'fa' => 'Persian', + 'fi' => 'Finnish', + 'fo' => 'Faroese', + 'fr' => 'French', + 'gl' => 'Galician', + 'he' => 'Hebrew', + 'hi' => 'Hindi', + 'hr' => 'Croatian', + 'hu' => 'Hungarian', + 'it' => 'Italian', + 'ja' => 'Japanese', + 'km' => 'Khmer', + 'ko' => 'Korean', + 'lt' => 'Lithuanian', + 'lv' => 'Latvian', + 'mn' => 'Mongolian', + 'ms' => 'Malay', + 'nb' => 'Norwegian Bokmal', + 'nl' => 'Dutch', + 'no' => 'Norwegian', + 'pl' => 'Polish', + 'pt' => 'Portuguese (Portugal)', + 'pt-br' => 'Portuguese (Brazil)', + 'ro' => 'Romanian', + 'ru' => 'Russian', + 'sk' => 'Slovak', + 'sl' => 'Slovenian', + 'sr' => 'Serbian (Cyrillic)', + 'sr-latn' => 'Serbian (Latin)', + 'sv' => 'Swedish', + 'th' => 'Thai', + 'tr' => 'Turkish', + 'uk' => 'Ukrainian', + 'vi' => 'Vietnamese', + 'zh' => 'Chinese Traditional', + 'zh-cn' => 'Chinese Simplified', + ); + } + asort($arr); + return $arr; +} +/** + * Get the language locale code supported by Scayt for the specified language + */ +function ckeditor_scayt_langcode($lang) { + $scayt_langs = array( + 'en' => 'en_US', + 'es' => 'es_ES', + 'fr' => 'fr_FR', + 'de' => 'de_DE', + 'it' => 'it_IT', + 'el' => 'el_EL', + 'pt' => 'pt_PT', + 'da' => 'da_DA', + 'sv' => 'sv_SE', + 'nl' => 'nl_NL', + 'nb' => 'no_NO', + 'fi' => 'fi_FI', + ); + if (array_key_exists($lang, $scayt_langs)) { + return $scayt_langs[$lang]; + } + + $default = language_default(); + $default = $default->language; + if (array_key_exists($default, $scayt_langs)) { + return $scayt_langs[$default]; + } + + return 'en_US'; +} + +/** + * List of CKEditor plugins; + * + * @return array + */ +function ckeditor_load_plugins($render = FALSE) { + $arr = array(); + $base_path = '%base_path%'; + $editor_path = '%editor_path%'; + $ckeditor_path = '%ckeditor_path%'; + $plugin_dir = '%plugin_dir%'; + $plugin_dir_additional = '%plugin_dir_extra%'; + + /* + * External plugins + */ + if (module_exists('ckeditor_swf') && file_exists(drupal_get_path('module', 'ckeditor_swf') . '/plugins/swf/plugin.js')) { + $arr['ckeditor_swf'] = array( + 'name' => 'swf', + 'desc' => t('Support for the CKEditor SWF module'), + 'path' => $base_path . drupal_get_path('module', 'ckeditor_swf') . '/plugins/swf/', + 'buttons' => false, + 'default' => 't' + ); + } + + if (module_exists('ckeditor_link') && file_exists(drupal_get_path('module', 'ckeditor_link') . '/plugins/link/plugin.js')) { + $arr['ckeditor_link'] = array( + 'name' => 'drupal_path', + 'desc' => t('Support for the CKEditor Link module'), + 'path' => $base_path . drupal_get_path('module', 'ckeditor_link') . '/plugins/link/', + 'buttons' => false, + 'default' => 't' + ); + } + + if (module_exists('linkit') && file_exists(drupal_get_path('module', 'linkit') . '/editors/ckeditor/plugin.js')) { + $arr['linkit'] = array( + 'name' => 'Linkit', + 'desc' => t('Support for the Linkit module (buttons: Linkit)'), + 'path' => $base_path . drupal_get_path('module', 'linkit') . '/editors/ckeditor/', + 'buttons' => array( + 'Linkit' => array( + 'title' => 'Linkit', + 'icon' => $base_path . drupal_get_path('module', 'linkit') . '/editors/ckeditor/linkit.png' + ) + ), + 'default' => 't' + ); + } + + /* + * CKEditor build-in plugins + */ + $_editor_path = ckeditor_path(FALSE) . '/'; + if (file_exists($_editor_path . 'plugins/tableresize/plugin.js')) { + $arr['tableresize'] = array( + 'name' => 'tableresize', + 'desc' => t('Table Resize plugin'), + 'path' => $base_path . $editor_path . 'plugins/tableresize/', + 'buttons' => false, + 'default' => 't' + ); + } + + if (file_exists($_editor_path . 'plugins/autogrow/plugin.js')) { + $arr['autogrow'] = array( + 'name' => 'autogrow', + 'desc' => t('Auto Grow plugin'), + 'path' => $base_path . $editor_path . 'plugins/autogrow/', + 'buttons' => false, + 'default' => 'f' + ); + } + + /* + * CKEditor module plugins + */ + $_plugin_dir = drupal_get_path('module', 'ckeditor') . '/plugins/'; + if ($handle = opendir($_plugin_dir)) { + while (false !== ($file = readdir($handle))) { + if (is_dir($_plugin_dir . $file) && file_exists($_plugin_dir . $file . '/plugin.js')) { + $source = file_get_contents($_plugin_dir . $file . '/plugin.js'); + $buttons = array(); + if (preg_match_all('#\.addButton\([\s]*\'(.*?)\'[\s]*\,[\s]*\{[\s]*(.*?)[\s]*\}#s', $source, $matches)) { + foreach ($matches[1] as $i => $button_name){ + if (preg_match('#(icon)[\s]*\:[\s]*([^\,\n]*)#', $matches[2][$i], $matches2)){ + $buttons[$button_name] = array(); + $buttons[$button_name]['label'] = $button_name; + $matches2[2] = str_replace(array('this.path', '+', '\'', '"'), array('', '', '', ''), $matches2[2]); + $buttons[$button_name]['icon'] = trim($matches2[2]); + } + } + } + if (preg_match('#@file ([^\n\r]*)#', $source, $matches)) { + $arr[$file] = array( + 'name' => $file, + 'desc' => t($matches[1]), + 'path' => $base_path . $plugin_dir . $file . '/', + 'buttons' => (count($buttons) > 0) ? $buttons : FALSE, + 'default' => 'f' + ); + } + else { + $arr[$file] = array( + 'name' => $file, + 'desc' => t('Plugin file: ' . $file), + 'path' => $base_path . $plugin_dir . $file . '/', + 'buttons' => (count($buttons) > 0) ? $buttons : FALSE, + 'default' => 'f' + ); + } + } + } + closedir($handle); + } + + /* + * CKEditor module plugins - additional directory + */ + $_plugin_dir_additional = ckeditor_plugins_path(TRUE) . '/'; + if ($_plugin_dir != $_plugin_dir_additional && is_dir($_plugin_dir_additional) && $handle = opendir($_plugin_dir_additional)) { + while (false !== ($file = readdir($handle))) { + if (is_dir($_plugin_dir_additional . $file) && file_exists($_plugin_dir_additional . $file . '/plugin.js')) { + $source = file_get_contents($_plugin_dir_additional . $file . '/plugin.js'); + $buttons = array(); + if (preg_match_all('#\.addButton\([\s]*\'(.*?)\'[\s]*\,[\s]*\{[\s]*(.*?)[\s]*\}#s', $source, $matches)) { + foreach ($matches[1] as $i => $button_name){ + if (preg_match('#(icon)[\s]*\:[\s]*([^\,\n]*)#', $matches[2][$i], $matches2)){ + $buttons[$button_name] = array(); + $buttons[$button_name]['label'] = $button_name; + $matches2[2] = str_replace(array('this.path', '+', '\'', '"'), array('', '', '', ''), $matches2[2]); + $buttons[$button_name]['icon'] = trim($matches2[2]); + } + } + } + if (preg_match('#@file ([^\n\r]*)#', $source, $matches)) { + $arr[$file] = array( + 'name' => $file, + 'desc' => t($matches[1]), + 'path' => $base_path . $plugin_dir_additional . $file . '/', + 'buttons' => (count($buttons) > 0) ? $buttons : FALSE, + 'default' => 'f' + ); + } + else { + $arr[$file] = array( + 'name' => $file, + 'desc' => t('Plugin file: ' . $file), + 'path' => $base_path . $plugin_dir_additional . $file . '/', + 'buttons' => (count($buttons) > 0) ? $buttons : FALSE, + 'default' => 'f' + ); + } + } + } + + closedir($handle); + } + + /* + * CKEditor plugins registered by hook + */ + $plugins = module_invoke_all('ckeditor_plugin'); + + foreach ($plugins as $i => $plugin) { + if (file_exists($plugin['path'] . 'plugin.js')) { + $source = file_get_contents($plugin['path'] . 'plugin.js'); + $plugins[$i]['path'] = $base_path . $plugin['path']; + if (!isset($plugin['buttons']) || count($plugin['buttons']) == 0) { + $buttons = array(); + if (preg_match_all('#\.addButton\([\s]*\'(.*?)\'[\s]*\,[\s]*\{[\s]*(.*?)[\s]*\}#s', $source, $matches)) { + foreach ($matches[1] as $i => $button_name){ + if (preg_match('#(icon)[\s]*\:[\s]*([^\,\n]*)#', $matches[2][$i], $matches2)){ + $buttons[$button_name] = array(); + $buttons[$button_name]['label'] = $button_name; + $matches2[2] = str_replace(array('this.path', '+', '\'', '"'), array('', '', '', ''), $matches2[2]); + $buttons[$button_name]['icon'] = trim($matches2[2]); + } + } + } + $plugin['buttons'] = (count($buttons) > 0) ? $buttons : FALSE; + } + } + else { + unset($plugins[$i]); + } + } + $arr = array_merge($arr, $plugins); + + if (isset($arr['media']) && module_exists('media') == FALSE) { + unset($arr['media']); + } + + if (isset($arr['imce']) && module_exists('imce') == FALSE) { + unset($arr['imce']); + } + //remove page break button if there is no module to do this + if (isset($arr['drupalbreaks']['buttons']['DrupalPageBreak']) && !module_exists('paging') && !module_exists('pagebreak')) + { + unset($arr['drupalbreaks']['buttons']['DrupalPageBreak']); + } + ksort($arr); + if ($render === TRUE) { + $arr = ckeditor_plugins_render($arr); + } + + return $arr; +} + +/** + * Render CKEditor plugins path + */ +function ckeditor_plugins_render($plugins) { + $render = array(); + $render["%base_path%"] = base_path(); + $render["%editor_path%"] = ckeditor_path(FALSE) . '/'; + $render["%ckeditor_path%"] = drupal_get_path('module', 'ckeditor'); + $render["%plugin_dir%"] = $render["%ckeditor_path%"] . '/plugins/'; + $render["%plugin_dir_extra%"] = ckeditor_plugins_path(TRUE) . '/'; + + foreach ((array) $plugins as $i => $plugin) { + $plugins[$i]['path'] = str_replace(array_keys($render), array_values($render), $plugin['path']); + } + + return $plugins; +} + + +/** + * Get default ckeditor settings + * + * @return array + */ +function ckeditor_user_get_setting_default() { + $default = array( + 'default' => 't', + 'show_toggle' => 't', + 'popup' => 'f', + 'skin' => 'kama', + 'expand' => 't', + 'width' => '100%', + 'lang' => 'en', + 'auto_lang' => 't', + ); + + return $default; +} + +/** + * Return CKEditor settings + * + * @param object $user + * @param object $profile + * @param string $setting + * @return array + */ +function ckeditor_user_get_setting($user, $profile, $setting) { + $default = ckeditor_user_get_setting_default(); + + if (user_access('customize ckeditor')) { + $status = isset($user->data['ckeditor_' . $setting]) ? $user->data['ckeditor_' . $setting] : (isset($profile->settings[$setting]) ? $profile->settings[$setting] : $default[$setting]); + } + else { + $status = isset($profile->settings[$setting]) ? $profile->settings[$setting] : $default[$setting]; + } + + return $status; +} + +/** + * Return CKEditor profile by input format + * + * @param string $input_format + * @return object|boolean + */ +function ckeditor_get_profile($input_format) { + $select = db_select('ckeditor_settings', 's'); + $select->join('ckeditor_input_format', 'f', 'f.name = s.name'); + $result = $select->fields('s', array("name"))->condition('f.format', $input_format)->condition('f.name', 'CKEditor Global Profile', '<>')->range(0, 1)->execute()->fetchAssoc(); + + if ($result && $profile = ckeditor_profile_load($result['name'])) { + return $profile; + } + + return FALSE; +} + +/** + * Return CKEditor profile list + */ +function ckeditor_profile_input_formats() { + $select = db_select('ckeditor_settings', 's'); + $select->join('ckeditor_input_format', 'f', 'f.name = s.name'); + $result = $select->fields('s', array("name"))->fields('f', array("format"))->execute(); + + $list = array(); + while ( $row = $result->fetchAssoc() ) { + if (!isset($row['name'])) { + $list[$row['name']] = array(); + } + $list[$row['name']][] = $row['format']; + } + + return $list; +} + +/** + * Search and return CKEditor plugin path + * + * @return string + */ + +function _ckeditor_script_path() { + $jspath = FALSE; + $module_path = drupal_get_path('module', 'ckeditor'); + + if (file_exists($module_path . '/ckeditor/ckeditor.js')) { + $jspath = '%m/ckeditor'; + } + elseif (file_exists($module_path . '/ckeditor/ckeditor/ckeditor.js')) { + $jspath = '%m/ckeditor/ckeditor'; + } + elseif (file_exists('sites/all/libraries/ckeditor/ckeditor.js')) { + $jspath = '%l/ckeditor'; + } + return $jspath; +} + +/** + * Determines whether the CKEditor sources are present + * + * It checks if ckeditor.js is present. + * + * This function is used by ckeditor_requirements() + * + * @return boolean True if CKEditor is installed + */ +function _ckeditor_requirements_isinstalled() { + $editor_path = ckeditor_path(TRUE); + $jspath = $editor_path . '/ckeditor.js'; + $jsp = file_exists($jspath); + if (!$jsp && ($editor_path = _ckeditor_script_path())) { + $result = db_select('ckeditor_settings', 's')->fields('s')->condition('name', 'CKEditor Global Profile')->execute()->fetchAssoc(); + if ($result) { + $result['settings'] = unserialize($result['settings']); + $result['settings']['ckeditor_path'] = $editor_path; + $result['settings'] = serialize($result['settings']); + db_update('ckeditor_settings')->fields(array("settings" => $result['settings']))->condition('name', 'CKEditor Global Profile')->execute(); + + $jsp = TRUE; + ckeditor_path(TRUE, TRUE); + } + } + return $jsp; +} + +/** + * Compile settings of all profiles at returns is as array + * + * @param string $input_format + * @param boolean $clear + * @return array + */ +function ckeditor_profiles_compile( $input_format = FALSE, $clear = FALSE ) { + static $compiled = FALSE; + static $_ckeditor_compiled = array(); + + if ( $clear !== FALSE && $compiled !== FALSE ) { + $compiled = FALSE; + } + + if ( $compiled === TRUE ) { + return ( $input_format === FALSE ) ? $_ckeditor_compiled : ( isset( $_ckeditor_compiled[$input_format] ) ? $_ckeditor_compiled[$input_format] : array() ); + } + + $global_profile = ckeditor_profile_load('CKEditor Global Profile'); + + $profiles_list = ckeditor_profile_input_formats(); + + foreach ( $profiles_list AS $_profile => $_inputs ) { + $profile = ckeditor_profile_load($_profile); + $setting = ckeditor_profile_settings_compile($global_profile, $profile); + + foreach ( $_inputs AS $_input ) { + $_ckeditor_compiled[$_input] = $setting; + } + } + + $compiled = TRUE; + + return ( $input_format === FALSE ) ? $_ckeditor_compiled : $_ckeditor_compiled[$input_format]; +} + +/** + * Compile settings of profile + * + * @param object $global_profile + * @param object $profile + * @return array + */ +function ckeditor_profile_settings_compile( $global_profile, $profile ) { + global $user, $language, $theme; + + $current_theme = variable_get('theme_default', $theme); + + $settings = array(); + $conf = array(); + $conf = $profile->settings; + $profile_name = $profile->name; + + if (user_access('customize ckeditor')) { + //foreach (array('default', 'show_toggle', 'popup', 'skin', 'expand', 'width', 'lang', 'auto_lang') as $setting) { + foreach (array('default', 'show_toggle', 'skin', 'expand', 'width', 'lang', 'auto_lang') as $setting) { + $conf[$setting] = ckeditor_user_get_setting($user, $profile, $setting); + } + } + /* + if ($conf['popup'] == 't' && $conf['show_toggle'] == 't') { + $conf['show_toggle'] = 'f'; + } + */ + if (!isset($conf['filters'])) { + $conf['filters'] = array(); + } + + if (!isset($conf['ss'])) { + $conf['ss'] = 2; + $conf['filters']['default'] = 1; + } + + $themepath = drupal_get_path('theme', $current_theme) . '/'; + $host = base_path(); + + // setting some variables + $module_drupal_path = drupal_get_path('module', 'ckeditor'); + $module_full_path = $host . $module_drupal_path; + $editor_path = ckeditor_path(FALSE); + $editor_local_path = ckeditor_path(TRUE); + + // get the default drupal files path + $files_path = $host . variable_get('file_private_path', conf_path() . '/files'); + + $toolbar = $conf['toolbar']; + + if (!empty($conf['theme_config_js']) && $conf['theme_config_js'] == 't' && file_exists($themepath . 'ckeditor.config.js')) { + $ckeditor_config_path = $host . $themepath . 'ckeditor.config.js?' . @filemtime($themepath . 'ckeditor.config.js'); + } + else { + $ckeditor_config_path = $module_full_path . "/ckeditor.config.js?" . @filemtime($module_drupal_path . "/ckeditor.config.js"); + } + + $settings['customConfig'] = $ckeditor_config_path; + $settings['defaultLanguage'] = $conf['lang']; + $settings['toolbar'] = $toolbar; + $settings['enterMode'] = constant("CKEDITOR_ENTERMODE_" . strtoupper($conf['enter_mode'])); + $settings['shiftEnterMode'] = constant("CKEDITOR_ENTERMODE_" . strtoupper($conf['shift_enter_mode'])); + $settings['toolbarStartupExpanded'] = ( $conf['expand'] == 't' ); + $settings['width'] = $conf['width']; + $settings['skin'] = $conf['skin']; + $settings['format_tags'] = $conf['font_format']; + //$settings['popup'] = $conf['popup']; + $settings['show_toggle'] = $conf['show_toggle']; + + if (isset($conf['language_direction'])) { + switch ($conf['language_direction']) { + case 'default': + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { + $settings['contentsLangDirection'] = 'rtl'; + } + break; + case 'ltr': + $settings['contentsLangDirection'] = 'ltr'; + break; + case 'rtl': + $settings['contentsLangDirection'] = 'rtl'; + break; + } + } + + if (isset($conf['loadPlugins'])) { + $settings['loadPlugins'] = ckeditor_plugins_render($conf['loadPlugins']); + + if (array_key_exists('media', $settings['loadPlugins']) && module_exists('media')) { + module_load_include('inc', 'media', 'includes/media.browser'); + $javascript = media_browser_js(); + foreach ($javascript as $key => $definitions) { + foreach ($definitions as $definition) { + $function = 'drupal_add_' . $key; + call_user_func_array($function, $definition); + } + } + drupal_add_js(drupal_get_path('module', 'ckeditor') . '/plugins/media/library.js', array('scope' => 'footer', 'weight' => -20)); + } + } + if (isset($conf['html_entities']) && $conf['html_entities'] == 'f') { + $settings['entities'] = FALSE; + $settings['entities_greek'] = FALSE; + $settings['entities_latin'] = FALSE; + } + if (isset($conf['scayt_autoStartup']) && $conf['scayt_autoStartup'] == 't') { + $settings['scayt_autoStartup'] = TRUE; + } + else { + $settings['scayt_autoStartup'] = FALSE; + } + + if ($conf['auto_lang'] == "f") { + $settings['language'] = $conf['lang']; + } + + if (isset($conf['forcePasteAsPlainText']) && $conf['forcePasteAsPlainText'] == 't') { + $settings['forcePasteAsPlainText'] = TRUE; + } + + $settings['filters'] = array(); + foreach ($conf['filters'] as $filter => $filter_val) { + if ($filter_val == 1) { + $settings['filters'][] = $filter; + } + } + + if (!isset($conf['textformat_filters']) || $conf['textformat_filters'] == 't') { + $settings['textformat_filters'] = TRUE; + } + else { + $settings['textformat_filters'] = FALSE; + } + + if (isset($conf['custom_formatting']) && $conf['custom_formatting'] == 't') { + foreach ($conf['formatting']['custom_formatting_options'] as $k => $v) { + if ($v === 0) { + $conf['formatting']['custom_formatting_options'][$k] = FALSE; + } + else { + $conf['formatting']['custom_formatting_options'][$k] = TRUE; + } + } + $settings['output_pre_indent'] = $conf['formatting']['custom_formatting_options']['pre_indent']; + unset($conf['formatting']['custom_formatting_options']['pre_indent']); + $settings['custom_formatting'] = $conf['formatting']['custom_formatting_options']; + } + + // add code for filebrowser for users that have access + $filebrowser = !empty($conf['filebrowser']) ? $conf['filebrowser'] : 'none'; + $filebrowser_image = !empty($conf['filebrowser_image']) ? $conf['filebrowser_image'] : $filebrowser; + $filebrowser_flash = !empty($conf['filebrowser_flash']) ? $conf['filebrowser_flash'] : $filebrowser; + + if ($filebrowser == 'imce' && !module_exists('imce')) { + $filebrowser = 'none'; + } + + if ($filebrowser == 'elfinder' && !module_exists('elfinder')) { + $filebrowser = 'none'; + } + + /* MODULES NOT PORTED TO D7 + if ($filebrowser == 'tinybrowser' && !module_exists('tinybrowser')) { + $filebrowser = 'none'; + } + + if ($filebrowser == 'ib' && !module_exists('imagebrowser')) { + $filebrowser = 'none'; + } + if ($filebrowser == 'webfm' && !module_exists('webfm_popup')) { + $filebrowser = 'none'; + } + */ + if ($filebrowser_image != $filebrowser) { + if ($filebrowser_image == 'imce' && !module_exists('imce')) { + $filebrowser_image = $filebrowser; + } + + if ($filebrowser_image == 'elfinder' && !module_exists('elfinder')) { + $filebrowser_image = $filebrowser; + } + /* MODULES NOT PORTED TO D7 + if ($filebrowser_image == 'tinybrowser' && !module_exists('tinybrowser')) { + $filebrowser_image = $filebrowser; + } + if ($filebrowser_image == 'ib' && !module_exists('imagebrowser')) { + $filebrowser_image = $filebrowser; + } + if ($filebrowser_image == 'webfm' && !module_exists('webfm_popup')) { + $filebrowser_image = $filebrowser; + } + */ + } + + if ($filebrowser_flash != $filebrowser) { + if ($filebrowser_flash == 'imce' && !module_exists('imce')) { + $filebrowser_flash = $filebrowser; + } + + if ($filebrowser_image == 'elfinder' && !module_exists('elfinder')) { + $filebrowser_flash = $filebrowser; + } + /* MODULES NOT PORTED TO D7 + if ($filebrowser_image == 'tinybrowser' && !module_exists('tinybrowser')) { + $filebrowser_flash = $filebrowser; + } + if ($filebrowser_flash == 'ib' && !module_exists('imagebrowser')) { + $filebrowser_flash = $filebrowser; + } + if ($filebrowser_flash == 'webfm' && !module_exists('webfm_popup')) { + $filebrowser_flash = $filebrowser; + } + */ + } + + if ($filebrowser == 'ckfinder' || $filebrowser_image == 'ckfinder' || $filebrowser_flash == 'ckfinder') { + if (user_access('allow CKFinder file uploads')) { + if (!empty($profile->settings['UserFilesPath'])) { + $_SESSION['ckeditor'][$profile_name]['UserFilesPath'] = strtr($profile->settings['UserFilesPath'], array("%f" => variable_get('file_public_path', conf_path() . '/files'), "%u" => $user->uid, "%b" => $host, "%n" => $user->name)); + } + if (!empty($profile->settings['UserFilesAbsolutePath'])) { + $_SESSION['ckeditor'][$profile_name]['UserFilesAbsolutePath'] = strtr($profile->settings['UserFilesAbsolutePath'], array("%f" => variable_get('file_public_path', conf_path() . '/files'), "%u" => $user->uid, "%b" => base_path(), "%d" => ckeditor_get_document_root_full_path(), "%n" => $user->name)); + } + if (variable_get('file_default_scheme', '') == 'private') + { + $private_dir = isset($global_profile->settings['private_dir']) ? trim($global_profile->settings['private_dir'], '\/') : ''; + if (!empty($private_dir)) { + $private_dir = strtr($private_dir, array('%u' => $user->uid, '%n' => $user->name)); + $_SESSION['ckeditor'][$profile_name]['UserFilesPath'] = url('system/files') .'/'. $private_dir .'/'; + $_SESSION['ckeditor'][$profile_name]['UserFilesAbsolutePath'] = variable_get('file_private_path', '') . DIRECTORY_SEPARATOR . $private_dir . DIRECTORY_SEPARATOR; + } + else { + $_SESSION['ckeditor'][$profile_name]['UserFilesPath'] = url('system/files') .'/'; + $_SESSION['ckeditor'][$profile_name]['UserFilesAbsolutePath'] = variable_get('file_private_path', '') . DIRECTORY_SEPARATOR; + } + } + } + } + /* MODULES NOT PORTED TO D7 + if (in_array('tinybrowser', array($filebrowser, $filebrowser_image, $filebrowser_flash))) { + $popup_win_size = variable_get('tinybrowser_popup_window_size', '770x480'); + if (!preg_match('#\d+x\d+#is', $popup_win_size)) { + $popup_win_size = '770x480'; + } + $popup_win_size = trim($popup_win_size); + $popup_win_size = strtolower($popup_win_size); + $win_size = split('x', $popup_win_size); + } + */ + switch ($filebrowser) { + case 'ckfinder': + if (user_access('allow CKFinder file uploads')) { + $settings['filebrowserBrowseUrl'] = $module_full_path . '/ckfinder/ckfinder.html?id=' . $profile_name; + $settings['filebrowserImageBrowseUrl'] = $module_full_path . '/ckfinder/ckfinder.html?Type=Images&id=' . $profile_name; + $settings['filebrowserFlashBrowseUrl'] = $module_full_path . '/ckfinder/ckfinder.html?Type=Flash&id=' . $profile_name; + $settings['filebrowserUploadUrl'] = $module_full_path . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&id=' . $profile_name; + $settings['filebrowserImageUploadUrl'] = $module_full_path . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images&id=' . $profile_name; + $settings['filebrowserFlashUploadUrl'] = $module_full_path . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash&id=' . $profile_name; + } + break; + case 'imce': + $settings['filebrowserBrowseUrl'] = url('imce', array('query' => array('app' => 'ckeditor|sendto@ckeditor_imceSendTo|'))); + break; + case 'elfinder': + $settings['filebrowserBrowseUrl'] = $host . "index.php?q=elfinder&app=ckeditor"; + break; + /* MODULES NOT PORTED TO D7 + case 'webfm': + if (user_access('access webfm')) { + $settings['filebrowserBrowseUrl'] = $host . "index.php?q=webfm_popup"; + } + break; + case 'ib': + if (user_access('browse own images')) { + $settings['filebrowserBrowseUrl'] = $host . "index.php?q=imagebrowser/view/browser&app=ckeditor"; + $settings['filebrowserWindowWidth'] = 700; + $settings['filebrowserWindowHeight'] = 520; + } + break; + case 'tinybrowser': + $settings['filebrowserBrowseUrl'] = $host . drupal_get_path('module', 'tinybrowser') . "/tinybrowser/tinybrowser.php?type=file"; + $settings['filebrowserWindowWidth'] = (int) $win_size[0] + 15; + $settings['filebrowserWindowHeight'] = (int) $win_size[1] + 15; + break; + */ + } + + if ($filebrowser_image != $filebrowser) { + switch ($filebrowser_image) { + case 'ckfinder': + if (user_access('allow CKFinder file uploads')) { + $settings['filebrowserImageBrowseUrl'] = $module_full_path . '/ckfinder/ckfinder.html?Type=Images&id=' . $profile_name; + $settings['filebrowserImageUploadUrl'] = $module_full_path . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images&id=' . $profile_name; + } + break; + case 'imce': + $settings['filebrowserImageBrowseUrl'] = url('imce', array('query' => array('app' => 'ckeditor|sendto@ckeditor_imceSendTo|'))); + break; + case 'elfinder': + $settings['filebrowserImageBrowseUrl'] = $host . "index.php?q=elfinder&app=ckeditor"; + break; + /* MODULES NOT PORTED TO D7 + case 'webfm': + if (user_access('access webfm')) { + $settings['filebrowserImageBrowseUrl'] = $host . "index.php?q=webfm_popup"; + } + break; + case 'ib': + if (user_access('browse own images')) { + $settings['filebrowserImageBrowseUrl'] = $host . "index.php?q=imagebrowser/view/browser&app=ckeditor"; + $settings['filebrowserImageWindowWidth'] = 680; + $settings['filebrowserImageWindowHeight'] = 439; + } + break; + case 'tinybrowser': + $settings['filebrowserImageBrowseUrl'] = $host . drupal_get_path('module', 'tinybrowser') . "/tinybrowser/tinybrowser.php?type=image"; + $settings['filebrowserImageWindowWidth'] = (int) $win_size[0] + 15; + $settings['filebrowserImageWindowHeight'] = (int) $win_size[1] + 15; + break; + */ + } + } + + if ($filebrowser_flash != $filebrowser) { + switch ($filebrowser_flash) { + case 'ckfinder': + if (user_access('allow CKFinder file uploads')) { + $settings['filebrowserFlashBrowseUrl'] = $module_full_path . '/ckfinder/ckfinder.html?Type=Images&id=' . $profile_name; + $settings['filebrowserFlashUploadUrl'] = $module_full_path . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images&id=' . $profile_name; + } + break; + case 'imce': + $settings['filebrowserFlashBrowseUrl'] = url('imce', array('query' => array('app' => 'ckeditor|sendto@ckeditor_imceSendTo|'))); + break; + case 'elfinder': + $settings['filebrowserFlashBrowseUrl'] = $host . "index.php?q=elfinder&app=ckeditor"; + break; + /* MODULES NOT PORTED TO D7 + case 'webfm': + if (user_access('access webfm')) { + $settings['filebrowserFlashBrowseUrl'] = $host . "index.php?q=webfm_popup"; + } + break; + case 'ib': + if (user_access('browse own images')) { + $settings['filebrowserFlashBrowseUrl'] = $host . "index.php?q=imagebrowser/view/browser&app=ckeditor"; + $settings['filebrowserFlashWindowWidth'] = 680; + $settings['filebrowserFlashWindowHeight'] = 439; + } + break; + case 'tinybrowser': + $settings['filebrowserFlashBrowseUrl'] = $host . drupal_get_path('module', 'tinybrowser') . "/tinybrowser/tinybrowser.php?type=media"; + $settings['filebrowserFlashWindowWidth'] = (int) $win_size[0] + 15; + $settings['filebrowserFlashWindowHeight'] = (int) $win_size[1] + 15; + break; + */ + } + } + + if (!empty($conf['js_conf'])) { + preg_match_all('#config\.(\w+)[\s]*=[\s]*(.+?);[\s]*(?=config\.|$)#is', preg_replace("/[\n\r]+/", "", $conf['js_conf']), $matches); + foreach ($matches[2] as $i => $match) { + if (!empty($match)) { + $value=trim($match, " ;\n\r\t\0\x0B"); + if ( strcasecmp($value, 'true') == 0 ) { + $value=TRUE; + } + if ( strcasecmp($value, 'false') == 0 ) { + $value=FALSE; + } + $settings["js_conf"][$matches[1][$i]]=$value; + } + } + } + + $settings['stylesCombo_stylesSet'] = "drupal:" . $module_full_path . '/ckeditor.styles.js'; + if (!empty($conf['css_style'])) { + if ($conf['css_style'] == 'theme' && file_exists($themepath . 'ckeditor.styles.js')) { + $settings['stylesCombo_stylesSet'] = "drupal:" . $host . $themepath . 'ckeditor.styles.js'; + } + elseif (!empty($conf['css_style']) && $conf['css_style'] == 'self') { + $conf['styles_path'] = str_replace("%h%t", "%t", $conf['styles_path']); + $settings['stylesCombo_stylesSet'] = "drupal:" . str_replace(array('%h', '%t', '%m'), array($host, $host . $themepath, $module_drupal_path), $conf['styles_path']); + } + } + + // add custom stylesheet if configured + // lets hope it exists but we'll leave that to the site admin + $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1); + $css_files = array(); + switch ($conf['css_mode']) { + case 'theme': + global $language, $base_theme_info; + $themes = list_themes(); + $theme_info = $themes[$current_theme]; + if (!empty($theme_info->stylesheets)) { + $editorcss = "\""; + foreach ($base_theme_info as $base) { // Grab stylesheets from base theme + if (!empty($base->stylesheets)) { // may be empty when the base theme reference in the info file is invalid + foreach ($base->stylesheets as $type => $stylesheets) { + if ($type != "print") { + foreach ($stylesheets as $name => $path) { + if (file_exists($path)) { + $css_files[$name] = $host . $path . $query_string; + // Grab rtl stylesheets ( will get rtl css files when thay are named with suffix "-rtl.css" (ex: fusion baased themes) ) + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL && substr($path, 0, -8) != "-rtl.css") { + $rtl_path = substr($path, 0, -4) . "-rtl.css"; + if (file_exists($rtl_path)) { + $css_files[$name . "-rtl"] = $host . $rtl_path . $query_string; + } + } + } + } + } + } + } + } + if (!empty($theme_info->stylesheets)) { // Grab stylesheets from current theme + foreach ($theme_info->stylesheets as $type => $stylesheets) { + if ($type != "print") { + foreach ($stylesheets as $name => $path) { + if (file_exists($path)) { + $css_files[$name] = $host . $path . $query_string; + // Grab rtl stylesheets ( will get rtl css files when thay are named with suffix "-rtl.css" (ex: fusion baased themes) ) + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL && substr($path, 0, -8) != "-rtl.css") { + $rtl_path = substr($path, 0, -4) . "-rtl.css"; + if (file_exists($rtl_path)) { + $css_files[$name . "-rtl"] = $host . $rtl_path . $query_string; + } + } + } + elseif (!empty($css_files[$name])) { + unset($css_files[$name]); + } + } + } + } + } + // Grab stylesheets local.css and local-rtl.css if they exist (fusion based themes) + if (file_exists($themepath . 'css/local.css')) { + $css_files[] = $host . $themepath . 'css/local.css' . $query_string; + } + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL && file_exists($themepath . 'css/local-rtl.css')) { + $css_files[] = $host . $themepath . 'css/local-rtl.css' . $query_string; + } + + // Grab stylesheets from color module + $color_paths = variable_get('color_' . $current_theme . '_stylesheets', array()); + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { + if (!empty($color_paths[1])) { + $css_files[] = $host . $color_paths[1] . $query_string; + } + } + elseif (!empty($color_paths[0])) { + $css_files[] = $host . $color_paths[0] . $query_string; + } + } + else { + if (!file_exists($themepath . 'ckeditor.css') && file_exists($themepath . 'style.css')) { + $css_files[] = $host . $themepath . 'style.css' . $query_string; + } + } + if (file_exists($module_drupal_path . '/ckeditor.css')) { + $css_files[] = $module_full_path . '/ckeditor.css' . $query_string; + } + if (file_exists($themepath . 'ckeditor.css')) { + $css_files[] = $host . $themepath . 'ckeditor.css' . $query_string; + } + break; + + case 'self': + if (file_exists($module_drupal_path . '/ckeditor.css')) { + $css_files[] = $module_full_path . '/ckeditor.css' . $query_string; + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { + if (file_exists($module_drupal_path . '/ckeditor-rtl.css')) { + $css_files[] = $module_full_path . '/ckeditor-rtl.css' . $query_string; + } + } + } + foreach (explode(',', $conf['css_path']) as $css_path) { + $css_path = trim(str_replace("%h%t", "%t", $css_path)); + $css_files[] = str_replace(array('%h', '%t'), array($host, $host . $themepath), $css_path) . $query_string; + } + break; + + case 'none': + if (file_exists($module_drupal_path . '/ckeditor.css')) { + $css_files[] = $module_full_path . '/ckeditor.css' . $query_string; + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { + if (file_exists($module_drupal_path . '/ckeditor-rtl.css')) { + $css_files[] = $module_full_path . '/ckeditor-rtl.css' . $query_string; + } + } + } + if (file_exists($editor_path . '/contents.css')) { + $css_files[] = $host . $editor_path . '/contents.css' . $query_string; + } + break; + } + + if ($conf['ckeditor_load_method'] == 'ckeditor_source.js') { + foreach ($css_files as $k => $v) { + $css_files[$k] = $v . '&t=' . time(); + } + } + + $settings['contentsCss'] = array_values($css_files); + + if (!empty($conf['uicolor']) && $conf['uicolor'] == "custom" && !empty($conf['uicolor_user'])) { + $settings['uiColor'] = $conf['uicolor_user']; + } + + if (!empty($conf['uicolor']) && strpos($conf['uicolor'], "color_") === 0) { + if (function_exists('color_get_palette')) { + $palette = @color_get_palette($current_theme, FALSE); //[#652274] + $color = str_replace("color_", "", $conf['uicolor']); + if (!empty($palette[$color])) { + $settings['uiColor'] = $palette[$color]; + } + } + } + + return $settings; + +} + +/** + * Load CKEditor for field ID + * + * @param object $field + * @param string $format + * + * @return object + * + */ +function ckeditor_load_by_field( $field, $format, $show_toggle = TRUE, $add_fields_to_toggle = FALSE ) { + global $theme; + static $processed_ids= array(); + static $is_running = FALSE; + $use_ckeditor = FALSE; + $format_arr = FALSE; + $suffix = ''; + + if (is_array($format)){ + $format_arr = $format; + $format = $format_arr['#default_value']; + } + + if (!isset($field['#id'])) { + return $field; + } + + if (isset($processed_ids[$field['#id']])) { + return $field; + } + + if (key_exists('#wysiwyg', $field) && !$field['#wysiwyg']) { + return $field; + } + + if (isset($field['#access']) && !$field['#access']) { + return $field; + } + + if ($field['#id'] == "edit-log") { + return $field; + } + + if (isset($field['#attributes']['disabled']) && $field['#attributes']['disabled'] == 'disabled') { + return $field; + } + + if (!isset($processed_ids[$field['#id']])) { + $processed_ids[$field['#id']] = array(); + } + + $global_profile = ckeditor_profile_load('CKEditor Global Profile'); + $profile = ckeditor_get_profile($format); + $host = base_path(); + + if ($profile === FALSE) { + foreach ((array) $format_arr['#options'] as $key => $val) { + if ($key == $format) continue; + if ($profile = ckeditor_get_profile($key)){ + $use_ckeditor = $key; + break; + } + } + if ($use_ckeditor === FALSE) { + return $field; + } + } + + if ($settings = ckeditor_profiles_compile($format)) { + $textarea_id = $field['#id']; + $class[] = 'ckeditor-mod'; + $_ckeditor_ids[] = $textarea_id; + $ckeditor_on = ($profile->settings['default'] == 't') ? TRUE : FALSE; + + $xss_check = 0; + //it's not a problem when adding new content/comment + if (arg(1) != "add" && arg(1) != "reply") { + //let ckeditor know when perform XSS checks auto/manual + if ($profile->settings['ss'] == 1) { + $xss_class = 'filterxss1'; + } + else { + $xss_class = 'filterxss2'; + } + + $class[]= $xss_class; + $xss_check = 1; + } + + //settings are saved as strings, not booleans + if ($settings['show_toggle'] == 't' && $show_toggle) { + + if ( $add_fields_to_toggle !== FALSE ) { + if ( is_array($add_fields_to_toggle) ) { + $toggle_fields = "['" . $textarea_id . "','" . implode("','", $add_fields_to_toggle) . "']"; + } + else { + $toggle_fields = "['" . $textarea_id . "','" . $add_fields_to_toggle . "']"; + } + } + else { + $toggle_fields = "['{$textarea_id}']"; + } + + $content = ''; + if (isset($field['#value'])) { + $content .= $field['#value']; + } + $wysiwyg_link = ''; + $wysiwyg_link .= ""; + $wysiwyg_link .= $ckeditor_on ? t('Switch to plain text editor') : t('Switch to rich text editor'); + $wysiwyg_link .= ''; + + // Make sure to append to #suffix so it isn't completely overwritten + $suffix .= $wysiwyg_link; + } + + $module_drupal_path = drupal_get_path('module', 'ckeditor'); + $module_full_path = $host . $module_drupal_path; + $editor_path = ckeditor_path(FALSE); + $editor_local_path = ckeditor_path(TRUE); + // get the default drupal files path + $files_path = $host . variable_get('file_private_path', conf_path() . '/files'); + + if (!$is_running) { + drupal_add_js($module_drupal_path . '/includes/ckeditor.utils.js', array('type' => 'file', 'scope' => 'footer') ); + //if ($settings['popup'] != 't') { + if (isset($profile->settings['ckeditor_load_method'])) { + drupal_add_js($editor_path . '/' . $profile->settings['ckeditor_load_method'], array('type' => 'file', 'scope' => 'footer')); + if ($profile->settings['ckeditor_load_method'] == 'ckeditor_basic.js') { + drupal_add_js('CKEDITOR.loadFullCoreTimeout = ' . $profile->settings['ckeditor_load_time_out'] . ';', array('type' => 'inline', 'scope' => 'footer')); + drupal_add_js(array('ckeditor' => array('load_timeout' => TRUE)), 'setting'); + } + } + else { + drupal_add_js($editor_path . '/ckeditor.js', array('type' => 'file', 'scope' => 'footer')); + } + /*} + else { + drupal_add_js($editor_path . '/ckeditor_basic.js', 'file'); + }*/ + drupal_add_js(array('ckeditor' => array('module_path' => $module_full_path, 'editor_path' => base_path() . $editor_path . '/')), 'setting'); + /*if ($settings['popup'] == 't') { + drupal_add_js(array('ckeditor' => array('editor_path' => $editor_path)), 'setting'); + }*/ + if (module_exists('paging')) { + drupal_add_js(array('ckeditor' => array('pagebreak' => TRUE)), 'setting'); + } + if (module_exists('linktocontent_node')) { + drupal_add_js(array('ckeditor' => array('linktocontent_node' => TRUE)), 'setting'); + } + if (module_exists('linktocontent_menu')) { + drupal_add_js(array('ckeditor' => array('linktocontent_menu' => TRUE)), 'setting'); + } + if (module_exists('pagebreak')) { + drupal_add_js(array('ckeditor' => array('pagebreak' => TRUE)), 'setting'); + } + $is_running = TRUE; + } + + drupal_add_js(array('ckeditor' => array('theme' => $theme)), 'setting'); + if (!empty($settings)) { + drupal_add_js(array('ckeditor' => array('elements' => array( $textarea_id => $format ))), 'setting'); + } + if (!empty($ckeditor_on)) { + drupal_add_js(array('ckeditor' => array('autostart' => array( $textarea_id => $ckeditor_on))), 'setting'); + } + if (!empty($field["#language"])) { + drupal_add_js(array('ckeditor' => array('scayt_language' => ckeditor_scayt_langcode($field["#language"]))), 'setting'); + } + /* + if ($settings['popup'] == 't') { + $suffix .= ' "; + } + */ + // Remember extra information and reuse it during "Preview" + $processed_ids[$field['#id']]['suffix'] = $suffix; + $processed_ids[$field['#id']]['class'] = $class; + + if (empty($field['#suffix'])) { + $field['#suffix'] = $suffix; + } + else { + $field['#suffix'] .= $suffix; + } + + if (empty($field['#attributes']['class'])) { + $field['#attributes']['class'] = $class; + } + else { + $field['#attributes']['class'] = array_merge($field['#attributes']['class'], $class); + } + + return $field; + } + + if ($settings = ckeditor_profiles_compile($use_ckeditor)){ + $textarea_id = $field['#id']; + $class[] = 'ckeditor-mod'; + $_ckeditor_ids[] = $textarea_id; + + //settings are saved as strings, not booleans + if ($settings['show_toggle'] == 't' && $show_toggle) { + + if ( $add_fields_to_toggle !== FALSE ) { + if ( is_array($add_fields_to_toggle) ) { + $toggle_fields = "['" . $textarea_id . "','" . implode("','", $add_fields_to_toggle) . "']"; + } + else { + $toggle_fields = "['" . $textarea_id . "','" . $add_fields_to_toggle . "']"; + } + } + else { + $toggle_fields = "['{$textarea_id}']"; + } + + $content = ''; + if (isset($field['#value'])) { + $content .= $field['#value']; + } + $wysiwyg_link = ''; + $wysiwyg_link .= ""; + $wysiwyg_link .= t('Switch to rich text editor'); + $wysiwyg_link .= ''; + + // Make sure to append to #suffix so it isn't completely overwritten + $suffix .= $wysiwyg_link; + } + + $module_drupal_path = drupal_get_path('module', 'ckeditor'); + $module_full_path = $host . $module_drupal_path; + $editor_path = ckeditor_path(FALSE); + $editor_local_path = ckeditor_path(TRUE); + // get the default drupal files path + $files_path = $host . variable_get('file_private_path', conf_path() . '/files'); + + if (!$is_running) { + drupal_add_js($module_drupal_path . '/includes/ckeditor.utils.js', array('type' => 'file', 'scope' => 'footer') ); + //if ($settings['popup'] != 't') { + if (isset($profile->settings['ckeditor_load_method'])) { + drupal_add_js($editor_path . '/' . $profile->settings['ckeditor_load_method'], array('type' => 'file', 'scope' => 'footer')); + if ($profile->settings['ckeditor_load_method'] == 'ckeditor_basic.js') { + drupal_add_js('CKEDITOR.loadFullCoreTimeout = ' . $profile->settings['ckeditor_load_time_out'] . ';', array('type' => 'inline', 'scope' => 'footer')); + drupal_add_js(array('ckeditor' => array('load_timeout' => TRUE)), 'setting'); + } + } + else { + drupal_add_js($editor_path . '/ckeditor.js', array('type' => 'file', 'scope' => 'footer')); + } + /*} + else { + drupal_add_js($editor_path . '/ckeditor_basic.js', 'file'); + }*/ + drupal_add_js(array('ckeditor' => array('module_path' => $module_full_path, 'editor_path' => base_path() . $editor_path . '/')), 'setting'); + /*if ($settings['popup'] == 't') { + drupal_add_js(array('ckeditor' => array('editor_path' => $editor_path)), 'setting'); + }*/ + if (module_exists('paging')) { + drupal_add_js(array('ckeditor' => array('pagebreak' => TRUE)), 'setting'); + } + if (module_exists('linktocontent_node')) { + drupal_add_js(array('ckeditor' => array('linktocontent_node' => TRUE)), 'setting'); + } + if (module_exists('linktocontent_menu')) { + drupal_add_js(array('ckeditor' => array('linktocontent_menu' => TRUE)), 'setting'); + } + if (module_exists('pagebreak')) { + drupal_add_js(array('ckeditor' => array('pagebreak' => TRUE)), 'setting'); + } + $is_running = TRUE; + } + + drupal_add_js(array('ckeditor' => array('theme' => $theme)), 'setting'); + if (!empty($settings)) { + drupal_add_js(array('ckeditor' => array('elements' => array( $textarea_id => $format ))), 'setting'); + } + if (!empty($field["#language"])) { + drupal_add_js(array('ckeditor' => array('scayt_language' => ckeditor_scayt_langcode($field["#language"]))), 'setting'); + } + /* + if ($settings['popup'] == 't') { + $suffix .= ' "; + } + */ + // Remember extra information and reuse it during "Preview" + $processed_ids[$field['#id']]['suffix'] = $suffix; + $processed_ids[$field['#id']]['class'] = $class; + + if (empty($field['#suffix'])) { + $field['#suffix'] = $suffix; + } + else { + $field['#suffix'] .= $suffix; + } + + if (empty($field['#attributes']['class'])) { + $field['#attributes']['class'] = $class; + } + else { + $field['#attributes']['class'] = array_merge($field['#attributes']['class'], $class); + } + + return $field; + } + + return $field; +} diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.page.inc b/docroot/sites/all/modules/ckeditor/includes/ckeditor.page.inc new file mode 100644 index 0000000..c17f719 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.page.inc @@ -0,0 +1,187 @@ +' . t('CKEditor is highly configurable. The most commonly used features are listed below. You can also adjust CKEditor to your needs by changing the %ckeditor_module_config configuration file.', + array( + '%ckeditor_module_config' => drupal_get_path('module', 'ckeditor') . '/ckeditor.config.js', + )) . '

      '; + $output .= '

      ' . t('It is recommended to not edit the %ckeditor_config_file (%ckeditor_config_path) configuration file that is distributed with CKEditor, because you may overwrite it accidentally when you update the editor.', + array( + '%ckeditor_config_path' => ckeditor_path(true) . '/config.js', + '%ckeditor_config_file' => 'config.js', + )) . '

      '; + break; + + case 'admin/config/content/ckeditor/editg': + case 'admin/config/content/ckeditor/add': + $output = '

      ' . t('The Global Profile allows you to define settings that are common for all profiles. Values defined in other profiles will be appended to the global configuration. This way you can avoid repeating some of the settings that are usually the same for each profile.') . '

      '; + break; + + case 'admin/config/content/ckeditor': + $output = + '

      ' . t('The CKEditor module allows Drupal to replace textarea fields with CKEditor. CKEditor is an online rich text editor that can be embedded inside web pages. It is a !wysiwyg editor which means that the text edited in it looks as similar as possible to the results end users will see after the document gets published. It brings to the Web popular editing features found in desktop word processors such as Microsoft Word and OpenOffice.org Writer. CKEditor is truly lightweight and does not require any kind of installation on the client computer.', + array( + '!wysiwyg' => '' . t('WYSIWYG') . '', + )) . '

      ' . + '

      ' . t('Useful links: !ckeditorlink | !devguidelink | !userguidelink.', + array( + '!ckeditorlink' => l(t('CKEditor website'), 'http://ckeditor.com'), + '!devguidelink' => l(t('Developer\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Developers_Guide'), + '!userguidelink' => l(t('User\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Users_Guide') + )) . '

      ' . + '

      ' . t('Profiles are linked with input format types. A CKEditor profile defines which buttons are available in the editor, how the editor is displayed, and a few other editor functions. The Global Profile stores some general information about CKEditor.') . '

      '; + break; + + case 'admin/help#ckeditor': + $output = '

      ' . t('Introduction') . '

      '; + $output .= '

      ' . t('The CKEditor module allows Drupal to replace textarea fields with CKEditor. CKEditor is an online rich text editor that can be embedded inside web pages. It is a !wysiwyg editor which means that the text edited in it looks as similar as possible to the results end users will see after the document gets published. It brings to the Web popular editing features found in desktop word processors such as Microsoft Word and OpenOffice.org Writer. CKEditor is truly lightweight and does not require any kind of installation on the client computer.', + array( + '!wysiwyg' => '' . t('WYSIWYG') . '', + )) . '

      '; + $output .= '

      ' . t('Useful links: !ckeditorlink | !devguidelink | !userguidelink.', + array( + '!ckeditorlink' => l(t('CKEditor website'), 'http://ckeditor.com'), + '!devguidelink' => l(t('Developer\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Developers_Guide'), + '!userguidelink' => l(t('User\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Users_Guide') + )) . '

      '; + $output .= '

      ' . t('Configuration') . '

      '; + $output .= '
        '; + $output .= '
      1. ' . t('Go to the !ckeditorlink and download the latest version of CKEditor. Unpack the contents of the ckeditor directory of the downloaded file to %ckeditordir (or to sites/all/libriaries/ckeditor).', + array( + '!ckeditorlink' => l(t('CKEditor website'), 'http://ckeditor.com/download'), + '%ckeditordir' => base_path() . drupal_get_path('module', 'ckeditor') . '/ckeditor/', + )) . '
      2. '; + $output .= '
      3. ' . t('Enable the module as usual from within Drupal\'s administration pages.') . '
      4. '; + $output .= '
      5. ' . t('Adjust CKEditor profiles in the !adminpath section. Profiles determine which options are available to users based on the input format system.', + array( + '!adminpath' => l(t('Administration panel') . ' > ' . t('Configuration') . ' > ' . t('Content Authoring') . ' > ' . t('CKEditor'), 'admin/config/content/ckeditor'), + )) . '
      6. '; + $output .= '
      7. ' . t('For the Rich Text Editing to work you also need to configure your !filterlink for the users that may access Rich Text Editing. Either grant those users Full HTML access or use the following list of tags in the HTML filter:', + array( + '!filterlink' => l(t('filters'), 'admin/config/content/formats'), + )) . + '
        ' . htmlspecialchars('




       
       
      ') . '
      '; + $output .= t('If you are going to use CKEditor with the Filtered HTML input format, please read the "Setting up filters" section in the !readme file.', + array( + '!readme' => l(t('README.txt'), $base_url . '/' . drupal_get_path('module', 'ckeditor') . '/README.txt', array('absolute' => TRUE)) + )) . ''; + $output .= '
    2. ' . t('To have better control over line breaks, you should disable the %settingname setting in the chosen Text format (recommended).', + array( + '%settingname' => t('Line break converter'), + )) . '
    3. '; + $output .= '
    4. ' . t('Modify the %ckconfig file to adjust CKEditor configuration to your needs (optional). Available configuration settings are available in the !apidocs.', + array( + '%ckconfig' => base_path() . drupal_get_path('module', 'ckeditor') . '/ckeditor/ckeditor.config.js', + '!apidocs' => l(t('API documentation'), 'http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html') + )) . '
    5. '; + $output .= ''; + + $output .= '

      ' . t('Troubleshooting') . '

      '; + $output .= '

      '; + $output .= t('Take a look at !listlink when installing CKEditor.', + array( + '!listlink' => l(t('the list of common problems'), 'http://drupal.ckeditor.com/troubleshooting') + )); + $output .= ' ' . t('If you are looking for more information, have any trouble with the configuration, or found an issue with the CKEditor module, please visit the !officiallink.', array('!officiallink' => l(t('official project page'), 'http://drupal.org/project/ckeditor'))); + $output .= ' ' . t('More information about how to customize CKEditor for your theme can be found !herelink.', array('!herelink' => l(t('here'), 'http://drupal.ckeditor.com/tricks'))); + $output .= '

      '; + + $output .= '

      ' . t('Uploading images and files') . '

      '; + $output .= '

      ' . t('There are three ways for uploading files:') . '

      '; + $output .= '
        '; + $output .= '
      1. ' . t('By using !ckfinder (commercial), an advanced Ajax file manager.', + array( + '!ckfinder' => l(t('CKFinder'), 'http://ckfinder.com'), + )) . '
      2. '; + $output .= '
      3. ' . t('By using a dedicated module like !imcelink.', + array( + '!imcelink' => l(t('IMCE'), 'http://drupal.org/project/imce') + )) . '
      4. '; + $output .= '
      5. ' . t('By using the core upload module.') . '
      6. '; + $output .= '
      '; + + break; + } + return!empty($output) ? $output : ''; +} + +/** + * AJAX callback - XSS filter + */ +function ckeditor_filter_xss() { + $GLOBALS['devel_shutdown'] = FALSE; + + if (!isset($_POST['text']) || !is_string($_POST['text']) || !is_array($_POST['filters']) || !isset($_POST['input_format']) || !is_string($_POST['input_format'])) { + exit; + } + + if (!isset($_POST['textformat_filters']) || $_POST['textformat_filters'] == 'true') { + $text = check_markup($_POST['text'], $_POST['input_format']); + } + else { + $text = $_POST['text']; + } + + $filters = filter_get_filters(); + $format_filters = filter_list_format($_POST['input_format']); + + foreach ($_POST['filters'] as $name) { + if ($name == "default") { + preg_match_all("|]*)>|i", $text, $matches); + if ($matches[1]) { + $tags = array_unique($matches[1]); + $text = filter_xss($text, $tags); + } + continue; + } + + if (!isset($filters[$name]) || !isset($filters[$name]['process callback']) || (array_key_exists($name, $format_filters)) && $format_filters[$name]->status) { + continue; + } + + $text = $filters[$name]['process callback']($text, $format_filters[$name], $_POST['input_format']); + } + + echo $text; +} diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.popup.html b/docroot/sites/all/modules/ckeditor/includes/ckeditor.popup.html new file mode 100644 index 0000000..1d5553d --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.popup.html @@ -0,0 +1,87 @@ + + + + CKEditor + + + + + + + + + + + +
      + +
      + + +
      + + diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.user.inc b/docroot/sites/all/modules/ckeditor/includes/ckeditor.user.inc new file mode 100644 index 0000000..5ae360a --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.user.inc @@ -0,0 +1,174 @@ +data; + + $default = ckeditor_user_get_setting_default(); + $toolbar_options = ckeditor_load_toolbar_options(); + $skin_options = ckeditor_load_skin_options(); + $lang_options = ckeditor_load_lang_options(); + + // because the settings are saved as strings we need to test for the string 'true' + if (user_access('customize ckeditor')) { + $form['ckeditor'] = array( + '#type' => 'fieldset', + '#title' => t('Rich text editor settings'), + '#weight' => 10, + '#collapsible' => TRUE, + '#collapsed' => TRUE + ); + + $form['ckeditor']['ckeditor_default'] = array( + '#type' => 'radios', + '#title' => t('Default state'), + '#default_value' => isset($data['ckeditor_default']) ? $data['ckeditor_default'] : $default['default'], + '#options' => array( + 't' => t('Enabled'), + 'f' => t('Disabled') + ), + '#description' => t('Should rich text editing be enabled or disabled by default in textarea fields? If disabled, the rich text editor may still be enabled by using toggle.'), + ); + + $form['ckeditor']['ckeditor_show_toggle'] = array( + '#type' => 'radios', + '#title' => t('Show the disable/enable rich text editor toggle'), + '#default_value' => isset($data['ckeditor_show_toggle']) ? $data['ckeditor_show_toggle'] : $default['show_toggle'], + '#options' => array( + 't' => t('Yes'), + 'f' => t('No') + ), + '#description' => t('Whether or not to show the disable/enable rich text editor toggle below the textarea.'), + ); +/* + $form['ckeditor']['ckeditor_popup'] = array( + '#type' => 'radios', + '#title' => t('Use CKEditor in a popup window'), + '#default_value' => isset($data['ckeditor_popup']) ? $data['ckeditor_popup'] : $default['popup'], + '#options' => array( + 'f' => t('No'), + 't' => t('Yes') + ), + '#description' => t('If this option is enabled, a link to a popup window will be used instead of a textarea replace.'), + ); +*/ + $form['ckeditor']['ckeditor_skin'] = array( + '#type' => 'select', + '#title' => t('Skin'), + '#default_value' => isset($data['ckeditor_skin']) ? $data['ckeditor_skin'] : $default['skin'], + '#options' => $skin_options, + '#description' => t('Choose a CKEditor skin.'), + ); + + $form['ckeditor']['ckeditor_expand'] = array( + '#type' => 'select', + '#title' => t('Toolbar state on startup'), + '#default_value' => isset($data['ckeditor_expand']) ? $data['ckeditor_expand'] : $default['expand'], + '#options' => array( + 't' => t('Expanded'), + 'f' => t('Collapsed') + ), + '#description' => t('The toolbar will start in an expanded or collapsed state.'), + ); + + $form['ckeditor']['ckeditor_width'] = array( + '#type' => 'textfield', + '#title' => t('Editor width'), + '#default_value' => isset($data['ckeditor_width']) ? $data['ckeditor_width'] : $default['width'], + '#description' => t('Editor interface width in pixels or percent.') . ' ' . t('Examples') . ': 400 ' . t('or') . ' 100%.', + '#size' => 40, + '#maxlength' => 128, + ); + + $form['ckeditor']['ckeditor_lang'] = array( + '#type' => 'select', + '#title' => t('Language'), + '#default_value' => isset($data['ckeditor_lang']) ? $data['ckeditor_lang'] : $default['lang'], + '#options' => $lang_options, + '#description' => t('The language for the CKEditor interface.') + ); + + $form['ckeditor']['ckeditor_auto_lang'] = array( + '#type' => 'radios', + '#title' => t('Auto-detect language'), + '#default_value' => isset($data['ckeditor_auto_lang']) ? $data['ckeditor_auto_lang'] : $default['auto_lang'], + '#options' => array( + 't' => t('Yes'), + 'f' => t('No') + ), + '#description' => t('Automatically detect the user language.') + ); + + $form['#validate'][] = 'ckeditor_user_customize_form_validate'; + + } + +} + +function ckeditor_user_customize_form_validate(&$form, &$form_state) { +/* + if (isset($form_state['values']['ckeditor_default'], $form_state['values']['ckeditor_popup']) && $form_state['values']['ckeditor_default'] == 't' && $form_state['values']['ckeditor_popup'] == 't') { + form_set_error('ckeditor_popup', t('If CKEditor is enabled by default, the popup window must be disabled.')); + } + + if (isset($form_state['values']['ckeditor_show_toggle'], $form_state['values']['ckeditor_popup']) && $form_state['values']['ckeditor_show_toggle'] == 't' && $form_state['values']['ckeditor_popup'] == 't') { + form_set_error('ckeditor_popup', t('If toggle is enabled, the popup window must be disabled.')); + } +*/ + if (isset($form_state['values']['ckeditor_width']) && !preg_match('/^\d+%?$/', $form_state['values']['ckeditor_width'])) { + form_set_error('ckeditor_width', t('Enter a valid width value.') . ' ' . t('Examples:') . ': 400 ' . t('or') . ' 100%.'); + } + +} + +function ckeditor_user_presave(&$edit, $account, $category) { + if (user_access('customize ckeditor')) { + module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib'); + $default = ckeditor_user_get_setting_default(); + + $edit['data']['ckeditor_default'] = isset($edit['ckeditor_default']) ? $edit['ckeditor_default'] : $default['default']; + $edit['data']['ckeditor_show_toggle'] = isset($edit['ckeditor_show_toggle']) ? $edit['ckeditor_show_toggle'] : $default['show_toggle']; + $edit['data']['ckeditor_popup'] = isset($edit['ckeditor_popup']) ? $edit['ckeditor_popup'] : $default['popup']; + $edit['data']['ckeditor_skin'] = isset($edit['ckeditor_skin']) ? $edit['ckeditor_skin'] : $default['skin']; + $edit['data']['ckeditor_expand'] = isset($edit['ckeditor_expand']) ? $edit['ckeditor_expand'] : $default['expand']; + $edit['data']['ckeditor_width'] = isset($edit['ckeditor_width']) ? $edit['ckeditor_width'] : $default['width']; + $edit['data']['ckeditor_lang'] = isset($edit['ckeditor_lang']) ? $edit['ckeditor_lang'] : $default['lang']; + $edit['data']['ckeditor_auto_lang'] = isset($edit['ckeditor_auto_lang']) ? $edit['ckeditor_auto_lang'] : $default['auto_lang']; + } +} diff --git a/docroot/sites/all/modules/ckeditor/includes/ckeditor.utils.js b/docroot/sites/all/modules/ckeditor/includes/ckeditor.utils.js new file mode 100644 index 0000000..2ba9938 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/ckeditor.utils.js @@ -0,0 +1,294 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +window.CKEDITOR_BASEPATH = Drupal.settings.ckeditor.editor_path; +(function ($) { + Drupal.ckeditor = (typeof(CKEDITOR) != 'undefined'); + + Drupal.ckeditorToggle = function(textarea_ids, TextTextarea, TextRTE){ + if (!CKEDITOR.env.isCompatible) { + return; + } + + for (i=0; i 0) && (($("#" + textarea_id).attr('class').indexOf("filterxss1") != -1 && typeof(Drupal.settings.ckeditor.autostart) != 'undefined' && typeof(Drupal.settings.ckeditor.autostart[textarea_id]) != 'undefined') || $("#" + textarea_id).attr('class').indexOf("filterxss2") != -1)) { + $.ajax({ + type: 'POST', + url: Drupal.settings.basePath + 'index.php?q=ckeditor/xss', + async: false, + dataType: 'json', + data: { + text: $('#' + textarea_id).val(), + input_format: ckeditor_obj.elements[textarea_id], + textformat_filters: ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].textformat_filters, + 'filters[]': ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].filters + }, + success: function(text){ + $("#" + textarea_id).val(text); + } + }) + } + + $("#" + textarea_id).next(".grippie").css("display", "none"); + $("#" + textarea_id).addClass("ckeditor-processed"); + + var textarea_settings = false; + ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].toolbar = eval(ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].toolbar); + textarea_settings = ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]]; + + textarea_settings['on'] = + { + configLoaded : function(ev) + { + ev.editor.addCss(ev.editor.config.extraCss); + }, + instanceReady : function(ev) + { + var body = $(ev.editor.document.$.body); + + ev.editor.dataProcessor.writer.setRules('p', { + breakAfterOpen: false + }); + + if (typeof(ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].custom_formatting) != 'undefined') { + var dtd = CKEDITOR.dtd; + for ( var e in CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) { + ev.editor.dataProcessor.writer.setRules( e, ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].custom_formatting); + } + ev.editor.dataProcessor.writer.setRules( 'pre', + { + indent: ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].output_pre_indent + }); + } + + if (ev.editor.config.bodyClass) + body.addClass(ev.editor.config.bodyClass); + if (ev.editor.config.bodyId) + body.attr('id', ev.editor.config.bodyId); + if (typeof(Drupal.smileysAttach) != 'undefined') + ev.editor.dataProcessor.writer.indentationChars = ' '; + }, + focus : function(ev) + { + Drupal.ckeditorInstance = ev.editor; + Drupal.ckeditorActiveId = ev.editor.name; + } + }; + + if (typeof Drupal.settings.ckeditor.scayt_language != 'undefined'){ + textarea_settings['scayt_sLang'] = Drupal.settings.ckeditor.scayt_language; + } + + if (typeof textarea_settings['js_conf'] != 'undefined'){ + for (var add_conf in textarea_settings['js_conf']){ + textarea_settings[add_conf] = eval(textarea_settings['js_conf'][add_conf]); + } + } + + textarea_settings.extraPlugins = ''; + if (typeof CKEDITOR.plugins != 'undefined'){ + for (var plugin in textarea_settings['loadPlugins']){ + textarea_settings.extraPlugins += (textarea_settings.extraPlugins) ? ',' + textarea_settings['loadPlugins'][plugin]['name'] : textarea_settings['loadPlugins'][plugin]['name']; + CKEDITOR.plugins.addExternal(textarea_settings['loadPlugins'][plugin]['name'], textarea_settings['loadPlugins'][plugin]['path']); + } + } + //remove width 100% from settings because this may cause problems with theme css + if (textarea_settings.width == '100%') textarea_settings.width = ''; + Drupal.ckeditorInstance = CKEDITOR.replace(textarea_id, textarea_settings); + }; + + /** + * CKEditor destroy function + * + * @param string textarea_id + */ + Drupal.ckeditorOff = function(textarea_id) { + if (typeof(CKEDITOR.instances[textarea_id]) == 'undefined') { + return; + } + if (!CKEDITOR.env.isCompatible) { + return; + } + if (Drupal.ckeditorInstance && Drupal.ckeditorInstance.name == textarea_id) + delete Drupal.ckeditorInstance; + + $("#" + textarea_id).val(CKEDITOR.instances[textarea_id].getData()); + CKEDITOR.instances[textarea_id].destroy(true); + + $("#" + textarea_id).next(".grippie").css("display", "block"); + }; + + /** + * CKEditor popup mode function + */ + Drupal.ckeditorOpenPopup = function (jsID, textareaID, width){ + var popupUrl = Drupal.settings.ckeditor.module_path + '/includes/ckeditor.popup.html?var=' + jsID + '&el=' + textareaID; + + var percentPos = width.indexOf('%'); + if (percentPos != -1) { + width = width.substr(0, percentPos); + width = width / 100 * screen.width; + } + window.open(popupUrl, null, 'width=' + width + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=1,dependent=yes'); + return false; + }; + + /** + * Returns true if CKEDITOR.version >= version + */ + Drupal.ckeditorCompareVersion = function (version){ + var ckver = CKEDITOR.version; + ckver = ckver.match(/(([\d]\.)+[\d]+)/i); + version = version.match(/((\d+\.)+[\d]+)/i); + ckver = ckver[0].split('.'); + version = version[0].split('.'); + for (var x in ckver) { + if (ckver[x]version[x]) { + return true; + } + } + return true; + }; + + Drupal.ckeditorInsertHtml = function(html) { + if (!Drupal.ckeditorInstance) + return false; + + if (Drupal.ckeditorInstance.mode == 'wysiwyg') { + Drupal.ckeditorInstance.insertHtml(html); + return true; + } + else { + alert(Drupal.t('Content can only be inserted into CKEditor in the WYSIWYG mode.')); + return false; + } + }; + +/** + * Ajax support + */ + if (typeof(Drupal.Ajax) != 'undefined' && typeof(Drupal.Ajax.plugins) != 'undefined') { + Drupal.Ajax.plugins.CKEditor = function(hook, args) { + if (hook === 'submit' && typeof(CKEDITOR.instances) != 'undefined') { + for (var i in CKEDITOR.instances) + CKEDITOR.instances[i].updateElement(); + } + return true; + }; + } + + //Support for Panels [#679976] + Drupal.ckeditorSubmitAjaxForm = function () { + if (typeof(CKEDITOR.instances) != 'undefined' && typeof(CKEDITOR.instances['edit-body']) != 'undefined') { + Drupal.ckeditorOff('edit-body'); + } + }; + +/** + * Drupal behaviors + */ + Drupal.behaviors.ckeditor = { + attach: + function (context) { + if ((typeof(CKEDITOR) == 'undefined') || !CKEDITOR.env.isCompatible) { + return; + } + + // make sure the textarea behavior is run first, to get a correctly sized grippie + if (Drupal.behaviors.textarea && Drupal.behaviors.textarea.attach) { + Drupal.behaviors.textarea.attach(context); + } + + $(context).find("textarea.ckeditor-mod:not(.ckeditor-processed)").each(function () { + var ta_id=$(this).attr("id"); + if (CKEDITOR.instances && typeof(CKEDITOR.instances[ta_id]) != 'undefined'){ + Drupal.ckeditorOff(ta_id); + } + + if ((typeof(Drupal.settings.ckeditor.autostart) != 'undefined') && (typeof(Drupal.settings.ckeditor.autostart[ta_id]) != 'undefined')) { + Drupal.ckeditorOn(ta_id); + } + + if (typeof(Drupal.settings.ckeditor.input_formats[Drupal.settings.ckeditor.elements[ta_id]]) != 'undefined') { + $('.ckeditor_links').show(); + } + + var sel_format = ta_id.substr(0, ta_id.lastIndexOf("-")) + "-format--2"; + $('#'+sel_format).change(function(){ + Drupal.settings.ckeditor.elements[ta_id] = $(this).val(); + if (CKEDITOR.instances[ta_id]) + $('#'+ta_id).val(CKEDITOR.instances[ta_id].getData()); + Drupal.ckeditorOff(ta_id); + if (typeof(Drupal.settings.ckeditor.input_formats[$(this).val()]) != 'undefined'){ + Drupal.ckeditorOn(ta_id, false); + $('#switch_'+ta_id).show(); + } + else { + $('#switch_'+ta_id).hide(); + } + }); + }); + }, + detach: + function(context){ + $(context).find("textarea.ckeditor-mod.ckeditor-processed").each(function () { + var ta_id=$(this).attr("id"); + if (CKEDITOR.instances[ta_id]) + $('#'+ta_id).val(CKEDITOR.instances[ta_id].getData()); + Drupal.ckeditorOff(ta_id); + }).removeClass('ckeditor-processed'); + } + }; +})(jQuery); + +/** + * IMCE support + */ +var ckeditor_imceSendTo = function (file, win){ + var cfunc = win.location.href.split('&'); + + for (var x in cfunc) { + if (cfunc[x].match(/^CKEditorFuncNum=\d+$/)) { + cfunc = cfunc[x].split('='); + break; + } + } + CKEDITOR.tools.callFunction(cfunc[1], file.url); + win.close(); +} diff --git a/docroot/sites/all/modules/ckeditor/includes/filemanager.config.php b/docroot/sites/all/modules/ckeditor/includes/filemanager.config.php new file mode 100644 index 0000000..63adeaa --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/filemanager.config.php @@ -0,0 +1,97 @@ + '', + )) . variable_get('file_private_path', conf_path() . '/files') . '/'; +} diff --git a/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery-ui.js b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery-ui.js new file mode 100644 index 0000000..c1f6b63 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery-ui.js @@ -0,0 +1,11511 @@ +/*! + * jQuery UI 1.8.7 + * + * Copyright 2010, 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( $, undefined ) { + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.8.7", + + keyCode: { + ALT: 18, + BACKSPACE: 8, + CAPS_LOCK: 20, + COMMA: 188, + COMMAND: 91, + COMMAND_LEFT: 91, // COMMAND + COMMAND_RIGHT: 93, + CONTROL: 17, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + INSERT: 45, + LEFT: 37, + MENU: 93, // COMMAND_RIGHT + 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 // COMMAND + } +}); + +// plugins +$.fn.extend({ + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
      + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + if ( border ) { + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; +}); + +// selectors +function visible( element ) { + return !$( element ).parents().andSelf().filter(function() { + return $.curCSS( this, "visibility" ) === "hidden" || + $.expr.filters.hidden( this ); + }).length; +} + +$.extend( $.expr[ ":" ], { + data: function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + var nodeName = element.nodeName.toLowerCase(), + tabIndex = $.attr( element, "tabindex" ); + if ( "area" === nodeName ) { + var map = element.parentNode, + mapName = map.name, + img; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) + ? !element.disabled + : "a" == nodeName + ? element.href || !isNaN( tabIndex ) + : !isNaN( tabIndex )) + // the element and all of its ancestors must be visible + && visible( element ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ); + return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + + + + + +// deprecated +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var proto = $.ui[ module ].prototype; + for ( var i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode ) { + return; + } + + for ( var i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains() + contains: function( a, b ) { + return document.compareDocumentPosition ? + a.compareDocumentPosition( b ) & 16 : + a !== b && a.contains( b ); + }, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +/*! + * jQuery UI Widget 1.8.7 + * + * Copyright 2010, 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/Widget + */ +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + $( elem ).triggerHandler( "remove" ); + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + $( this ).triggerHandler( "remove" ); + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var callback = this.options[ type ]; + + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + data = data || {}; + + // copy original event properties over to the new event + // this would happen if we could call $.event.fix instead of $.Event + // but we don't have a way to force an event to be fixed multiple times + if ( event.originalEvent ) { + for ( var i = $.event.props.length, prop; i; ) { + prop = $.event.props[ --i ]; + event[ prop ] = event.originalEvent[ prop ]; + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); +/*! + * jQuery UI Mouse 1.8.7 + * + * Copyright 2010, 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/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.mouse", { + options: { + cancel: ':input,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var self = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return self._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) { + $.removeData(event.target, self.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + // TODO: figure out why we have to use originalEvent + event.originalEvent = event.originalEvent || {}; + if (event.originalEvent.mouseHandled) { return; } + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var self = this, + btnIsLeft = (event.which == 1), + elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return self._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return self._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + event.originalEvent.mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target == this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +/* + * jQuery UI Draggable 1.8.7 + * + * Copyright 2010, 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/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (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')) return; + this.element + .removeData("draggable") + .unbind(".draggable") + .removeClass("ui-draggable" + + " ui-draggable-dragging" + + " ui-draggable-disabled"); + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.helper.addClass("ui-draggable-dragging"); + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.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'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is removed, don't bother to continue + if(!this.element[0] || !this.element[0].parentNode) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var self = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(self._trigger("stop", event) !== false) { + self._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + 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) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + (o.containment == 'document' ? 0 : $(window).scrollLeft()) - this.offset.relative.left - this.offset.parent.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var ce = $(o.containment)[0]; if(!ce) return; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.extend($.ui.draggable, { + version: "1.8.7" +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), self = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "iframeFix", { + start: function(event, ui) { + var o = $(this).data('draggable').options; + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('
      ') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + }, + stop: function(event, ui) { + $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +/* + * jQuery UI Droppable 1.8.7 + * + * Copyright 2010, 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/Droppables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.mouse.js + * jquery.ui.draggable.js + */ +(function( $, undefined ) { + +$.widget("ui.droppable", { + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element + .removeClass("ui-droppable ui-droppable-disabled") + .removeData("droppable") + .unbind(".droppable"); + + return this; + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.extend($.ui.droppable, { + version: "1.8.7" +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l <= x1 && x2 <= r + && t <= y1 && y2 <= b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = dropped || this._drop.call(this, event); + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + var parent = this.element.parents(':data(droppable):eq(0)'); + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance._out.call(parentInstance, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + } +}; + +})(jQuery); +/* + * jQuery UI Resizable 1.8.7 + * + * Copyright 2010, 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/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var self = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Opera fix for relative positioning + if (/relative/.test(this.element.css('position')) && $.browser.opera) + this.element.css({ position: 'relative', top: 'auto', left: 'auto' }); + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('
      ').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + 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}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { 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' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('
      '); + + // increase zIndex of sw, se, ne, nw axis + //TODO : this modifies original option + if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!self.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + self.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .hover(function() { + $(this).removeClass("ui-resizable-autohide"); + self._handles.show(); + }, + function(){ + if (!self.resizing) { + $(this).addClass("ui-resizable-autohide"); + self._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + wrapper.after( + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }) + ).remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + //Opera fixing relative position + if ($.browser.opera && (/relative/).test(el.css('position'))) + el.css({ position: 'relative', top: 'auto', left: 'auto' }); + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + self = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; + + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, self = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + self.helper.height(self.size.height); + self.helper.width(self.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (data.height) data.width = (csize.height * this.aspectRatio); + else if (data.width) data.height = (csize.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) + continue; + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('
      '); + + // fix ie6 offset TODO: This seems broken + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), + pxyoffset = ( ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, 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 + }; + } + +}); + +$.extend($.ui.resizable, { + version: "1.8.7" +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10), + position: el.css('position') // to reset Opera on stop() + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; + + var delta = { + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + // Opera fixing relative position + if ($.browser.opera && /relative/.test(el.css('position'))) { + self._revertToRelativePosition = true; + el.css({ position: 'absolute', top: 'auto', left: 'auto' }); + } + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _reset = function (exp) { + $(exp).each(function() { + var el = $(this); + // reset position for Opera - no need to verify it was changed + el.css({ position: el.data("resizable-alsoresize").position }); + }); + }; + + if (self._revertToRelativePosition) { + self._revertToRelativePosition = false; + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp) { _reset(exp); }); + }else{ + _reset(o.alsoResize); + } + } + + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + self.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(self.element.css('width'), 10), + height: parseInt(self.element.css('height'), 10), + top: parseInt(self.element.css('top'), 10), + left: parseInt(self.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + self._updateCache(data); + self._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, el = self.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + self.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + self.containerOffset = { left: 0, top: 0 }; + self.containerPosition = { left: 0, top: 0 }; + + self.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + self.containerOffset = element.offset(); + self.containerPosition = element.position(); + self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + self.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, + ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, + pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (self._helper ? co.left : 0)) { + self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); + if (pRatio) self.size.height = self.size.width / o.aspectRatio; + self.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (self._helper ? co.top : 0)) { + self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); + if (pRatio) self.size.width = self.size.height * o.aspectRatio; + self.position.top = self._helper ? co.top : 0; + } + + self.offset.left = self.parentData.left+self.position.left; + self.offset.top = self.parentData.top+self.position.top; + + var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), + hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); + + var isParent = self.containerElement.get(0) == self.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= self.parentData.left; + + if (woset + self.size.width >= self.parentData.width) { + self.size.width = self.parentData.width - woset; + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + } + + if (hoset + self.size.height >= self.parentData.height) { + self.size.height = self.parentData.height - hoset; + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + } + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options, cp = self.position, + co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; + + var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; + + if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (self._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var self = $(this).data("resizable"), o = self.options, cs = self.size; + + self.ghost = self.originalElement.clone(); + self.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + self.ghost.appendTo(self.helper); + + }, + + resize: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.left = op.left - ox; + } + else { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + self.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); +/* + * jQuery UI Selectable 1.8.7 + * + * Copyright 2010, 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/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: function() { + var self = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(self.options.filter, self.element[0]); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("
      "); + }, + + 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(event) { + var self = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + self._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + var self = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == self.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + self._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if (event.metaKey && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var self = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + self._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + self._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +$.extend($.ui.selectable, { + version: "1.8.7" +}); + +})(jQuery); +/* + * jQuery UI Sortable 1.8.7 + * + * Copyright 2010, 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/Sortables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + widgetEventPrefix: "sort", + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are floating + this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + }, + + destroy: function() { + this.element + .removeClass("ui-sortable ui-sortable-disabled") + .removeData("sortable") + .unbind(".sortable"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData("sortable-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget() + [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, self = this, nodes = $(event.target).parents().each(function() { + if($.data(this, 'sortable-item') == self) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, 'sortable-item') == self) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options, self = this; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper 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'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + if(itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var self = this; + var cur = self.placeholder.offset(); + + self.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + self._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + var self = this; + + if(this.dragging) { + + this._mouseUp(); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, self._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, self._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var self = this; + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], 'sortable'); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(sortable-item)"); + + for (var i=0; i < this.items.length; i++) { + + for (var j=0; j < list.length; j++) { + if(list[j] == this.items[i].item[0]) + this.items.splice(i,1); + }; + + }; + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var self = this; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], 'sortable'); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data('sortable-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + + var self = that || this, o = self.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(self.currentItem[0].nodeName)) + .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)); + + //Append it after the actual current item + self.currentItem.after(self.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(self, self.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.ui.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else if(this.currentContainer != this.containers[innermostIndex]) { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top']; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var self = this, counter = this.counter; + + window.setTimeout(function() { + if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + },0); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = [], self = this; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem[0].parentNode) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element + if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + for (var i = this.containers.length - 1; i >= 0; i--){ + if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + } + }; + }; + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(inst) { + var self = inst || this; + return { + helper: self.helper, + placeholder: self.placeholder || $([]), + position: self.position, + originalPosition: self.originalPosition, + offset: self.positionAbs, + item: self.currentItem, + sender: inst ? inst.element : null + }; + } + +}); + +$.extend($.ui.sortable, { + version: "1.8.7" +}); + +})(jQuery); +/* + * jQuery UI Effects 1.8.7 + * + * Copyright 2010, 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/Effects/ + */ +;jQuery.effects || (function($, undefined) { + +$.effects = {}; + + + +/******************************************************************************/ +/****************************** COLOR ANIMATIONS ******************************/ +/******************************************************************************/ + +// override the animation for color styles +$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', + 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'], +function(i, attr) { + $.fx.step[attr] = function(fx) { + if (!fx.colorInit) { + fx.start = getColor(fx.elem, attr); + fx.end = getRGB(fx.end); + fx.colorInit = true; + } + + fx.elem.style[attr] = 'rgb(' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')'; + }; +}); + +// Color Conversion functions from highlightFade +// By Blair Mitchelmore +// http://jquery.offput.ca/highlightFade/ + +// Parse strings looking for color tuples [255,255,255] +function getRGB(color) { + var result; + + // Check if we're already dealing with an array of colors + if ( color && color.constructor == Array && color.length == 3 ) + return color; + + // Look for rgb(num,num,num) + if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) + return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; + + // Look for rgb(num%,num%,num%) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) + return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; + + // Look for #a0b1c2 + if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) + return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; + + // Look for #fff + if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) + return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; + + // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 + if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) + return colors['transparent']; + + // Otherwise, we're most likely dealing with a named color + return colors[$.trim(color).toLowerCase()]; +} + +function getColor(elem, attr) { + var color; + + do { + color = $.curCSS(elem, attr); + + // Keep going until we find an element that has color, or we hit the body + if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") ) + break; + + attr = "backgroundColor"; + } while ( elem = elem.parentNode ); + + return getRGB(color); +}; + +// Some named colors to work with +// From Interface by Stefan Petre +// http://interface.eyecon.ro/ + +var colors = { + aqua:[0,255,255], + azure:[240,255,255], + beige:[245,245,220], + black:[0,0,0], + blue:[0,0,255], + brown:[165,42,42], + cyan:[0,255,255], + darkblue:[0,0,139], + darkcyan:[0,139,139], + darkgrey:[169,169,169], + darkgreen:[0,100,0], + darkkhaki:[189,183,107], + darkmagenta:[139,0,139], + darkolivegreen:[85,107,47], + darkorange:[255,140,0], + darkorchid:[153,50,204], + darkred:[139,0,0], + darksalmon:[233,150,122], + darkviolet:[148,0,211], + fuchsia:[255,0,255], + gold:[255,215,0], + green:[0,128,0], + indigo:[75,0,130], + khaki:[240,230,140], + lightblue:[173,216,230], + lightcyan:[224,255,255], + lightgreen:[144,238,144], + lightgrey:[211,211,211], + lightpink:[255,182,193], + lightyellow:[255,255,224], + lime:[0,255,0], + magenta:[255,0,255], + maroon:[128,0,0], + navy:[0,0,128], + olive:[128,128,0], + orange:[255,165,0], + pink:[255,192,203], + purple:[128,0,128], + violet:[128,0,128], + red:[255,0,0], + silver:[192,192,192], + white:[255,255,255], + yellow:[255,255,0], + transparent: [255,255,255] +}; + + + +/******************************************************************************/ +/****************************** CLASS ANIMATIONS ******************************/ +/******************************************************************************/ + +var classAnimationActions = ['add', 'remove', 'toggle'], + shorthandStyles = { + border: 1, + borderBottom: 1, + borderColor: 1, + borderLeft: 1, + borderRight: 1, + borderTop: 1, + borderWidth: 1, + margin: 1, + padding: 1 + }; + +function getElementStyles() { + var style = document.defaultView + ? document.defaultView.getComputedStyle(this, null) + : this.currentStyle, + newStyle = {}, + key, + camelCase; + + // webkit enumerates style porperties + if (style && style.length && style[0] && style[style[0]]) { + var len = style.length; + while (len--) { + key = style[len]; + if (typeof style[key] == 'string') { + camelCase = key.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + newStyle[camelCase] = style[key]; + } + } + } else { + for (key in style) { + if (typeof style[key] === 'string') { + newStyle[key] = style[key]; + } + } + } + + return newStyle; +} + +function filterStyles(styles) { + var name, value; + for (name in styles) { + value = styles[name]; + if ( + // ignore null and undefined values + value == null || + // ignore functions (when does this occur?) + $.isFunction(value) || + // shorthand styles that need to be expanded + name in shorthandStyles || + // ignore scrollbars (break in IE) + (/scrollbar/).test(name) || + + // only colors or values that can be converted to numbers + (!(/color/i).test(name) && isNaN(parseFloat(value))) + ) { + delete styles[name]; + } + } + + return styles; +} + +function styleDifference(oldStyle, newStyle) { + var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459 + name; + + for (name in newStyle) { + if (oldStyle[name] != newStyle[name]) { + diff[name] = newStyle[name]; + } + } + + return diff; +} + +$.effects.animateClass = function(value, duration, easing, callback) { + if ($.isFunction(easing)) { + callback = easing; + easing = null; + } + + return this.each(function() { + $.queue(this, 'fx', function() { + var that = $(this), + originalStyleAttr = that.attr('style') || ' ', + originalStyle = filterStyles(getElementStyles.call(this)), + newStyle, + className = that.attr('className'); + + $.each(classAnimationActions, function(i, action) { + if (value[action]) { + that[action + 'Class'](value[action]); + } + }); + newStyle = filterStyles(getElementStyles.call(this)); + that.attr('className', className); + + that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() { + $.each(classAnimationActions, function(i, action) { + if (value[action]) { that[action + 'Class'](value[action]); } + }); + // work around bug in IE by clearing the cssText before setting it + if (typeof that.attr('style') == 'object') { + that.attr('style').cssText = ''; + that.attr('style').cssText = originalStyleAttr; + } else { + that.attr('style', originalStyleAttr); + } + if (callback) { callback.apply(this, arguments); } + }); + + // $.animate adds a function to the end of the queue + // but we want it at the front + var queue = $.queue(this), + anim = queue.splice(queue.length - 1, 1)[0]; + queue.splice(1, 0, anim); + $.dequeue(this); + }); + }); +}; + +$.fn.extend({ + _addClass: $.fn.addClass, + addClass: function(classNames, speed, easing, callback) { + return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); + }, + + _removeClass: $.fn.removeClass, + removeClass: function(classNames,speed,easing,callback) { + return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); + }, + + _toggleClass: $.fn.toggleClass, + toggleClass: function(classNames, force, speed, easing, callback) { + if ( typeof force == "boolean" || force === undefined ) { + if ( !speed ) { + // without speed parameter; + return this._toggleClass(classNames, force); + } else { + return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]); + } + } else { + // without switch parameter; + return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]); + } + }, + + switchClass: function(remove,add,speed,easing,callback) { + return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); + } +}); + + + +/******************************************************************************/ +/*********************************** EFFECTS **********************************/ +/******************************************************************************/ + +$.extend($.effects, { + version: "1.8.7", + + // Saves a set of properties in a data storage + save: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]); + } + }, + + // Restores a set of previously saved properties from a data storage + restore: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i])); + } + }, + + setMode: function(el, mode) { + if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle + return mode; + }, + + getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value + // this should be a little more flexible in the future to handle a string & hash + var y, x; + switch (origin[0]) { + case 'top': y = 0; break; + case 'middle': y = 0.5; break; + case 'bottom': y = 1; break; + default: y = origin[0] / original.height; + }; + switch (origin[1]) { + case 'left': x = 0; break; + case 'center': x = 0.5; break; + case 'right': x = 1; break; + default: x = origin[1] / original.width; + }; + return {x: x, y: y}; + }, + + // Wraps the element around a wrapper that copies position properties + createWrapper: function(element) { + + // if the element is already wrapped, return it + if (element.parent().is('.ui-effects-wrapper')) { + return element.parent(); + } + + // wrap the element + var props = { + width: element.outerWidth(true), + height: element.outerHeight(true), + 'float': element.css('float') + }, + wrapper = $('
      ') + .addClass('ui-effects-wrapper') + .css({ + fontSize: '100%', + background: 'transparent', + border: 'none', + margin: 0, + padding: 0 + }); + + element.wrap(wrapper); + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element + + // transfer positioning properties to the wrapper + if (element.css('position') == 'static') { + wrapper.css({ position: 'relative' }); + element.css({ position: 'relative' }); + } else { + $.extend(props, { + position: element.css('position'), + zIndex: element.css('z-index') + }); + $.each(['top', 'left', 'bottom', 'right'], function(i, pos) { + props[pos] = element.css(pos); + if (isNaN(parseInt(props[pos], 10))) { + props[pos] = 'auto'; + } + }); + element.css({position: 'relative', top: 0, left: 0 }); + } + + return wrapper.css(props).show(); + }, + + removeWrapper: function(element) { + if (element.parent().is('.ui-effects-wrapper')) + return element.parent().replaceWith(element); + return element; + }, + + setTransition: function(element, list, factor, value) { + value = value || {}; + $.each(list, function(i, x){ + unit = element.cssUnit(x); + if (unit[0] > 0) value[x] = unit[0] * factor + unit[1]; + }); + return value; + } +}); + + +function _normalizeArguments(effect, options, speed, callback) { + // shift params for method overloading + if (typeof effect == 'object') { + callback = options; + speed = null; + options = effect; + effect = options.effect; + } + if ($.isFunction(options)) { + callback = options; + speed = null; + options = {}; + } + if (typeof options == 'number' || $.fx.speeds[options]) { + callback = speed; + speed = options; + options = {}; + } + if ($.isFunction(speed)) { + callback = speed; + speed = null; + } + + options = options || {}; + + speed = speed || options.duration; + speed = $.fx.off ? 0 : typeof speed == 'number' + ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default; + + callback = callback || options.complete; + + return [effect, options, speed, callback]; +} + +function standardSpeed( speed ) { + // valid standard speeds + if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { + return true; + } + + // invalid strings - treat as "normal" speed + if ( typeof speed === "string" && !$.effects[ speed ] ) { + return true; + } + + return false; +} + +$.fn.extend({ + effect: function(effect, options, speed, callback) { + var args = _normalizeArguments.apply(this, arguments), + // TODO: make effects take actual parameters instead of a hash + args2 = { + options: args[1], + duration: args[2], + callback: args[3] + }, + mode = args2.options.mode, + effectMethod = $.effects[effect]; + + if ( $.fx.off || !effectMethod ) { + // delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args2.duration, args2.callback ); + } else { + return this.each(function() { + if ( args2.callback ) { + args2.callback.call( this ); + } + }); + } + } + + return effectMethod.call(this, args2); + }, + + _show: $.fn.show, + show: function(speed) { + if ( standardSpeed( speed ) ) { + return this._show.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'show'; + return this.effect.apply(this, args); + } + }, + + _hide: $.fn.hide, + hide: function(speed) { + if ( standardSpeed( speed ) ) { + return this._hide.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'hide'; + return this.effect.apply(this, args); + } + }, + + // jQuery core overloads toggle and creates _toggle + __toggle: $.fn.toggle, + toggle: function(speed) { + if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { + return this.__toggle.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'toggle'; + return this.effect.apply(this, args); + } + }, + + // helper functions + cssUnit: function(key) { + var style = this.css(key), val = []; + $.each( ['em','px','%','pt'], function(i, unit){ + if(style.indexOf(unit) > 0) + val = [parseFloat(style), unit]; + }); + return val; + } +}); + + + +/******************************************************************************/ +/*********************************** EASING ***********************************/ +/******************************************************************************/ + +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built in easing capabilities added In jQuery 1.1 + * to offer multiple easing options + * + * TERMS OF USE - jQuery Easing + * + * Open source under the BSD License. + * + * Copyright 2008 George McGinley Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * +*/ + +// t: current time, b: begInnIng value, c: change In value, d: duration +$.easing.jswing = $.easing.swing; + +$.extend($.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert($.easing.default); + return $.easing[$.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +})(jQuery); +/* + * jQuery UI Effects Blind 1.8.7 + * + * Copyright 2010, 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/Effects/Blind + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.blind = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'vertical') ? 'height' : 'width'; + var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); + if(mode == 'show') wrapper.css(ref, 0); // Shift + + // Animation + var animation = {}; + animation[ref] = mode == 'show' ? distance : 0; + + // Animate + wrapper.animate(animation, o.duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Bounce 1.8.7 + * + * Copyright 2010, 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/Effects/Bounce + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.bounce = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'up'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 5; // Default # of times + var speed = o.duration || 250; // Default speed per bounce + if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + if (mode == 'hide') distance = distance / (times * 2); + if (mode != 'hide') times--; + + // Animate + if (mode == 'show') { // Show Bounce + var animation = {opacity: 1}; + animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation, speed / 2, o.options.easing); + distance = distance / 2; + times--; + }; + for (var i = 0; i < times; i++) { // Bounces + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing); + distance = (mode == 'hide') ? distance * 2 : distance / 2; + }; + if (mode == 'hide') { // Last Bounce + var animation = {opacity: 0}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + el.animate(animation, speed / 2, o.options.easing, function(){ + el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + } else { + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){ + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + }; + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Clip 1.8.7 + * + * Copyright 2010, 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/Effects/Clip + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.clip = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','height','width']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var animate = el[0].tagName == 'IMG' ? wrapper : el; + var ref = { + size: (direction == 'vertical') ? 'height' : 'width', + position: (direction == 'vertical') ? 'top' : 'left' + }; + var distance = (direction == 'vertical') ? animate.height() : animate.width(); + if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift + + // Animation + var animation = {}; + animation[ref.size] = mode == 'show' ? distance : 0; + animation[ref.position] = mode == 'show' ? 0 : distance / 2; + + // Animate + animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Drop 1.8.7 + * + * Copyright 2010, 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/Effects/Drop + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.drop = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','opacity']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + + // Animation + var animation = {opacity: mode == 'show' ? 1 : 0}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Explode 1.8.7 + * + * Copyright 2010, 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/Effects/Explode + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.explode = function(o) { + + return this.queue(function() { + + var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + + o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode; + var el = $(this).show().css('visibility', 'hidden'); + var offset = el.offset(); + + //Substract the margins - not fixing the problem yet. + offset.top -= parseInt(el.css("marginTop"),10) || 0; + offset.left -= parseInt(el.css("marginLeft"),10) || 0; + + var width = el.outerWidth(true); + var height = el.outerHeight(true); + + for(var i=0;i') + .css({ + position: 'absolute', + visibility: 'visible', + left: -j*(width/cells), + top: -i*(height/rows) + }) + .parent() + .addClass('ui-effects-explode') + .css({ + position: 'absolute', + overflow: 'hidden', + width: width/cells, + height: height/rows, + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0), + opacity: o.options.mode == 'show' ? 0 : 1 + }).animate({ + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)), + opacity: o.options.mode == 'show' ? 1 : 0 + }, o.duration || 500); + } + } + + // Set a timeout, to call the callback approx. when the other animations have finished + setTimeout(function() { + + o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide(); + if(o.callback) o.callback.apply(el[0]); // Callback + el.dequeue(); + + $('div.ui-effects-explode').remove(); + + }, o.duration || 500); + + + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Fade 1.8.7 + * + * Copyright 2010, 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/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fade = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'); + + elem.animate({ opacity: mode }, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); +/* + * jQuery UI Effects Fold 1.8.7 + * + * Copyright 2010, 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/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fold = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var size = o.options.size || 15; // Default fold size + var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value + var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var widthFirst = ((mode == 'show') != horizFirst); + var ref = widthFirst ? ['width', 'height'] : ['height', 'width']; + var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()]; + var percent = /([0-9]+)%/.exec(size); + if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1]; + if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift + + // Animation + var animation1 = {}, animation2 = {}; + animation1[ref[0]] = mode == 'show' ? distance[0] : size; + animation2[ref[1]] = mode == 'show' ? distance[1] : 0; + + // Animate + wrapper.animate(animation1, duration, o.options.easing) + .animate(animation2, duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Highlight 1.8.7 + * + * Copyright 2010, 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/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.highlight = function(o) { + return this.queue(function() { + var elem = $(this), + props = ['backgroundImage', 'backgroundColor', 'opacity'], + mode = $.effects.setMode(elem, o.options.mode || 'show'), + animation = { + backgroundColor: elem.css('backgroundColor') + }; + + if (mode == 'hide') { + animation.opacity = 0; + } + + $.effects.save(elem, props); + elem + .show() + .css({ + backgroundImage: 'none', + backgroundColor: o.options.color || '#ffff99' + }) + .animate(animation, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (mode == 'hide' && elem.hide()); + $.effects.restore(elem, props); + (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter')); + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); +/* + * jQuery UI Effects Pulsate 1.8.7 + * + * Copyright 2010, 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/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.pulsate = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'show'); + times = ((o.options.times || 5) * 2) - 1; + duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2, + isVisible = elem.is(':visible'), + animateTo = 0; + + if (!isVisible) { + elem.css('opacity', 0).show(); + animateTo = 1; + } + + if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) { + times--; + } + + for (var i = 0; i < times; i++) { + elem.animate({ opacity: animateTo }, duration, o.options.easing); + animateTo = (animateTo + 1) % 2; + } + + elem.animate({ opacity: animateTo }, duration, o.options.easing, function() { + if (animateTo == 0) { + elem.hide(); + } + (o.callback && o.callback.apply(this, arguments)); + }); + + elem + .queue('fx', function() { elem.dequeue(); }) + .dequeue(); + }); +}; + +})(jQuery); +/* + * jQuery UI Effects Scale 1.8.7 + * + * Copyright 2010, 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/Effects/Scale + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.puff = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'), + percent = parseInt(o.options.percent, 10) || 150, + factor = percent / 100, + original = { height: elem.height(), width: elem.width() }; + + $.extend(o.options, { + fade: true, + mode: mode, + percent: mode == 'hide' ? percent : 100, + from: mode == 'hide' + ? original + : { + height: original.height * factor, + width: original.width * factor + } + }); + + elem.effect('scale', o.options, o.duration, o.callback); + elem.dequeue(); + }); +}; + +$.effects.scale = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var options = $.extend(true, {}, o.options); + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent + var direction = o.options.direction || 'both'; // Set default axis + var origin = o.options.origin; // The origin of the scaling + if (mode != 'effect') { // Set default origin and restore for show/hide + options.origin = origin || ['middle','center']; + options.restore = true; + } + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state + + // Adjust + var factor = { // Set scaling factor + y: direction != 'horizontal' ? (percent / 100) : 1, + x: direction != 'vertical' ? (percent / 100) : 1 + }; + el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state + + if (o.options.fade) { // Fade option to support puff + if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; + if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; + }; + + // Animation + options.from = el.from; options.to = el.to; options.mode = mode; + + // Animate + el.effect('size', options, o.duration, o.callback); + el.dequeue(); + }); + +}; + +$.effects.size = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','width','height','overflow','opacity']; + var props1 = ['position','top','left','overflow','opacity']; // Always restore + var props2 = ['width','height','overflow']; // Copy for children + var cProps = ['fontSize']; + var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; + var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var restore = o.options.restore || false; // Default restore + var scale = o.options.scale || 'both'; // Default scale mode + var origin = o.options.origin; // The origin of the sizing + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || original; // Default from state + el.to = o.options.to || original; // Default to state + // Adjust + if (origin) { // Calculate baseline shifts + var baseline = $.effects.getBaseline(origin, original); + el.from.top = (original.height - el.from.height) * baseline.y; + el.from.left = (original.width - el.from.width) * baseline.x; + el.to.top = (original.height - el.to.height) * baseline.y; + el.to.left = (original.width - el.to.width) * baseline.x; + }; + var factor = { // Set scaling factor + from: {y: el.from.height / original.height, x: el.from.width / original.width}, + to: {y: el.to.height / original.height, x: el.to.width / original.width} + }; + if (scale == 'box' || scale == 'both') { // Scale the css box + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(vProps); + el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + props = props.concat(hProps); + el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from); + el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to); + }; + }; + if (scale == 'content' || scale == 'both') { // Scale the content + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(cProps); + el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to); + }; + }; + $.effects.save(el, restore ? props : props1); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + el.css('overflow','hidden').css(el.from); // Shift + + // Animate + if (scale == 'content' || scale == 'both') { // Scale the children + vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size + hProps = hProps.concat(['marginLeft','marginRight']); // Add margins + props2 = props.concat(vProps).concat(hProps); // Concat + el.find("*[width]").each(function(){ + child = $(this); + if (restore) $.effects.save(child, props2); + var c_original = {height: child.height(), width: child.width()}; // Save original + child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x}; + child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x}; + if (factor.from.y != factor.to.y) { // Vertical props scaling + child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from); + child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from); + child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to); + }; + child.css(child.from); // Shift children + child.animate(child.to, o.duration, o.options.easing, function(){ + if (restore) $.effects.restore(child, props2); // Restore children + }); // Animate children + }); + }; + + // Animate + el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if (el.to.opacity === 0) { + el.css('opacity', el.from.opacity); + } + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Shake 1.8.7 + * + * Copyright 2010, 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/Effects/Shake + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.shake = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'left'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 3; // Default # of times + var speed = o.duration || o.options.duration || 140; // Default speed per shake + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + + // Animation + var animation = {}, animation1 = {}, animation2 = {}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2; + animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2; + + // Animate + el.animate(animation, speed, o.options.easing); + for (var i = 1; i < times; i++) { // Shakes + el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing); + }; + el.animate(animation1, speed, o.options.easing). + animate(animation, speed / 2, o.options.easing, function(){ // Last shake + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Slide 1.8.7 + * + * Copyright 2010, 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/Effects/Slide + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.slide = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); + if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift + + // Animation + var animation = {}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/* + * jQuery UI Effects Transfer 1.8.7 + * + * Copyright 2010, 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/Effects/Transfer + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.transfer = function(o) { + return this.queue(function() { + var elem = $(this), + target = $(o.options.to), + endPosition = target.offset(), + animation = { + top: endPosition.top, + left: endPosition.left, + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $('
      ') + .appendTo(document.body) + .addClass(o.options.className) + .css({ + top: startPosition.top, + left: startPosition.left, + height: elem.innerHeight(), + width: elem.innerWidth(), + position: 'absolute' + }) + .animate(animation, o.duration, o.options.easing, function() { + transfer.remove(); + (o.callback && o.callback.apply(elem[0], arguments)); + elem.dequeue(); + }); + }); +}; + +})(jQuery); +/* + * jQuery UI Accordion 1.8.7 + * + * Copyright 2010, 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/Accordion + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.accordion", { + options: { + active: 0, + animated: "slide", + autoHeight: true, + clearStyle: false, + collapsible: false, + event: "click", + fillSpace: false, + header: "> li > :first-child,> :not(li):even", + icons: { + header: "ui-icon-triangle-1-e", + headerSelected: "ui-icon-triangle-1-s" + }, + navigation: false, + navigationFilter: function() { + return this.href.toLowerCase() === location.href.toLowerCase(); + } + }, + + _create: function() { + var self = this, + options = self.options; + + self.running = 0; + + self.element + .addClass( "ui-accordion ui-widget ui-helper-reset" ) + // in lack of child-selectors in CSS + // we need to mark top-LIs in a UL-accordion for some IE-fix + .children( "li" ) + .addClass( "ui-accordion-li-fix" ); + + self.headers = self.element.find( options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ) + .bind( "mouseenter.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + }) + .bind( "mouseleave.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( "ui-state-hover" ); + }) + .bind( "focus.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-focus" ); + }) + .bind( "blur.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( "ui-state-focus" ); + }); + + self.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ); + + if ( options.navigation ) { + var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 ); + if ( current.length ) { + var header = current.closest( ".ui-accordion-header" ); + if ( header.length ) { + // anchor within header + self.active = header; + } else { + // anchor within content + self.active = current.closest( ".ui-accordion-content" ).prev(); + } + } + } + + self.active = self._findActive( self.active || options.active ) + .addClass( "ui-state-default ui-state-active" ) + .toggleClass( "ui-corner-all" ) + .toggleClass( "ui-corner-top" ); + self.active.next().addClass( "ui-accordion-content-active" ); + + self._createIcons(); + self.resize(); + + // ARIA + self.element.attr( "role", "tablist" ); + + self.headers + .attr( "role", "tab" ) + .bind( "keydown.accordion", function( event ) { + return self._keydown( event ); + }) + .next() + .attr( "role", "tabpanel" ); + + self.headers + .not( self.active || "" ) + .attr({ + "aria-expanded": "false", + tabIndex: -1 + }) + .next() + .hide(); + + // make sure at least one header is in the tab order + if ( !self.active.length ) { + self.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + self.active + .attr({ + "aria-expanded": "true", + tabIndex: 0 + }); + } + + // only need links in tab order for Safari + if ( !$.browser.safari ) { + self.headers.find( "a" ).attr( "tabIndex", -1 ); + } + + if ( options.event ) { + self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) { + self._clickHandler.call( self, event, this ); + event.preventDefault(); + }); + } + }, + + _createIcons: function() { + var options = this.options; + if ( options.icons ) { + $( "" ) + .addClass( "ui-icon " + options.icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-icon" ) + .toggleClass(options.icons.header) + .toggleClass(options.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 options = 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( "tabIndex" ); + + this.headers.find( "a" ).removeAttr( "tabIndex" ); + this._destroyIcons(); + var contents = 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" ); + if ( options.autoHeight || options.fillHeight ) { + contents.css( "height", "" ); + } + + return $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + + if ( key == "active" ) { + this.activate( value ); + } + if ( key == "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key == "disabled" ) { + this.headers.add(this.headers.next()) + [ value ? "addClass" : "removeClass" ]( + "ui-accordion-disabled ui-state-disabled" ); + } + }, + + _keydown: function( event ) { + if ( this.options.disabled || event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._clickHandler( { target: event.target }, event.target ); + event.preventDefault(); + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + return false; + } + + return true; + }, + + resize: function() { + var options = this.options, + maxHeight; + + if ( options.fillSpace ) { + if ( $.browser.msie ) { + var defOverflow = this.element.parent().css( "overflow" ); + this.element.parent().css( "overflow", "hidden"); + } + maxHeight = this.element.parent().height(); + if ($.browser.msie) { + this.element.parent().css( "overflow", defOverflow ); + } + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( options.autoHeight ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); + }) + .height( maxHeight ); + } + + return this; + }, + + activate: function( index ) { + // TODO this gets called on init, changing the option without an explicit call for that + this.options.active = index; + // call clickHandler with custom event + var active = this._findActive( index )[ 0 ]; + this._clickHandler( { target: active }, active ); + + return this; + }, + + _findActive: function( selector ) { + return selector + ? typeof selector === "number" + ? this.headers.filter( ":eq(" + selector + ")" ) + : this.headers.not( this.headers.not( selector ) ) + : selector === false + ? $( [] ) + : this.headers.filter( ":eq(0)" ); + }, + + // TODO isn't event.target enough? why the separate target argument? + _clickHandler: function( event, target ) { + var options = this.options; + if ( options.disabled ) { + return; + } + + // called only when using activate(false) to close all parts programmatically + if ( !event.target ) { + if ( !options.collapsible ) { + return; + } + this.active + .removeClass( "ui-state-active ui-corner-top" ) + .addClass( "ui-state-default ui-corner-all" ) + .children( ".ui-icon" ) + .removeClass( options.icons.headerSelected ) + .addClass( options.icons.header ); + this.active.next().addClass( "ui-accordion-content-active" ); + var toHide = this.active.next(), + data = { + options: options, + newHeader: $( [] ), + oldHeader: options.active, + newContent: $( [] ), + oldContent: toHide + }, + toShow = ( this.active = $( [] ) ); + this._toggle( toShow, toHide, data ); + return; + } + + // get the click target + var clicked = $( event.currentTarget || target ), + clickedIsActive = clicked[0] === this.active[0]; + + // TODO the option is changed, is that correct? + // TODO if it is correct, shouldn't that happen after determining that the click is valid? + options.active = options.collapsible && clickedIsActive ? + false : + this.headers.index( clicked ); + + // if animations are still active, or the active header is the target, ignore click + if ( this.running || ( !options.collapsible && clickedIsActive ) ) { + return; + } + + // switch classes + this.active + .removeClass( "ui-state-active ui-corner-top" ) + .addClass( "ui-state-default ui-corner-all" ) + .children( ".ui-icon" ) + .removeClass( options.icons.headerSelected ) + .addClass( options.icons.header ); + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-state-default ui-corner-all" ) + .addClass( "ui-state-active ui-corner-top" ) + .children( ".ui-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.headerSelected ); + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + + // find elements to show and hide + var toShow = clicked.next(), + toHide = this.active.next(), + data = { + options: options, + newHeader: clickedIsActive && options.collapsible ? $([]) : clicked, + oldHeader: this.active, + newContent: clickedIsActive && options.collapsible ? $([]) : toShow, + oldContent: toHide + }, + down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] ); + + this.active = clickedIsActive ? $([]) : clicked; + this._toggle( toShow, toHide, data, clickedIsActive, down ); + + return; + }, + + _toggle: function( toShow, toHide, data, clickedIsActive, down ) { + var self = this, + options = self.options; + + self.toShow = toShow; + self.toHide = toHide; + self.data = data; + + var complete = function() { + if ( !self ) { + return; + } + return self._completed.apply( self, arguments ); + }; + + // trigger changestart event + self._trigger( "changestart", null, self.data ); + + // count elements to animate + self.running = toHide.size() === 0 ? toShow.size() : toHide.size(); + + if ( options.animated ) { + var animOptions = {}; + + if ( options.collapsible && clickedIsActive ) { + animOptions = { + toShow: $( [] ), + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight || options.fillSpace + }; + } else { + animOptions = { + toShow: toShow, + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight || options.fillSpace + }; + } + + if ( !options.proxied ) { + options.proxied = options.animated; + } + + if ( !options.proxiedDuration ) { + options.proxiedDuration = options.duration; + } + + options.animated = $.isFunction( options.proxied ) ? + options.proxied( animOptions ) : + options.proxied; + + options.duration = $.isFunction( options.proxiedDuration ) ? + options.proxiedDuration( animOptions ) : + options.proxiedDuration; + + var animations = $.ui.accordion.animations, + duration = options.duration, + easing = options.animated; + + if ( easing && !animations[ easing ] && !$.easing[ easing ] ) { + easing = "slide"; + } + if ( !animations[ easing ] ) { + animations[ easing ] = function( options ) { + this.slide( options, { + easing: easing, + duration: duration || 700 + }); + }; + } + + animations[ easing ]( animOptions ); + } else { + if ( options.collapsible && clickedIsActive ) { + toShow.toggle(); + } else { + toHide.hide(); + toShow.show(); + } + + complete( true ); + } + + // TODO assert that the blur and focus triggers are really necessary, remove otherwise + toHide.prev() + .attr({ + "aria-expanded": "false", + tabIndex: -1 + }) + .blur(); + toShow.prev() + .attr({ + "aria-expanded": "true", + tabIndex: 0 + }) + .focus(); + }, + + _completed: function( cancel ) { + this.running = cancel ? 0 : --this.running; + if ( this.running ) { + return; + } + + if ( this.options.clearStyle ) { + this.toShow.add( this.toHide ).css({ + height: "", + overflow: "" + }); + } + + // other classes are removed before the animation; this one needs to stay until completed + this.toHide.removeClass( "ui-accordion-content-active" ); + + this._trigger( "change", null, this.data ); + } +}); + +$.extend( $.ui.accordion, { + version: "1.8.7", + animations: { + slide: function( options, additions ) { + options = $.extend({ + easing: "swing", + duration: 300 + }, options, additions ); + if ( !options.toHide.size() ) { + options.toShow.animate({ + height: "show", + paddingTop: "show", + paddingBottom: "show" + }, options ); + return; + } + if ( !options.toShow.size() ) { + options.toHide.animate({ + height: "hide", + paddingTop: "hide", + paddingBottom: "hide" + }, options ); + return; + } + var overflow = options.toShow.css( "overflow" ), + percentDone = 0, + showProps = {}, + hideProps = {}, + fxAttrs = [ "height", "paddingTop", "paddingBottom" ], + originalWidth; + // fix width before calculating height of hidden element + var s = options.toShow; + originalWidth = s[0].style.width; + s.width( parseInt( s.parent().width(), 10 ) + - parseInt( s.css( "paddingLeft" ), 10 ) + - parseInt( s.css( "paddingRight" ), 10 ) + - ( parseInt( s.css( "borderLeftWidth" ), 10 ) || 0 ) + - ( parseInt( s.css( "borderRightWidth" ), 10) || 0 ) ); + + $.each( fxAttrs, function( i, prop ) { + hideProps[ prop ] = "hide"; + + var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ ); + showProps[ prop ] = { + value: parts[ 1 ], + unit: parts[ 2 ] || "px" + }; + }); + options.toShow.css({ height: 0, overflow: "hidden" }).show(); + options.toHide + .filter( ":hidden" ) + .each( options.complete ) + .end() + .filter( ":visible" ) + .animate( hideProps, { + step: function( now, settings ) { + // only calculate the percent when animating height + // IE gets very inconsistent results when animating elements + // with small values, which is common for padding + if ( settings.prop == "height" ) { + percentDone = ( settings.end - settings.start === 0 ) ? 0 : + ( settings.now - settings.start ) / ( settings.end - settings.start ); + } + + options.toShow[ 0 ].style[ settings.prop ] = + ( percentDone * showProps[ settings.prop ].value ) + + showProps[ settings.prop ].unit; + }, + duration: options.duration, + easing: options.easing, + complete: function() { + if ( !options.autoHeight ) { + options.toShow.css( "height", "" ); + } + options.toShow.css({ + width: originalWidth, + overflow: overflow + }); + options.complete(); + } + }); + }, + bounceslide: function( options ) { + this.slide( options, { + easing: options.down ? "easeOutBounce" : "swing", + duration: options.down ? 1000 : 200 + }); + } + } +}); + +})( jQuery ); +/* + * jQuery UI Autocomplete 1.8.7 + * + * Copyright 2010, 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/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function( $, undefined ) { + +$.widget( "ui.autocomplete", { + options: { + appendTo: "body", + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null + }, + _create: function() { + var self = this, + doc = this.element[ 0 ].ownerDocument, + suppressKeyPress; + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ) + // TODO verify these actually work as intended + .attr({ + role: "textbox", + "aria-autocomplete": "list", + "aria-haspopup": "true" + }) + .bind( "keydown.autocomplete", function( event ) { + if ( self.options.disabled || self.element.attr( "readonly" ) ) { + return; + } + + suppressKeyPress = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + self._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + self._move( "nextPage", event ); + break; + case keyCode.UP: + self._move( "previous", event ); + // prevent moving cursor to beginning of text field in some browsers + event.preventDefault(); + break; + case keyCode.DOWN: + self._move( "next", event ); + // prevent moving cursor to end of text field in some browsers + event.preventDefault(); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( self.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + } + //passthrough - ENTER and TAB both select the current element + case keyCode.TAB: + if ( !self.menu.active ) { + return; + } + self.menu.select( event ); + break; + case keyCode.ESCAPE: + self.element.val( self.term ); + self.close( event ); + break; + default: + // keypress is triggered before the input value is changed + clearTimeout( self.searching ); + self.searching = setTimeout(function() { + // only search if the value has changed + if ( self.term != self.element.val() ) { + self.selectedItem = null; + self.search( null, event ); + } + }, self.options.delay ); + break; + } + }) + .bind( "keypress.autocomplete", function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + } + }) + .bind( "focus.autocomplete", function() { + if ( self.options.disabled ) { + return; + } + + self.selectedItem = null; + self.previous = self.element.val(); + }) + .bind( "blur.autocomplete", function( event ) { + if ( self.options.disabled ) { + return; + } + + clearTimeout( self.searching ); + // clicks on the menu (or a button to trigger a search) will cause a blur event + self.closing = setTimeout(function() { + self.close( event ); + self._change( event ); + }, 150 ); + }); + this._initSource(); + this.response = function() { + return self._response.apply( self, arguments ); + }; + this.menu = $( "
        " ) + .addClass( "ui-autocomplete" ) + .appendTo( $( this.options.appendTo || "body", doc )[0] ) + // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown) + .mousedown(function( event ) { + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = self.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + setTimeout(function() { + $( document ).one( 'mousedown', function( event ) { + if ( event.target !== self.element[ 0 ] && + event.target !== menuElement && + !$.ui.contains( menuElement, event.target ) ) { + self.close(); + } + }); + }, 1 ); + } + + // use another timeout to make sure the blur-event-handler on the input was already triggered + setTimeout(function() { + clearTimeout( self.closing ); + }, 13); + }) + .menu({ + focus: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ); + if ( false !== self._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( /^key/.test(event.originalEvent.type) ) { + self.element.val( item.value ); + } + } + }, + selected: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ), + previous = self.previous; + + // only trigger when focus was lost (click on menu) + if ( self.element[0] !== doc.activeElement ) { + self.element.focus(); + self.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + setTimeout(function() { + self.previous = previous; + self.selectedItem = item; + }, 1); + } + + if ( false !== self._trigger( "select", event, { item: item } ) ) { + self.element.val( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + self.term = self.element.val(); + + self.close( event ); + self.selectedItem = item; + }, + blur: function( event, ui ) { + // don't set the value of the text field if it's already correct + // this prevents moving the cursor unnecessarily + if ( self.menu.element.is(":visible") && + ( self.element.val() !== self.term ) ) { + self.element.val( self.term ); + } + } + }) + .zIndex( this.element.zIndex() + 1 ) + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .hide() + .data( "menu" ); + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + }, + + destroy: function() { + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ) + .removeAttr( "role" ) + .removeAttr( "aria-autocomplete" ) + .removeAttr( "aria-haspopup" ); + this.menu.element.remove(); + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] ) + } + }, + + _initSource: function() { + var self = this, + array, + url; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter(array, request.term) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if (self.xhr) { + self.xhr.abort(); + } + self.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data, status, xhr ) { + if ( xhr === self.xhr ) { + response( data ); + } + self.xhr = null; + }, + error: function( xhr ) { + if ( xhr === self.xhr ) { + response( [] ); + } + self.xhr = null; + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + search: function( value, event ) { + value = value != null ? value : this.element.val(); + + // always save the actual value, not the one passed as an argument + this.term = this.element.val(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + clearTimeout( this.closing ); + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.element.addClass( "ui-autocomplete-loading" ); + + this.source( { term: value }, this.response ); + }, + + _response: function( content ) { + if ( content && content.length ) { + content = this._normalize( content ); + this._suggest( content ); + this._trigger( "open" ); + } else { + this.close(); + } + this.element.removeClass( "ui-autocomplete-loading" ); + }, + + close: function( event ) { + clearTimeout( this.closing ); + if ( this.menu.element.is(":visible") ) { + this.menu.element.hide(); + this.menu.deactivate(); + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this.element.val() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function(item) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate + this.menu.deactivate(); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + ul.width( "" ).outerWidth(), + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var self = this; + $.each( items, function( index, item ) { + self._renderItem( ul, item ); + }); + }, + + _renderItem: function( ul, item) { + return $( "
      • " ) + .data( "item.autocomplete", item ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is(":visible") ) { + this.search( null, event ); + return; + } + if ( this.menu.first() && /^previous/.test(direction) || + this.menu.last() && /^next/.test(direction) ) { + this.element.val( this.term ); + this.menu.deactivate(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + +}( jQuery )); + +/* + * jQuery UI Menu (not officially released) + * + * This widget isn't yet finished and the API is subject to change. We plan to finish + * it for the next release. You're welcome to give it a try anyway and give us feedback, + * as long as you're okay with migrating your code later on. We can help with that, too. + * + * Copyright 2010, 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/Menu + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function($) { + +$.widget("ui.menu", { + _create: function() { + var self = this; + this.element + .addClass("ui-menu ui-widget ui-widget-content ui-corner-all") + .attr({ + role: "listbox", + "aria-activedescendant": "ui-active-menuitem" + }) + .click(function( event ) { + if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) { + return; + } + // temporary + event.preventDefault(); + self.select( event ); + }); + this.refresh(); + }, + + refresh: function() { + var self = this; + + // don't refresh list items that are already adapted + var items = this.element.children("li:not(.ui-menu-item):has(a)") + .addClass("ui-menu-item") + .attr("role", "menuitem"); + + items.children("a") + .addClass("ui-corner-all") + .attr("tabindex", -1) + // mouseenter doesn't work with event delegation + .mouseenter(function( event ) { + self.activate( event, $(this).parent() ); + }) + .mouseleave(function() { + self.deactivate(); + }); + }, + + activate: function( event, item ) { + this.deactivate(); + if (this.hasScroll()) { + var offset = item.offset().top - this.element.offset().top, + scroll = this.element.attr("scrollTop"), + elementHeight = this.element.height(); + if (offset < 0) { + this.element.attr("scrollTop", scroll + offset); + } else if (offset >= elementHeight) { + this.element.attr("scrollTop", scroll + offset - elementHeight + item.height()); + } + } + this.active = item.eq(0) + .children("a") + .addClass("ui-state-hover") + .attr("id", "ui-active-menuitem") + .end(); + this._trigger("focus", event, { item: item }); + }, + + deactivate: function() { + if (!this.active) { return; } + + this.active.children("a") + .removeClass("ui-state-hover") + .removeAttr("id"); + this._trigger("blur"); + this.active = null; + }, + + next: function(event) { + this.move("next", ".ui-menu-item:first", event); + }, + + previous: function(event) { + this.move("prev", ".ui-menu-item:last", event); + }, + + 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(direction, edge, event) { + if (!this.active) { + this.activate(event, this.element.children(edge)); + return; + } + var next = this.active[direction + "All"](".ui-menu-item").eq(0); + if (next.length) { + this.activate(event, next); + } else { + this.activate(event, this.element.children(edge)); + } + }, + + // TODO merge with previousPage + nextPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.last()) { + this.activate(event, this.element.children(".ui-menu-item:first")); + return; + } + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base - height + $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:last"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.last() ? ":first" : ":last")); + } + }, + + // TODO merge with nextPage + previousPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.first()) { + this.activate(event, this.element.children(".ui-menu-item:last")); + return; + } + + var base = this.active.offset().top, + height = this.element.height(); + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base + height - $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:first"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.first() ? ":last" : ":first")); + } + }, + + hasScroll: function() { + return this.element.height() < this.element.attr("scrollHeight"); + }, + + select: function( event ) { + this._trigger("selected", event, { item: this.active }); + } +}); + +}(jQuery)); +/* + * jQuery UI Button 1.8.7 + * + * Copyright 2010, 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/Button + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var lastActive, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function( event ) { + $( ":ui-button", event.target.form ).each(function() { + var inst = $( this ).data( "button" ); + setTimeout(function() { + inst.refresh(); + }, 1 ); + }); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + options: { + disabled: null, + text: true, + label: null, + icons: { + primary: null, + secondary: null + } + }, + _create: function() { + this.element.closest( "form" ) + .unbind( "reset.button" ) + .bind( "reset.button", formResetHandler ); + + if ( typeof this.options.disabled !== "boolean" ) { + this.options.disabled = this.element.attr( "disabled" ); + } + + this._determineButtonType(); + this.hasTitle = !!this.buttonElement.attr( "title" ); + + var self = this, + options = this.options, + toggleButton = this.type === "checkbox" || this.type === "radio", + hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ), + focusClass = "ui-state-focus"; + + if ( options.label === null ) { + options.label = this.buttonElement.html(); + } + + if ( this.element.is( ":disabled" ) ) { + options.disabled = true; + } + + this.buttonElement + .addClass( baseClasses ) + .attr( "role", "button" ) + .bind( "mouseenter.button", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + if ( this === lastActive ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "mouseleave.button", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( hoverClass ); + }) + .bind( "focus.button", function() { + // no need to check disabled, focus won't be triggered anyway + $( this ).addClass( focusClass ); + }) + .bind( "blur.button", function() { + $( this ).removeClass( focusClass ); + }); + + if ( toggleButton ) { + this.element.bind( "change.button", function() { + self.refresh(); + }); + } + + if ( this.type === "checkbox" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).toggleClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", self.element[0].checked ); + }); + } else if ( this.type === "radio" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", true ); + + var radio = self.element[ 0 ]; + radioGroup( radio ) + .not( radio ) + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", false ); + }); + } else { + this.buttonElement + .bind( "mousedown.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + lastActive = this; + $( document ).one( "mouseup", function() { + lastActive = null; + }); + }) + .bind( "mouseup.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).removeClass( "ui-state-active" ); + }) + .bind( "keydown.button", function(event) { + if ( options.disabled ) { + return false; + } + if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "keyup.button", function() { + $( this ).removeClass( "ui-state-active" ); + }); + + if ( this.buttonElement.is("a") ) { + this.buttonElement.keyup(function(event) { + if ( event.keyCode === $.ui.keyCode.SPACE ) { + // TODO pass through original event correctly (just as 2nd argument doesn't work) + $( this ).click(); + } + }); + } + } + + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins + this._setOption( "disabled", options.disabled ); + }, + + _determineButtonType: function() { + + if ( this.element.is(":checkbox") ) { + this.type = "checkbox"; + } else { + if ( this.element.is(":radio") ) { + this.type = "radio"; + } else { + if ( this.element.is("input") ) { + this.type = "input"; + } else { + this.type = "button"; + } + } + } + + if ( this.type === "checkbox" || this.type === "radio" ) { + // we don't search against the document in case the element + // is disconnected from the DOM + this.buttonElement = this.element.parents().last() + .find( "label[for=" + this.element.attr("id") + "]" ); + this.element.addClass( "ui-helper-hidden-accessible" ); + + var checked = this.element.is( ":checked" ); + if ( checked ) { + this.buttonElement.addClass( "ui-state-active" ); + } + this.buttonElement.attr( "aria-pressed", checked ); + } else { + this.buttonElement = this.element; + } + }, + + widget: function() { + return this.buttonElement; + }, + + destroy: function() { + this.element + .removeClass( "ui-helper-hidden-accessible" ); + this.buttonElement + .removeClass( baseClasses + " " + stateClasses + " " + typeClasses ) + .removeAttr( "role" ) + .removeAttr( "aria-pressed" ) + .html( this.buttonElement.find(".ui-button-text").html() ); + + if ( !this.hasTitle ) { + this.buttonElement.removeAttr( "title" ); + } + + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "disabled" ) { + if ( value ) { + this.element.attr( "disabled", true ); + } else { + this.element.removeAttr( "disabled" ); + } + } + this._resetButton(); + }, + + refresh: function() { + var isDisabled = this.element.is( ":disabled" ); + if ( isDisabled !== this.options.disabled ) { + this._setOption( "disabled", isDisabled ); + } + if ( this.type === "radio" ) { + radioGroup( this.element[0] ).each(function() { + if ( $( this ).is( ":checked" ) ) { + $( this ).button( "widget" ) + .addClass( "ui-state-active" ) + .attr( "aria-pressed", true ); + } else { + $( this ).button( "widget" ) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", false ); + } + }); + } else if ( this.type === "checkbox" ) { + if ( this.element.is( ":checked" ) ) { + this.buttonElement + .addClass( "ui-state-active" ) + .attr( "aria-pressed", true ); + } else { + this.buttonElement + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", false ); + } + } + }, + + _resetButton: function() { + if ( this.type === "input" ) { + if ( this.options.label ) { + this.element.val( this.options.label ); + } + return; + } + var buttonElement = this.buttonElement.removeClass( typeClasses ), + buttonText = $( "" ) + .addClass( "ui-button-text" ) + .html( this.options.label ) + .appendTo( buttonElement.empty() ) + .text(), + icons = this.options.icons, + multipleIcons = icons.primary && icons.secondary; + if ( icons.primary || icons.secondary ) { + buttonElement.addClass( "ui-button-text-icon" + + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + if ( icons.primary ) { + buttonElement.prepend( "" ); + } + if ( icons.secondary ) { + buttonElement.append( "" ); + } + if ( !this.options.text ) { + buttonElement + .addClass( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ) + .removeClass( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" ); + if ( !this.hasTitle ) { + buttonElement.attr( "title", buttonText ); + } + } + } else { + buttonElement.addClass( "ui-button-text-only" ); + } + } +}); + +$.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( key, value ) { + if ( key === "disabled" ) { + this.buttons.button( "option", key, value ); + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + refresh: function() { + this.buttons = this.element.find( this.options.items ) + .filter( ":ui-button" ) + .button( "refresh" ) + .end() + .not( ":ui-button" ) + .button() + .end() + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) + .filter( ":first" ) + .addClass( "ui-corner-left" ) + .end() + .filter( ":last" ) + .addClass( "ui-corner-right" ) + .end() + .end(); + }, + + destroy: function() { + this.element.removeClass( "ui-buttonset" ); + this.buttons + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-left ui-corner-right" ) + .end() + .button( "destroy" ); + + $.Widget.prototype.destroy.call( this ); + } +}); + +}( jQuery ) ); +/* + * jQuery UI Datepicker 1.8.7 + * + * Copyright 2010, 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/Datepicker + * + * Depends: + * jquery.ui.core.js + */ +(function( $, undefined ) { + +$.extend($.ui, { datepicker: { version: "1.8.7" } }); + +var PROP_NAME = 'datepicker'; +var dpuuid = new Date().getTime(); + +/* Date picker manager. + Use the singleton instance of this class, $.datepicker, to interact with the date picker. + Settings for (groups of) date pickers are maintained in an instance object, + allowing multiple different settings on the same page. */ + +function Datepicker() { + this.debug = false; // Change this to true to start debugging + this._curInst = null; // The current instance in use + this._keyEvent = false; // If the last event was a key event + this._disabledInputs = []; // List of date picker inputs that have been disabled + this._datepickerShowing = false; // True if the popup picker is showing , false if not + this._inDialog = false; // True if showing within a "dialog", false if not + this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division + this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class + this._appendClass = 'ui-datepicker-append'; // The name of the append marker class + this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class + this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class + this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class + this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class + this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class + this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + closeText: 'Done', // Display text for close link + prevText: 'Prev', // Display text for previous month link + nextText: 'Next', // Display text for next month link + currentText: 'Today', // Display text for current month link + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], // Names of months for drop-down and formatting + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday + weekHeader: 'Wk', // Column header for week of the year + dateFormat: 'mm/dd/yy', // See format options on parseDate + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... + isRTL: false, // True if right-to-left language, false if left-to-right + showMonthAfterYear: false, // True if the year select precedes month, false for month then year + yearSuffix: '' // Additional text to append to the year in the month headers + }; + this._defaults = { // Global defaults for all the date picker instances + showOn: 'focus', // 'focus' for popup on focus, + // 'button' for trigger button, or 'both' for either + showAnim: 'fadeIn', // Name of jQuery animation for popup + showOptions: {}, // Options for enhanced animations + defaultDate: null, // Used when field is blank: actual date, + // +/-number for offset from today, null for today + appendText: '', // Display text following the input box, e.g. showing the format + buttonText: '...', // Text for trigger button + buttonImage: '', // URL for trigger button image + buttonImageOnly: false, // True if the image appears alone, false if it appears on a button + hideIfNoPrevNext: false, // True to hide next/previous month links + // if not applicable, false to just disable them + navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links + gotoCurrent: false, // True if today link goes back to current selection instead + changeMonth: false, // True if month can be selected directly, false if only prev/next + changeYear: false, // True if year can be selected directly, false if only prev/next + yearRange: 'c-10:c+10', // Range of years to display in drop-down, + // either relative to today's year (-nn:+nn), relative to currently displayed year + // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) + showOtherMonths: false, // True to show dates in other months, false to leave blank + selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable + showWeek: false, // True to show week of the year, false to not show it + calculateWeek: this.iso8601Week, // How to calculate the week of the year, + // takes a Date and returns the number of the week for it + shortYearCutoff: '+10', // Short year values < this are in the current century, + // > this are in the previous century, + // string value starting with '+' for current year + value + minDate: null, // The earliest selectable date, or null for no limit + maxDate: null, // The latest selectable date, or null for no limit + duration: 'fast', // Duration of display/closure + beforeShowDay: null, // Function that takes a date and returns an array with + // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', + // [2] = cell title (optional), e.g. $.datepicker.noWeekends + beforeShow: null, // Function that takes an input field and + // returns a set of custom settings for the date picker + onSelect: null, // Define a callback function when a date is selected + onChangeMonthYear: null, // Define a callback function when the month or year is changed + onClose: null, // Define a callback function when the datepicker is closed + numberOfMonths: 1, // Number of months to show at a time + showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) + stepMonths: 1, // Number of months to step back/forward + stepBigMonths: 12, // Number of months to step back/forward for the big links + altField: '', // Selector for an alternate field to store selected dates into + altFormat: '', // The date format to use for the alternate field + constrainInput: true, // The input is constrained by the current date format + showButtonPanel: false, // True to show button panel, false to not show it + autoSize: false // True to size the input for the date format, false to leave as is + }; + $.extend(this._defaults, this.regional['']); + this.dpDiv = $('
        '); +} + +$.extend(Datepicker.prototype, { + /* Class name added to elements to indicate already configured with a date picker. */ + markerClassName: 'hasDatepicker', + + /* Debug logging (if enabled). */ + log: function () { + if (this.debug) + console.log.apply('', arguments); + }, + + // TODO rename to "widget" when switching to widget factory + _widgetDatepicker: function() { + return this.dpDiv; + }, + + /* Override the default settings for all instances of the date picker. + @param settings object - the new settings to use as defaults (anonymous object) + @return the manager object */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* Attach the date picker to a jQuery selection. + @param target element - the target input field or division or span + @param settings object - the new settings to use for this date picker instance (anonymous) */ + _attachDatepicker: function(target, settings) { + // check for settings on the control itself - in namespace 'date:' + 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(); + var inline = (nodeName == 'div' || nodeName == 'span'); + if (!target.id) { + this.uuid += 1; + target.id = 'dp' + this.uuid; + } + var inst = this._newInst($(target), inline); + inst.settings = $.extend({}, settings || {}, inlineSettings || {}); + if (nodeName == 'input') { + this._connectDatepicker(target, inst); + } else if (inline) { + this._inlineDatepicker(target, inst); + } + }, + + /* Create a new instance object. */ + _newInst: function(target, inline) { + var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars + return {id: id, input: target, // associated target + selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection + drawMonth: 0, drawYear: 0, // month being drawn + inline: inline, // is datepicker inline or not + dpDiv: (!inline ? this.dpDiv : // presentation div + $('
        '))}; + }, + + /* Attach the date picker to an input field. */ + _connectDatepicker: function(target, inst) { + var input = $(target); + inst.append = $([]); + inst.trigger = $([]); + if (input.hasClass(this.markerClassName)) + return; + this._attachments(input, inst); + input.addClass(this.markerClassName).keydown(this._doKeyDown). + keypress(this._doKeyPress).keyup(this._doKeyUp). + bind("setData.datepicker", function(event, key, value) { + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key) { + return this._get(inst, key); + }); + this._autoSize(inst); + $.data(target, PROP_NAME, inst); + }, + + /* Make attachments based on settings. */ + _attachments: function(input, inst) { + var appendText = this._get(inst, 'appendText'); + var isRTL = this._get(inst, 'isRTL'); + if (inst.append) + inst.append.remove(); + if (appendText) { + inst.append = $('' + appendText + ''); + input[isRTL ? 'before' : 'after'](inst.append); + } + input.unbind('focus', this._showDatepicker); + if (inst.trigger) + inst.trigger.remove(); + var showOn = this._get(inst, 'showOn'); + if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field + input.focus(this._showDatepicker); + if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked + var buttonText = this._get(inst, 'buttonText'); + var buttonImage = this._get(inst, 'buttonImage'); + inst.trigger = $(this._get(inst, 'buttonImageOnly') ? + $('').addClass(this._triggerClass). + attr({ src: buttonImage, alt: buttonText, title: buttonText }) : + $('').addClass(this._triggerClass). + html(buttonImage == '' ? buttonText : $('').attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? 'before' : 'after'](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) + $.datepicker._hideDatepicker(); + else + $.datepicker._showDatepicker(input[0]); + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, 'autoSize') && !inst.inline) { + var date = new Date(2009, 12 - 1, 20); // Ensure double digits + var dateFormat = this._get(inst, 'dateFormat'); + if (dateFormat.match(/[DM]/)) { + var findMax = function(names) { + var max = 0; + var maxI = 0; + for (var i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + 'monthNames' : 'monthNamesShort')))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); + } + inst.input.attr('size', this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) + return; + divSpan.addClass(this.markerClassName).append(inst.dpDiv). + bind("setData.datepicker", function(event, key, value){ + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return this._get(inst, key); + }); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + inst.dpDiv.show(); + }, + + /* Pop-up the date picker in a "dialog" box. + @param input element - ignored + @param date string or Date - the initial date to display + @param onSelect function - the function to call when a date is selected + @param settings object - update the dialog date picker instance's settings (anonymous object) + @param pos int[2] - coordinates for the dialog's position within the screen or + event - with x/y coordinates or + leave empty for default (screen centre) + @return the manager object */ + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + this.uuid += 1; + var id = 'dp' + this.uuid; + this._dialogInput = $(''); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = document.documentElement.clientWidth; + var browserHeight = document.documentElement.clientHeight; + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this.dpDiv); + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName == 'input') { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind('focus', this._showDatepicker). + unbind('keydown', this._doKeyDown). + unbind('keypress', this._doKeyPress). + unbind('keyup', this._doKeyUp); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = false; + inst.trigger.filter('button'). + each(function() { this.disabled = false; }).end(). + filter('img').css({opacity: '1.0', cursor: ''}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().removeClass('ui-state-disabled'); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _disableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = true; + inst.trigger.filter('button'). + each(function() { this.disabled = true; }).end(). + filter('img').css({opacity: '0.5', cursor: 'default'}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().addClass('ui-state-disabled'); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + @param target element - the target input field or division or span + @return boolean - true if disabled, false if enabled */ + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Retrieve the instance data for the target control. + @param target element - the target input field or division or span + @return object - the associated instance data + @throws error if a jQuery problem getting data */ + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw 'Missing instance data for this datepicker'; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. + @param target element - the target input field or division or span + @param name object - the new settings to update or + string - the name of the setting to change or retrieve, + when retrieving also 'all' for all instance settings or + 'defaults' for all global defaults + @param value any - the new value for the setting + (omit if above is an object or to retrieve a value) */ + _optionDatepicker: function(target, name, value) { + var inst = this._getInst(target); + if (arguments.length == 2 && typeof name == 'string') { + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : + (inst ? (name == 'all' ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst) { + if (this._curInst == inst) { + this._hideDatepicker(); + } + var date = this._getDateDatepicker(target, true); + extendRemove(inst.settings, settings); + this._attachments($(target), inst); + this._autoSize(inst); + this._setDateDatepicker(target, date); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + @param target element - the target input field or division or span */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + @param target element - the target input field or division or span + @param date Date - the new date */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @param noDefault boolean - true if no default date is to be used + @return Date - the current date */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) + this._setDateFromField(inst, noDefault); + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var inst = $.datepicker._getInst(event.target); + var handled = true; + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + + $.datepicker._currentClass + ')', inst.dpDiv); + if (sel[0]) + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + else + $.datepicker._hideDatepicker(); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + else { + handled = false; + } + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var inst = $.datepicker._getInst(event.target); + if ($.datepicker._get(inst, 'constrainInput')) { + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var inst = $.datepicker._getInst(event.target); + if (inst.input.val() != inst.lastVal) { + try { + var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (event) { + $.datepicker.log(event); + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + @param input element - the input field attached to the date picker or + event - if triggered by focus */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger + input = $('input', input.parentNode)[0]; + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here + return; + var inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst != inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + } + var beforeShow = $.datepicker._get(inst, 'beforeShow'); + extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + if ($.datepicker._inDialog) // hide cursor + input.value = ''; + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + var isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css('position') == 'fixed'; + return !isFixed; + }); + if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled + $.datepicker._pos[0] -= document.documentElement.scrollLeft; + $.datepicker._pos[1] -= document.documentElement.scrollTop; + } + var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', + left: offset.left + 'px', top: offset.top + 'px'}); + if (!inst.inline) { + var showAnim = $.datepicker._get(inst, 'showAnim'); + var duration = $.datepicker._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._datepickerShowing = true; + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !! cover.length ){ + var borders = $.datepicker._getBorders(inst.dpDiv); + cover.css({left: -borders[0], top: -borders[1], + width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); + } + }; + inst.dpDiv.zIndex($(input).zIndex()+1); + if ($.effects && $.effects[showAnim]) + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); + if (!showAnim || !duration) + postProcess(); + if (inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + var self = this; + var borders = $.datepicker._getBorders(inst.dpDiv); + inst.dpDiv.empty().append(this._generateHTML(inst)); + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6 + cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) + } + inst.dpDiv.find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') + .bind('mouseout', function(){ + $(this).removeClass('ui-state-hover'); + if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); + if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); + }) + .bind('mouseover', function(){ + if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) { + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover'); + if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); + if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); + } + }) + .end() + .find('.' + this._dayOverClass + ' a') + .trigger('mouseover') + .end(); + var numMonths = this._getNumberOfMonths(inst); + var cols = numMonths[1]; + var width = 17; + if (cols > 1) + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); + else + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + + 'Class']('ui-datepicker-multi'); + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + + 'Class']('ui-datepicker-rtl'); + if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && + inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + var origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml ){ + inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + /* Retrieve the size of left and top borders for an element. + @param elem (jQuery object) the element of interest + @return (number[2]) the left and top borders */ + _getBorders: function(elem) { + var convert = function(value) { + return {thin: 1, medium: 2, thick: 3}[value] || value; + }; + return [parseFloat(convert(elem.css('border-left-width'))), + parseFloat(convert(elem.css('border-top-width')))]; + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(); + var dpHeight = inst.dpDiv.outerHeight(); + var inputWidth = inst.input ? inst.input.outerWidth() : 0; + var inputHeight = inst.input ? inst.input.outerHeight() : 0; + var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); + var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); + + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var inst = this._getInst(obj); + var isRTL = this._get(inst, 'isRTL'); + while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; + } + var position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + @param input element - the input field attached to the date picker */ + _hideDatepicker: function(input) { + var inst = this._curInst; + if (!inst || (input && inst != $.data(input, PROP_NAME))) + return; + if (this._datepickerShowing) { + var showAnim = this._get(inst, 'showAnim'); + var duration = this._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._tidyDialog(inst); + this._curInst = null; + }; + if ($.effects && $.effects[showAnim]) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); + if (!showAnim) + postProcess(); + var onClose = this._get(inst, 'onClose'); + if (onClose) + onClose.apply((inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback + this._datepickerShowing = false; + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + var $target = $(event.target); + if ($target[0].id != $.datepicker._mainDivId && + $target.parents('#' + $.datepicker._mainDivId).length == 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.hasClass($.datepicker._triggerClass) && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) + $.datepicker._hideDatepicker(); + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } + else { + var date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id); + var inst = this._getInst(target[0]); + inst._selectingMonthYear = false; + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = + parseInt(select.options[select.selectedIndex].value,10); + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Restore input focus after not changing month/year. */ + _clickMonthYear: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (inst.input && inst._selectingMonthYear) { + setTimeout(function() { + inst.input.focus(); + }, 0); + } + inst._selectingMonthYear = !inst._selectingMonthYear; + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var target = $(id); + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + var inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $('a', td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + this._selectDate(target, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var target = $(id); + var inst = this._getInst(target[0]); + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) + inst.input.val(dateStr); + this._updateAlternate(inst); + var onSelect = this._get(inst, 'onSelect'); + if (onSelect) + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + else if (inst.input) + inst.input.trigger('change'); // fire the change event + if (inst.inline) + this._updateDatepicker(inst); + else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) != 'object') + inst.input.focus(); // restore focus + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altField = this._get(inst, 'altField'); + if (altField) { // update alternate field too + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); + var date = this._getDate(inst); + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + @param date Date - the date to customise + @return [boolean, string] - is this date selectable?, what is its CSS class? */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), '']; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + @param date Date - the date to get the week for + @return number - the number of the week within the year that contains this date */ + iso8601Week: function(date) { + var checkDate = new Date(date.getTime()); + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + var time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + See formatDate below for the possible formats. + + @param format string - the expected format of the date + @param value string - the date in the above format + @param settings Object - attributes include: + shortYearCutoff number - the cutoff year for determining the century (optional) + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return Date - the extracted date value or null if value is blank */ + parseDate: function (format, value, settings) { + if (format == null || value == null) + throw 'Invalid arguments'; + value = (typeof value == 'object' ? value.toString() : value + ''); + if (value == '') + return null; + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + var year = -1; + var month = -1; + var day = -1; + var doy = -1; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Extract a number from the string value + var getNumber = function(match) { + var isDoubled = lookAhead(match); + var size = (match == '@' ? 14 : (match == '!' ? 20 : + (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); + var digits = new RegExp('^\\d{1,' + size + '}'); + var num = value.substring(iValue).match(digits); + if (!num) + throw 'Missing number at position ' + iValue; + iValue += num[0].length; + return parseInt(num[0], 10); + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = (lookAhead(match) ? longNames : shortNames); + for (var i = 0; i < names.length; i++) { + if (value.substr(iValue, names[i].length).toLowerCase() == names[i].toLowerCase()) { + iValue += names[i].length; + return i + 1; + } + } + throw 'Unknown name at position ' + iValue; + }; + // Confirm that a literal character matches the string value + var checkLiteral = function() { + if (value.charAt(iValue) != format.charAt(iFormat)) + throw 'Unexpected literal at position ' + iValue; + iValue++; + }; + var iValue = 0; + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + checkLiteral(); + else + switch (format.charAt(iFormat)) { + case 'd': + day = getNumber('d'); + break; + case 'D': + getName('D', dayNamesShort, dayNames); + break; + case 'o': + doy = getNumber('o'); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case '@': + var date = new Date(getNumber('@')); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case '!': + var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (year == -1) + year = new Date().getFullYear(); + else if (year < 100) + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + if (doy > -1) { + month = 1; + day = doy; + do { + var dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) + break; + month++; + day -= dim; + } while (true); + } + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) + throw 'Invalid date'; // E.g. 31/02/* + return date; + }, + + /* Standard date formats. */ + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) + 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', // RFC 822 + TICKS: '!', + TIMESTAMP: '@', + W3C: 'yy-mm-dd', // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. + The format can be combinations of the following: + d - day of month (no leading zero) + dd - day of month (two digit) + o - day of year (no leading zeros) + oo - day of year (three digit) + D - day name short + DD - day name long + m - month of year (no leading zero) + mm - month of year (two digit) + M - month name short + MM - month name long + y - year (two digit) + yy - year (four digit) + @ - Unix timestamp (ms since 01/01/1970) + ! - Windows ticks (100ns since 01/01/0001) + '...' - literal text + '' - single quote + + @param format string - the desired format of the date + @param date Date - the date value to format + @param settings Object - attributes include: + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return string - the date in the above format */ + formatDate: function (format, date, settings) { + if (!date) + return ''; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Format a number, with leading zero if necessary + var formatNumber = function(match, value, len) { + var num = '' + value; + if (lookAhead(match)) + while (num.length < len) + num = '0' + num; + return num; + }; + // Format a name, short or long as requested + var formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }; + var output = ''; + var literal = false; + if (date) + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + output += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': + output += formatNumber('d', date.getDate(), 2); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'o': + output += formatNumber('o', + (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1, 2); + break; + case 'M': + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); + break; + case 'y': + output += (lookAhead('y') ? date.getFullYear() : + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); + break; + case '@': + output += date.getTime(); + break; + case '!': + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) + output += "'"; + else + literal = true; + break; + default: + output += format.charAt(iFormat); + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var chars = ''; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + for (var iFormat = 0; iFormat < format.length; iFormat++) + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + chars += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': case 'm': case 'y': case '@': + chars += '0123456789'; + break; + case 'D': case 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() == inst.lastVal) { + return; + } + var dateFormat = this._get(inst, 'dateFormat'); + var dates = inst.lastVal = inst.input ? inst.input.val() : null; + var date, defaultDate; + date = defaultDate = this._getDefaultDate(inst); + var settings = this._getFormatConfig(inst); + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + this.log(event); + dates = (noDefault ? '' : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(); + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += parseInt(matches[1],10); break; + case 'w' : case 'W' : + day += parseInt(matches[1],10) * 7; break; + case 'm' : case 'M' : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }; + var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) : + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + Hours may be non-zero on daylight saving cut-over: + > 12 when midnight changeover, but then cannot generate + midnight datetime, so jump to 1AM, otherwise reset. + @param date (Date) the date to check + @return (Date) the corrected date */ + _daylightSavingAdjust: function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date; + var origMonth = inst.selectedMonth; + var origYear = inst.selectedYear; + var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) + this._notifyChange(inst); + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? '' : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var today = new Date(); + today = this._daylightSavingAdjust( + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time + var isRTL = this._get(inst, 'isRTL'); + var showButtonPanel = this._get(inst, 'showButtonPanel'); + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); + var numMonths = this._getNumberOfMonths(inst); + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); + var stepMonths = this._get(inst, 'stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var drawMonth = inst.drawMonth - showCurrentAtPos; + var drawYear = inst.drawYear; + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + var prevText = this._get(inst, 'prevText'); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + '' + prevText + '' : + (hideIfNoPrevNext ? '' : '' + prevText + '')); + var nextText = this._get(inst, 'nextText'); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + '' + nextText + '' : + (hideIfNoPrevNext ? '' : '' + nextText + '')); + var currentText = this._get(inst, 'currentText'); + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + var controls = (!inst.inline ? '' : ''); + var buttonPanel = (showButtonPanel) ? '
        ' + (isRTL ? controls : '') + + (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
        ' : ''; + var firstDay = parseInt(this._get(inst, 'firstDay'),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + var showWeek = this._get(inst, 'showWeek'); + var dayNames = this._get(inst, 'dayNames'); + var dayNamesShort = this._get(inst, 'dayNamesShort'); + var dayNamesMin = this._get(inst, 'dayNamesMin'); + var monthNames = this._get(inst, 'monthNames'); + var monthNamesShort = this._get(inst, 'monthNamesShort'); + var beforeShowDay = this._get(inst, 'beforeShowDay'); + var showOtherMonths = this._get(inst, 'showOtherMonths'); + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; + var defaultDate = this._getDefaultDate(inst); + var html = ''; + for (var row = 0; row < numMonths[0]; row++) { + var group = ''; + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + var cornerClass = ' ui-corner-all'; + var calender = ''; + if (isMultiMonth) { + calender += '
        '; + } + calender += '
        ' + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + '
        ' + + ''; + var thead = (showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + + '' + dayNamesMin[day] + ''; + } + calender += thead + ''; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += ''; + var tbody = (!showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += ''; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + ''; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += '
        ' + this._get(inst, 'weekHeader') + '
        ' + + this._get(inst, 'calculateWeek')(printDate) + '' + // actions + (otherMonth && !showOtherMonths ? ' ' : // display for other months + (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
        ' + (isMultiMonth ? '
        ' + + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
        ' : '') : ''); + group += calender; + } + html += group; + } + html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? + '' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '
        '; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '' + monthNames[drawMonth] + ''; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += ''; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '' + drawYear + ''; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ''; + //when showing there is no need for later update + if( ! $.browser.mozilla ){ + html += inst.yearshtml; + inst.yearshtml = null; + } else { + // will be replaced later with inst.yearshtml + html += ''; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '
        '; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - new Date(year, month, 32).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Determine whether an object is an array. */ +function isArray(a) { + return (a && (($.browser.safari && typeof a == 'object' && a.length) || + (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); +}; + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find('body').append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.8.7"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); +/* + * jQuery UI Dialog 1.8.7 + * + * Copyright 2010, 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/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function( $, undefined ) { + +var uiDialogClasses = + 'ui-dialog ' + + 'ui-widget ' + + 'ui-widget-content ' + + 'ui-corner-all ', + sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }; + +$.widget("ui.dialog", { + options: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: 'close', + dialogClass: '', + draggable: true, + hide: null, + height: 'auto', + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: 'center', + at: 'center', + collision: 'fit', + // ensure that the titlebar is never outside the document + using: function(pos) { + var topOffset = $(this).css(pos).offset().top; + if (topOffset < 0) { + $(this).css('top', pos.top - topOffset); + } + } + }, + resizable: true, + show: null, + stack: true, + title: '', + width: 300, + zIndex: 1000 + }, + + _create: function() { + this.originalTitle = this.element.attr('title'); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } + + this.options.title = this.options.title || this.originalTitle; + var self = this, + options = self.options, + + title = options.title || ' ', + titleId = $.ui.dialog.getTitleId(self.element), + + uiDialog = (self.uiDialog = $('
        ')) + .appendTo(document.body) + .hide() + .addClass(uiDialogClasses + options.dialogClass) + .css({ + zIndex: options.zIndex + }) + // setting tabIndex makes the div focusable + // setting outline to 0 prevents a border on focus in Mozilla + .attr('tabIndex', -1).css('outline', 0).keydown(function(event) { + if (options.closeOnEscape && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { + + self.close(event); + event.preventDefault(); + } + }) + .attr({ + role: 'dialog', + 'aria-labelledby': titleId + }) + .mousedown(function(event) { + self.moveToTop(false, event); + }), + + uiDialogContent = self.element + .show() + .removeAttr('title') + .addClass( + 'ui-dialog-content ' + + 'ui-widget-content') + .appendTo(uiDialog), + + uiDialogTitlebar = (self.uiDialogTitlebar = $('
        ')) + .addClass( + 'ui-dialog-titlebar ' + + 'ui-widget-header ' + + 'ui-corner-all ' + + 'ui-helper-clearfix' + ) + .prependTo(uiDialog), + + uiDialogTitlebarClose = $('') + .addClass( + 'ui-dialog-titlebar-close ' + + 'ui-corner-all' + ) + .attr('role', 'button') + .hover( + function() { + uiDialogTitlebarClose.addClass('ui-state-hover'); + }, + function() { + uiDialogTitlebarClose.removeClass('ui-state-hover'); + } + ) + .focus(function() { + uiDialogTitlebarClose.addClass('ui-state-focus'); + }) + .blur(function() { + uiDialogTitlebarClose.removeClass('ui-state-focus'); + }) + .click(function(event) { + self.close(event); + return false; + }) + .appendTo(uiDialogTitlebar), + + uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('')) + .addClass( + 'ui-icon ' + + 'ui-icon-closethick' + ) + .text(options.closeText) + .appendTo(uiDialogTitlebarClose), + + uiDialogTitle = $('') + .addClass('ui-dialog-title') + .attr('id', titleId) + .html(title) + .prependTo(uiDialogTitlebar); + + //handling of deprecated beforeclose (vs beforeClose) option + //Ticket #4669 http://dev.jqueryui.com/ticket/4669 + //TODO: remove in 1.9pre + if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) { + options.beforeClose = options.beforeclose; + } + + uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); + + if (options.draggable && $.fn.draggable) { + self._makeDraggable(); + } + if (options.resizable && $.fn.resizable) { + self._makeResizable(); + } + + self._createButtons(options.buttons); + self._isOpen = false; + + if ($.fn.bgiframe) { + uiDialog.bgiframe(); + } + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + destroy: function() { + var self = this; + + if (self.overlay) { + self.overlay.destroy(); + } + self.uiDialog.hide(); + self.element + .unbind('.dialog') + .removeData('dialog') + .removeClass('ui-dialog-content ui-widget-content') + .hide().appendTo('body'); + self.uiDialog.remove(); + + if (self.originalTitle) { + self.element.attr('title', self.originalTitle); + } + + return self; + }, + + widget: function() { + return this.uiDialog; + }, + + close: function(event) { + var self = this, + maxZ, thisZ; + + if (false === self._trigger('beforeClose', event)) { + return; + } + + if (self.overlay) { + self.overlay.destroy(); + } + self.uiDialog.unbind('keypress.ui-dialog'); + + self._isOpen = false; + + if (self.options.hide) { + self.uiDialog.hide(self.options.hide, function() { + self._trigger('close', event); + }); + } else { + self.uiDialog.hide(); + self._trigger('close', event); + } + + $.ui.dialog.overlay.resize(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + if (self.options.modal) { + maxZ = 0; + $('.ui-dialog').each(function() { + if (this !== self.uiDialog[0]) { + thisZ = $(this).css('z-index'); + if(!isNaN(thisZ)) { + maxZ = Math.max(maxZ, thisZ); + } + } + }); + $.ui.dialog.maxZ = maxZ; + } + + return self; + }, + + isOpen: function() { + return this._isOpen; + }, + + // the force parameter allows us to move modal dialogs to their correct + // position on open + moveToTop: function(force, event) { + var self = this, + options = self.options, + saveScroll; + + if ((options.modal && !force) || + (!options.stack && !options.modal)) { + return self._trigger('focus', event); + } + + if (options.zIndex > $.ui.dialog.maxZ) { + $.ui.dialog.maxZ = options.zIndex; + } + if (self.overlay) { + $.ui.dialog.maxZ += 1; + self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ); + } + + //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. + // http://ui.jquery.com/bugs/ticket/3193 + saveScroll = { scrollTop: self.element.attr('scrollTop'), scrollLeft: self.element.attr('scrollLeft') }; + $.ui.dialog.maxZ += 1; + self.uiDialog.css('z-index', $.ui.dialog.maxZ); + self.element.attr(saveScroll); + self._trigger('focus', event); + + return self; + }, + + open: function() { + if (this._isOpen) { return; } + + var self = this, + options = self.options, + uiDialog = self.uiDialog; + + self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null; + self._size(); + self._position(options.position); + uiDialog.show(options.show); + self.moveToTop(true); + + // prevent tabbing out of modal dialogs + if (options.modal) { + uiDialog.bind('keypress.ui-dialog', function(event) { + if (event.keyCode !== $.ui.keyCode.TAB) { + return; + } + + var tabbables = $(':tabbable', this), + first = tabbables.filter(':first'), + last = tabbables.filter(':last'); + + if (event.target === last[0] && !event.shiftKey) { + first.focus(1); + return false; + } else if (event.target === first[0] && event.shiftKey) { + last.focus(1); + return false; + } + }); + } + + // set focus to the first tabbable element in the content area or the first button + // if there are no tabbable elements, set focus on the dialog itself + $(self.element.find(':tabbable').get().concat( + uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat( + uiDialog.get()))).eq(0).focus(); + + self._isOpen = true; + self._trigger('open'); + + return self; + }, + + _createButtons: function(buttons) { + var self = this, + hasButtons = false, + uiDialogButtonPane = $('
        ') + .addClass( + 'ui-dialog-buttonpane ' + + 'ui-widget-content ' + + 'ui-helper-clearfix' + ), + uiButtonSet = $( "
        " ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + // if we already have a button pane, remove it + self.uiDialog.find('.ui-dialog-buttonpane').remove(); + + if (typeof buttons === 'object' && buttons !== null) { + $.each(buttons, function() { + return !(hasButtons = true); + }); + } + if (hasButtons) { + $.each(buttons, function(name, props) { + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + var button = $('') + .attr( props, true ) + .unbind('click') + .click(function() { + props.click.apply(self.element[0], arguments); + }) + .appendTo(uiButtonSet); + if ($.fn.button) { + button.button(); + } + }); + uiDialogButtonPane.appendTo(self.uiDialog); + } + }, + + _makeDraggable: function() { + var self = this, + options = self.options, + doc = $(document), + heightBeforeDrag; + + function filteredUi(ui) { + return { + position: ui.position, + offset: ui.offset + }; + } + + self.uiDialog.draggable({ + cancel: '.ui-dialog-content, .ui-dialog-titlebar-close', + handle: '.ui-dialog-titlebar', + containment: 'document', + start: function(event, ui) { + heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height(); + $(this).height($(this).height()).addClass("ui-dialog-dragging"); + self._trigger('dragStart', event, filteredUi(ui)); + }, + drag: function(event, ui) { + self._trigger('drag', event, filteredUi(ui)); + }, + stop: function(event, ui) { + options.position = [ui.position.left - doc.scrollLeft(), + ui.position.top - doc.scrollTop()]; + $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag); + self._trigger('dragStop', event, filteredUi(ui)); + $.ui.dialog.overlay.resize(); + } + }); + }, + + _makeResizable: function(handles) { + handles = (handles === undefined ? this.options.resizable : handles); + var self = this, + options = self.options, + // .ui-resizable has position: relative defined in the stylesheet + // but dialogs have to use absolute or fixed positioning + position = self.uiDialog.css('position'), + resizeHandles = (typeof handles === 'string' ? + handles : + 'n,e,s,w,se,sw,ne,nw' + ); + + function filteredUi(ui) { + return { + originalPosition: ui.originalPosition, + originalSize: ui.originalSize, + position: ui.position, + size: ui.size + }; + } + + self.uiDialog.resizable({ + cancel: '.ui-dialog-content', + containment: 'document', + alsoResize: self.element, + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: self._minHeight(), + handles: resizeHandles, + start: function(event, ui) { + $(this).addClass("ui-dialog-resizing"); + self._trigger('resizeStart', event, filteredUi(ui)); + }, + resize: function(event, ui) { + self._trigger('resize', event, filteredUi(ui)); + }, + stop: function(event, ui) { + $(this).removeClass("ui-dialog-resizing"); + options.height = $(this).height(); + options.width = $(this).width(); + self._trigger('resizeStop', event, filteredUi(ui)); + $.ui.dialog.overlay.resize(); + } + }) + .css('position', position) + .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); + }, + + _minHeight: function() { + var options = this.options; + + if (options.height === 'auto') { + return options.minHeight; + } else { + return Math.min(options.minHeight, options.height); + } + }, + + _position: function(position) { + var myAt = [], + offset = [0, 0], + isVisible; + + if (position) { + // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( + // if (typeof position == 'string' || $.isArray(position)) { + // myAt = $.isArray(position) ? position : position.split(' '); + + if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) { + myAt = position.split ? position.split(' ') : [position[0], position[1]]; + if (myAt.length === 1) { + myAt[1] = myAt[0]; + } + + $.each(['left', 'top'], function(i, offsetPosition) { + if (+myAt[i] === myAt[i]) { + offset[i] = myAt[i]; + myAt[i] = offsetPosition; + } + }); + + position = { + my: myAt.join(" "), + at: myAt.join(" "), + offset: offset.join(" ") + }; + } + + position = $.extend({}, $.ui.dialog.prototype.options.position, position); + } else { + position = $.ui.dialog.prototype.options.position; + } + + // need to show the dialog to get the actual offset in the position plugin + isVisible = this.uiDialog.is(':visible'); + if (!isVisible) { + this.uiDialog.show(); + } + this.uiDialog + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .position($.extend({ of: window }, position)); + if (!isVisible) { + this.uiDialog.hide(); + } + }, + + _setOptions: function( options ) { + var self = this, + resizableOptions = {}, + resize = false; + + $.each( options, function( key, value ) { + self._setOption( key, value ); + + if ( key in sizeRelatedOptions ) { + resize = true; + } + if ( key in resizableRelatedOptions ) { + resizableOptions[ key ] = value; + } + }); + + if ( resize ) { + this._size(); + } + if ( this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", resizableOptions ); + } + }, + + _setOption: function(key, value){ + var self = this, + uiDialog = self.uiDialog; + + switch (key) { + //handling of deprecated beforeclose (vs beforeClose) option + //Ticket #4669 http://dev.jqueryui.com/ticket/4669 + //TODO: remove in 1.9pre + case "beforeclose": + key = "beforeClose"; + break; + case "buttons": + self._createButtons(value); + break; + case "closeText": + // ensure that we always pass a string + self.uiDialogTitlebarCloseText.text("" + value); + break; + case "dialogClass": + uiDialog + .removeClass(self.options.dialogClass) + .addClass(uiDialogClasses + value); + break; + case "disabled": + if (value) { + uiDialog.addClass('ui-dialog-disabled'); + } else { + uiDialog.removeClass('ui-dialog-disabled'); + } + break; + case "draggable": + var isDraggable = uiDialog.is( ":data(draggable)" ); + if ( isDraggable && !value ) { + uiDialog.draggable( "destroy" ); + } + + if ( !isDraggable && value ) { + self._makeDraggable(); + } + break; + case "position": + self._position(value); + break; + case "resizable": + // currently resizable, becoming non-resizable + var isResizable = uiDialog.is( ":data(resizable)" ); + if (isResizable && !value) { + uiDialog.resizable('destroy'); + } + + // currently resizable, changing handles + if (isResizable && typeof value === 'string') { + uiDialog.resizable('option', 'handles', value); + } + + // currently non-resizable, becoming resizable + if (!isResizable && value !== false) { + self._makeResizable(value); + } + break; + case "title": + // convert whatever was passed in o a string, for html() to not throw up + $(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || ' ')); + break; + } + + $.Widget.prototype._setOption.apply(self, arguments); + }, + + _size: function() { + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + * divs will both have width and height set, so we need to reset them + */ + var options = this.options, + nonContentHeight, + minContentHeight, + isVisible = this.uiDialog.is( ":visible" ); + + // reset content sizing + this.element.show().css({ + width: 'auto', + minHeight: 0, + height: 0 + }); + + if (options.minWidth > options.width) { + options.width = options.minWidth; + } + + // reset wrapper sizing + // determine the height of all the non-content elements + nonContentHeight = this.uiDialog.css({ + height: 'auto', + width: options.width + }) + .height(); + minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); + + if ( options.height === "auto" ) { + // only needed for IE6 support + if ( $.support.minHeight ) { + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); + } else { + this.uiDialog.show(); + var autoHeight = this.element.css( "height", "auto" ).height(); + if ( !isVisible ) { + this.uiDialog.hide(); + } + this.element.height( Math.max( autoHeight, minContentHeight ) ); + } + } else { + this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); + } + + if (this.uiDialog.is(':data(resizable)')) { + this.uiDialog.resizable('option', 'minHeight', this._minHeight()); + } + } +}); + +$.extend($.ui.dialog, { + version: "1.8.7", + + uuid: 0, + maxZ: 0, + + getTitleId: function($el) { + var id = $el.attr('id'); + if (!id) { + this.uuid += 1; + id = this.uuid; + } + return 'ui-dialog-title-' + id; + }, + + overlay: function(dialog) { + this.$el = $.ui.dialog.overlay.create(dialog); + } +}); + +$.extend($.ui.dialog.overlay, { + instances: [], + // reuse old instances due to IE memory leak with alpha transparency (see #5185) + oldInstances: [], + maxZ: 0, + events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), + function(event) { return event + '.dialog-overlay'; }).join(' '), + create: function(dialog) { + if (this.instances.length === 0) { + // prevent use of anchors and inputs + // we use a setTimeout in case the overlay is created from an + // event that we're going to be cancelling (see #2804) + setTimeout(function() { + // handle $(el).dialog().dialog('close') (see #4065) + if ($.ui.dialog.overlay.instances.length) { + $(document).bind($.ui.dialog.overlay.events, function(event) { + // stop events if the z-index of the target is < the z-index of the overlay + // we cannot return true when we don't want to cancel the event (#3523) + if ($(event.target).zIndex() < $.ui.dialog.overlay.maxZ) { + return false; + } + }); + } + }, 1); + + // allow closing by pressing the escape key + $(document).bind('keydown.dialog-overlay', function(event) { + if (dialog.options.closeOnEscape && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { + + dialog.close(event); + event.preventDefault(); + } + }); + + // handle window resize + $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); + } + + var $el = (this.oldInstances.pop() || $('
        ').addClass('ui-widget-overlay')) + .appendTo(document.body) + .css({ + width: this.width(), + height: this.height() + }); + + if ($.fn.bgiframe) { + $el.bgiframe(); + } + + this.instances.push($el); + return $el; + }, + + destroy: function($el) { + var indexOf = $.inArray($el, this.instances); + if (indexOf != -1){ + this.oldInstances.push(this.instances.splice(indexOf, 1)[0]); + } + + if (this.instances.length === 0) { + $([document, window]).unbind('.dialog-overlay'); + } + + $el.remove(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + var maxZ = 0; + $.each(this.instances, function() { + maxZ = Math.max(maxZ, this.css('z-index')); + }); + this.maxZ = maxZ; + }, + + height: function() { + var scrollHeight, + offsetHeight; + // handle IE 6 + if ($.browser.msie && $.browser.version < 7) { + scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if (scrollHeight < offsetHeight) { + return $(window).height() + 'px'; + } else { + return scrollHeight + 'px'; + } + // handle "good" browsers + } else { + return $(document).height() + 'px'; + } + }, + + width: function() { + var scrollWidth, + offsetWidth; + // handle IE 6 + if ($.browser.msie && $.browser.version < 7) { + scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if (scrollWidth < offsetWidth) { + return $(window).width() + 'px'; + } else { + return scrollWidth + 'px'; + } + // handle "good" browsers + } else { + return $(document).width() + 'px'; + } + }, + + resize: function() { + /* If the dialog is draggable and the user drags it past the + * right edge of the window, the document becomes wider so we + * need to stretch the overlay. If the user then drags the + * dialog back to the left, the document will become narrower, + * so we need to shrink the overlay to the appropriate size. + * This is handled by shrinking the overlay before setting it + * to the full document size. + */ + var $overlays = $([]); + $.each($.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add(this); + }); + + $overlays.css({ + width: 0, + height: 0 + }).css({ + width: $.ui.dialog.overlay.width(), + height: $.ui.dialog.overlay.height() + }); + } +}); + +$.extend($.ui.dialog.overlay.prototype, { + destroy: function() { + $.ui.dialog.overlay.destroy(this.$el); + } +}); + +}(jQuery)); +/* + * jQuery UI Position 1.8.7 + * + * Copyright 2010, 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/Position + */ +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var horizontalPositions = /left|center|right/, + verticalPositions = /top|center|bottom/, + center = "center", + _position = $.fn.position, + _offset = $.fn.offset; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var target = $( options.of ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ], + targetWidth, + targetHeight, + basePosition; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: 0, left: 0 }; + // TODO: use $.isWindow() in 1.9 + } else if ( targetElem.setTimeout ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + basePosition = { top: options.of.pageY, left: options.of.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + basePosition = target.offset(); + } + + // force my and at to have valid horizontal and veritcal positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[this] || "" ).split( " " ); + if ( pos.length === 1) { + pos = horizontalPositions.test( pos[0] ) ? + pos.concat( [center] ) : + verticalPositions.test( pos[0] ) ? + [ center ].concat( pos ) : + [ center, center ]; + } + pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center; + pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center; + options[ this ] = pos; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + // normalize offset option + offset[ 0 ] = parseInt( offset[0], 10 ) || 0; + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + offset[ 1 ] = parseInt( offset[1], 10 ) || 0; + + if ( options.at[0] === "right" ) { + basePosition.left += targetWidth; + } else if (options.at[0] === center ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[1] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[1] === center ) { + basePosition.top += targetHeight / 2; + } + + basePosition.left += offset[ 0 ]; + basePosition.top += offset[ 1 ]; + + return this.each(function() { + var elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, + marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, + collisionWidth = elemWidth + marginLeft + + parseInt( $.curCSS( this, "marginRight", true ) ) || 0, + collisionHeight = elemHeight + marginTop + + parseInt( $.curCSS( this, "marginBottom", true ) ) || 0, + position = $.extend( {}, basePosition ), + collisionPosition; + + if ( options.my[0] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[0] === center ) { + position.left -= elemWidth / 2; + } + + if ( options.my[1] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[1] === center ) { + position.top -= elemHeight / 2; + } + + // prevent fractions (see #5280) + position.left = Math.round( position.left ); + position.top = Math.round( position.top ); + + collisionPosition = { + left: position.left - marginLeft, + top: position.top - marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[i] ] ) { + $.ui.position[ collision[i] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: offset, + my: options.my, + at: options.at + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + elem.offset( $.extend( position, { using: options.using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(); + position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left ); + }, + top: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(); + position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top ); + } + }, + + flip: { + left: function( position, data ) { + if ( data.at[0] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(), + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + -data.targetWidth, + offset = -2 * data.offset[ 0 ]; + position.left += data.collisionPosition.left < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + }, + top: function( position, data ) { + if ( data.at[1] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(), + myOffset = data.my[ 1 ] === "top" ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + -data.targetHeight, + offset = -2 * data.offset[ 1 ]; + position.top += data.collisionPosition.top < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + } + } +}; + +// offset setter from jQuery 1.4 +if ( !$.offset.setOffset ) { + $.offset.setOffset = function( elem, options ) { + // set position first, in-case top/left are set even on static elem + if ( /static/.test( $.curCSS( elem, "position" ) ) ) { + elem.style.position = "relative"; + } + var curElem = $( elem ), + curOffset = curElem.offset(), + curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0, + curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0, + props = { + top: (options.top - curOffset.top) + curTop, + left: (options.left - curOffset.left) + curLeft + }; + + if ( 'using' in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + }; + + $.fn.offset = function( options ) { + var elem = this[ 0 ]; + if ( !elem || !elem.ownerDocument ) { return null; } + if ( options ) { + return this.each(function() { + $.offset.setOffset( this, options ); + }); + } + return _offset.call( this ); + }; +} + +}( jQuery )); +/* + * jQuery UI Progressbar 1.8.7 + * + * Copyright 2010, 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/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.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 = $( "
        " ) + .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(); + + $.Widget.prototype.destroy.apply( this, arguments ); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(); + var percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +$.extend( $.ui.progressbar, { + version: "1.8.7" +}); + +})( jQuery ); +/* + * jQuery UI Slider 1.8.7 + * + * Copyright 2010, 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/Slider + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +// number of pages in a slider +// (how many times can you page up/down to go through the whole range) +var numPages = 5; + +$.widget( "ui.slider", $.ui.mouse, { + + widgetEventPrefix: "slide", + + options: { + animate: false, + distance: 0, + max: 100, + min: 0, + orientation: "horizontal", + range: false, + step: 1, + value: 0, + values: null + }, + + _create: function() { + var self = this, + o = this.options; + + this._keySliding = false; + this._mouseSliding = false; + this._animateOff = true; + this._handleIndex = null; + this._detectOrientation(); + this._mouseInit(); + + this.element + .addClass( "ui-slider" + + " ui-slider-" + this.orientation + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ); + + if ( o.disabled ) { + this.element.addClass( "ui-slider-disabled ui-disabled" ); + } + + this.range = $([]); + + if ( o.range ) { + if ( o.range === true ) { + this.range = $( "
        " ); + if ( !o.values ) { + o.values = [ this._valueMin(), this._valueMin() ]; + } + if ( o.values.length && o.values.length !== 2 ) { + o.values = [ o.values[0], o.values[0] ]; + } + } else { + this.range = $( "
        " ); + } + + this.range + .appendTo( this.element ) + .addClass( "ui-slider-range" ); + + if ( o.range === "min" || o.range === "max" ) { + this.range.addClass( "ui-slider-range-" + o.range ); + } + + // note: this isn't the most fittingly semantic framework class for this element, + // but worked best visually with a variety of themes + this.range.addClass( "ui-widget-header" ); + } + + if ( $( ".ui-slider-handle", this.element ).length === 0 ) { + $( "" ) + .appendTo( this.element ) + .addClass( "ui-slider-handle" ); + } + + if ( o.values && o.values.length ) { + while ( $(".ui-slider-handle", this.element).length < o.values.length ) { + $( "" ) + .appendTo( this.element ) + .addClass( "ui-slider-handle" ); + } + } + + this.handles = $( ".ui-slider-handle", this.element ) + .addClass( "ui-state-default" + + " ui-corner-all" ); + + this.handle = this.handles.eq( 0 ); + + this.handles.add( this.range ).filter( "a" ) + .click(function( event ) { + event.preventDefault(); + }) + .hover(function() { + if ( !o.disabled ) { + $( this ).addClass( "ui-state-hover" ); + } + }, function() { + $( this ).removeClass( "ui-state-hover" ); + }) + .focus(function() { + if ( !o.disabled ) { + $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); + $( this ).addClass( "ui-state-focus" ); + } else { + $( this ).blur(); + } + }) + .blur(function() { + $( this ).removeClass( "ui-state-focus" ); + }); + + this.handles.each(function( i ) { + $( this ).data( "index.ui-slider-handle", i ); + }); + + this.handles + .keydown(function( event ) { + var ret = true, + index = $( this ).data( "index.ui-slider-handle" ), + allowed, + curVal, + newVal, + step; + + if ( self.options.disabled ) { + return; + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + case $.ui.keyCode.END: + case $.ui.keyCode.PAGE_UP: + case $.ui.keyCode.PAGE_DOWN: + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + ret = false; + if ( !self._keySliding ) { + self._keySliding = true; + $( this ).addClass( "ui-state-active" ); + allowed = self._start( event, index ); + if ( allowed === false ) { + return; + } + } + break; + } + + step = self.options.step; + if ( self.options.values && self.options.values.length ) { + curVal = newVal = self.values( index ); + } else { + curVal = newVal = self.value(); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + newVal = self._valueMin(); + break; + case $.ui.keyCode.END: + newVal = self._valueMax(); + break; + case $.ui.keyCode.PAGE_UP: + newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.PAGE_DOWN: + newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + if ( curVal === self._valueMax() ) { + return; + } + newVal = self._trimAlignValue( curVal + step ); + break; + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + if ( curVal === self._valueMin() ) { + return; + } + newVal = self._trimAlignValue( curVal - step ); + break; + } + + self._slide( event, index, newVal ); + + return ret; + + }) + .keyup(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ); + + if ( self._keySliding ) { + self._keySliding = false; + self._stop( event, index ); + self._change( event, index ); + $( this ).removeClass( "ui-state-active" ); + } + + }); + + this._refreshValue(); + + this._animateOff = false; + }, + + destroy: function() { + this.handles.remove(); + this.range.remove(); + + this.element + .removeClass( "ui-slider" + + " ui-slider-horizontal" + + " ui-slider-vertical" + + " ui-slider-disabled" + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ) + .removeData( "slider" ) + .unbind( ".slider" ); + + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function( event ) { + var o = this.options, + position, + normValue, + distance, + closestHandle, + self, + index, + allowed, + offset, + mouseOverHandle; + + if ( o.disabled ) { + return false; + } + + this.elementSize = { + width: this.element.outerWidth(), + height: this.element.outerHeight() + }; + this.elementOffset = this.element.offset(); + + position = { x: event.pageX, y: event.pageY }; + normValue = this._normValueFromMouse( position ); + distance = this._valueMax() - this._valueMin() + 1; + self = this; + this.handles.each(function( i ) { + var thisDistance = Math.abs( normValue - self.values(i) ); + if ( distance > thisDistance ) { + distance = thisDistance; + closestHandle = $( this ); + index = i; + } + }); + + // workaround for bug #3736 (if both handles of a range are at 0, + // the first is always used as the one with least distance, + // and moving it is obviously prevented by preventing negative ranges) + if( o.range === true && this.values(1) === o.min ) { + index += 1; + closestHandle = $( this.handles[index] ); + } + + allowed = this._start( event, index ); + if ( allowed === false ) { + return false; + } + this._mouseSliding = true; + + self._handleIndex = index; + + closestHandle + .addClass( "ui-state-active" ) + .focus(); + + offset = closestHandle.offset(); + mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); + this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { + left: event.pageX - offset.left - ( closestHandle.width() / 2 ), + top: event.pageY - offset.top - + ( closestHandle.height() / 2 ) - + ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - + ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) + }; + + if ( !this.handles.hasClass( "ui-state-hover" ) ) { + this._slide( event, index, normValue ); + } + this._animateOff = true; + return true; + }, + + _mouseStart: function( event ) { + return true; + }, + + _mouseDrag: function( event ) { + var position = { x: event.pageX, y: event.pageY }, + normValue = this._normValueFromMouse( position ); + + this._slide( event, this._handleIndex, normValue ); + + return false; + }, + + _mouseStop: function( event ) { + this.handles.removeClass( "ui-state-active" ); + this._mouseSliding = false; + + this._stop( event, this._handleIndex ); + this._change( event, this._handleIndex ); + + this._handleIndex = null; + this._clickOffset = null; + this._animateOff = false; + + return false; + }, + + _detectOrientation: function() { + this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; + }, + + _normValueFromMouse: function( position ) { + var pixelTotal, + pixelMouse, + percentMouse, + valueTotal, + valueMouse; + + if ( this.orientation === "horizontal" ) { + pixelTotal = this.elementSize.width; + pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); + } else { + pixelTotal = this.elementSize.height; + pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); + } + + percentMouse = ( pixelMouse / pixelTotal ); + if ( percentMouse > 1 ) { + percentMouse = 1; + } + if ( percentMouse < 0 ) { + percentMouse = 0; + } + if ( this.orientation === "vertical" ) { + percentMouse = 1 - percentMouse; + } + + valueTotal = this._valueMax() - this._valueMin(); + valueMouse = this._valueMin() + percentMouse * valueTotal; + + return this._trimAlignValue( valueMouse ); + }, + + _start: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + return this._trigger( "start", event, uiHash ); + }, + + _slide: function( event, index, newVal ) { + var otherVal, + newValues, + allowed; + + if ( this.options.values && this.options.values.length ) { + otherVal = this.values( index ? 0 : 1 ); + + if ( ( this.options.values.length === 2 && this.options.range === true ) && + ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) + ) { + newVal = otherVal; + } + + if ( newVal !== this.values( index ) ) { + newValues = this.values(); + newValues[ index ] = newVal; + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal, + values: newValues + } ); + otherVal = this.values( index ? 0 : 1 ); + if ( allowed !== false ) { + this.values( index, newVal, true ); + } + } + } else { + if ( newVal !== this.value() ) { + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal + } ); + if ( allowed !== false ) { + this.value( newVal ); + } + } + } + }, + + _stop: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "stop", event, uiHash ); + }, + + _change: function( event, index ) { + if ( !this._keySliding && !this._mouseSliding ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "change", event, uiHash ); + } + }, + + value: function( newValue ) { + if ( arguments.length ) { + this.options.value = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, 0 ); + } + + return this._value(); + }, + + values: function( index, newValue ) { + var vals, + newValues, + i; + + if ( arguments.length > 1 ) { + this.options.values[ index ] = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, index ); + } + + if ( arguments.length ) { + if ( $.isArray( arguments[ 0 ] ) ) { + vals = this.options.values; + newValues = arguments[ 0 ]; + for ( i = 0; i < vals.length; i += 1 ) { + vals[ i ] = this._trimAlignValue( newValues[ i ] ); + this._change( null, i ); + } + this._refreshValue(); + } else { + if ( this.options.values && this.options.values.length ) { + return this._values( index ); + } else { + return this.value(); + } + } + } else { + return this._values(); + } + }, + + _setOption: function( key, value ) { + var i, + valsLength = 0; + + if ( $.isArray( this.options.values ) ) { + valsLength = this.options.values.length; + } + + $.Widget.prototype._setOption.apply( this, arguments ); + + switch ( key ) { + case "disabled": + if ( value ) { + this.handles.filter( ".ui-state-focus" ).blur(); + this.handles.removeClass( "ui-state-hover" ); + this.handles.attr( "disabled", "disabled" ); + this.element.addClass( "ui-disabled" ); + } else { + this.handles.removeAttr( "disabled" ); + this.element.removeClass( "ui-disabled" ); + } + break; + case "orientation": + this._detectOrientation(); + this.element + .removeClass( "ui-slider-horizontal ui-slider-vertical" ) + .addClass( "ui-slider-" + this.orientation ); + this._refreshValue(); + break; + case "value": + this._animateOff = true; + this._refreshValue(); + this._change( null, 0 ); + this._animateOff = false; + break; + case "values": + this._animateOff = true; + this._refreshValue(); + for ( i = 0; i < valsLength; i += 1 ) { + this._change( null, i ); + } + this._animateOff = false; + break; + } + }, + + //internal value getter + // _value() returns value trimmed by min and max, aligned by step + _value: function() { + var val = this.options.value; + val = this._trimAlignValue( val ); + + return val; + }, + + //internal values getter + // _values() returns array of values trimmed by min and max, aligned by step + // _values( index ) returns single value trimmed by min and max, aligned by step + _values: function( index ) { + var val, + vals, + i; + + if ( arguments.length ) { + val = this.options.values[ index ]; + val = this._trimAlignValue( val ); + + return val; + } else { + // .slice() creates a copy of the array + // this copy gets trimmed by min and max and then returned + vals = this.options.values.slice(); + for ( i = 0; i < vals.length; i+= 1) { + vals[ i ] = this._trimAlignValue( vals[ i ] ); + } + + return vals; + } + }, + + // returns the step-aligned value that val is closest to, between (inclusive) min and max + _trimAlignValue: function( val ) { + if ( val <= this._valueMin() ) { + return this._valueMin(); + } + if ( val >= this._valueMax() ) { + return this._valueMax(); + } + var step = ( this.options.step > 0 ) ? this.options.step : 1, + valModStep = (val - this._valueMin()) % step; + alignValue = val - valModStep; + + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see #4124) + return parseFloat( alignValue.toFixed(5) ); + }, + + _valueMin: function() { + return this.options.min; + }, + + _valueMax: function() { + return this.options.max; + }, + + _refreshValue: function() { + var oRange = this.options.range, + o = this.options, + self = this, + animate = ( !this._animateOff ) ? o.animate : false, + valPercent, + _set = {}, + lastValPercent, + value, + valueMin, + valueMax; + + if ( this.options.values && this.options.values.length ) { + this.handles.each(function( i, j ) { + valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + if ( self.options.range === true ) { + if ( self.orientation === "horizontal" ) { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } else { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + lastValPercent = valPercent; + }); + } else { + value = this.value(); + valueMin = this._valueMin(); + valueMax = this._valueMax(); + valPercent = ( valueMax !== valueMin ) ? + ( value - valueMin ) / ( valueMax - valueMin ) * 100 : + 0; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + + if ( oRange === "min" && this.orientation === "horizontal" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "horizontal" ) { + this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + if ( oRange === "min" && this.orientation === "vertical" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "vertical" ) { + this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + +}); + +$.extend( $.ui.slider, { + version: "1.8.7" +}); + +}(jQuery)); +/* + * jQuery UI Tabs 1.8.7 + * + * Copyright 2010, 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/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var tabId = 0, + listId = 0; + +function getNextTabId() { + return ++tabId; +} + +function getNextListId() { + return ++listId; +} + +$.widget( "ui.tabs", { + options: { + add: null, + ajaxOptions: null, + cache: false, + cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } + collapsible: false, + disable: null, + disabled: [], + enable: null, + event: "click", + fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } + idPrefix: "ui-tabs-", + load: null, + panelTemplate: "
        ", + remove: null, + select: null, + show: null, + spinner: "Loading…", + tabTemplate: "
      • #{label}
      • " + }, + + _create: function() { + this._tabify( true ); + }, + + _setOption: function( key, value ) { + if ( key == "selected" ) { + if (this.options.collapsible && value == this.options.selected ) { + return; + } + this.select( value ); + } else { + this.options[ key ] = value; + this._tabify(); + } + }, + + _tabId: function( a ) { + return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) || + this.options.idPrefix + getNextTabId(); + }, + + _sanitizeSelector: function( hash ) { + // we need this because an id may contain a ":" + return hash.replace( /:/g, "\\:" ); + }, + + _cookie: function() { + var cookie = this.cookie || + ( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() ); + return $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) ); + }, + + _ui: function( tab, panel ) { + return { + tab: tab, + panel: panel, + index: this.anchors.index( tab ) + }; + }, + + _cleanup: function() { + // restore all former loading tabs labels + this.lis.filter( ".ui-state-processing" ) + .removeClass( "ui-state-processing" ) + .find( "span:data(label.tabs)" ) + .each(function() { + var el = $( this ); + el.html( el.data( "label.tabs" ) ).removeData( "label.tabs" ); + }); + }, + + _tabify: function( init ) { + var self = this, + o = this.options, + fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash + + this.list = this.element.find( "ol,ul" ).eq( 0 ); + this.lis = $( " > li:has(a[href])", this.list ); + this.anchors = this.lis.map(function() { + return $( "a", this )[ 0 ]; + }); + this.panels = $( [] ); + + this.anchors.each(function( i, a ) { + var href = $( a ).attr( "href" ); + // For dynamically created HTML that contains a hash as href IE < 8 expands + // such href to the full page url with hash and then misinterprets tab as ajax. + // Same consideration applies for an added tab with a fragment identifier + // since a[href=#fragment-identifier] does unexpectedly not match. + // Thus normalize href attribute... + var hrefBase = href.split( "#" )[ 0 ], + baseEl; + if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] || + ( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) { + href = a.hash; + a.href = href; + } + + // inline tab + if ( fragmentId.test( href ) ) { + self.panels = self.panels.add( self.element.find( self._sanitizeSelector( href ) ) ); + // remote tab + // prevent loading the page itself if href is just "#" + } else if ( href && href !== "#" ) { + // required for restore on destroy + $.data( a, "href.tabs", href ); + + // TODO until #3808 is fixed strip fragment identifier from url + // (IE fails to load from such url) + $.data( a, "load.tabs", href.replace( /#.*$/, "" ) ); + + var id = self._tabId( a ); + a.href = "#" + id; + var $panel = self.element.find( "#" + id ); + if ( !$panel.length ) { + $panel = $( o.panelTemplate ) + .attr( "id", id ) + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .insertAfter( self.panels[ i - 1 ] || self.list ); + $panel.data( "destroy.tabs", true ); + } + self.panels = self.panels.add( $panel ); + // invalid tab href + } else { + o.disabled.push( i ); + } + }); + + // initialization from scratch + if ( init ) { + // attach necessary classes for styling + 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" ); + + // Selected tab + // use "selected" option or try to retrieve: + // 1. from fragment identifier in url + // 2. from cookie + // 3. from selected class attribute on
      • + if ( o.selected === undefined ) { + if ( location.hash ) { + this.anchors.each(function( i, a ) { + if ( a.hash == location.hash ) { + o.selected = i; + return false; + } + }); + } + if ( typeof o.selected !== "number" && o.cookie ) { + o.selected = parseInt( self._cookie(), 10 ); + } + if ( typeof o.selected !== "number" && this.lis.filter( ".ui-tabs-selected" ).length ) { + o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) ); + } + o.selected = o.selected || ( this.lis.length ? 0 : -1 ); + } else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release + o.selected = -1; + } + + // sanity check - default to first tab... + o.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 ) + ? o.selected + : 0; + + // Take disabling tabs via class attribute from HTML + // into account and update option properly. + // A selected tab cannot become disabled. + o.disabled = $.unique( o.disabled.concat( + $.map( this.lis.filter( ".ui-state-disabled" ), function( n, i ) { + return self.lis.index( n ); + }) + ) ).sort(); + + if ( $.inArray( o.selected, o.disabled ) != -1 ) { + o.disabled.splice( $.inArray( o.selected, o.disabled ), 1 ); + } + + // highlight selected tab + this.panels.addClass( "ui-tabs-hide" ); + this.lis.removeClass( "ui-tabs-selected ui-state-active" ); + // check for length avoids error when initializing empty list + if ( o.selected >= 0 && this.anchors.length ) { + self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ).removeClass( "ui-tabs-hide" ); + this.lis.eq( o.selected ).addClass( "ui-tabs-selected ui-state-active" ); + + // seems to be expected behavior that the show callback is fired + self.element.queue( "tabs", function() { + self._trigger( "show", null, + self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ) ) ); + }); + + this.load( o.selected ); + } + + // clean up to avoid memory leaks in certain versions of IE 6 + // TODO: namespace this event + $( window ).bind( "unload", function() { + self.lis.add( self.anchors ).unbind( ".tabs" ); + self.lis = self.anchors = self.panels = null; + }); + // update selected after add/remove + } else { + o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) ); + } + + // update collapsible + // TODO: use .toggleClass() + this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" ); + + // set or update cookie after init and add/remove respectively + if ( o.cookie ) { + this._cookie( o.selected, o.cookie ); + } + + // disable tabs + for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) { + $( li )[ $.inArray( i, o.disabled ) != -1 && + // TODO: use .toggleClass() + !$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" ); + } + + // reset cache if switching from cached to not cached + if ( o.cache === false ) { + this.anchors.removeData( "cache.tabs" ); + } + + // remove all handlers before, tabify may run on existing tabs after add or option change + this.lis.add( this.anchors ).unbind( ".tabs" ); + + if ( o.event !== "mouseover" ) { + var addState = function( state, el ) { + if ( el.is( ":not(.ui-state-disabled)" ) ) { + el.addClass( "ui-state-" + state ); + } + }; + var removeState = function( state, el ) { + el.removeClass( "ui-state-" + state ); + }; + this.lis.bind( "mouseover.tabs" , function() { + addState( "hover", $( this ) ); + }); + this.lis.bind( "mouseout.tabs", function() { + removeState( "hover", $( this ) ); + }); + this.anchors.bind( "focus.tabs", function() { + addState( "focus", $( this ).closest( "li" ) ); + }); + this.anchors.bind( "blur.tabs", function() { + removeState( "focus", $( this ).closest( "li" ) ); + }); + } + + // set up animations + var hideFx, showFx; + if ( o.fx ) { + if ( $.isArray( o.fx ) ) { + hideFx = o.fx[ 0 ]; + showFx = o.fx[ 1 ]; + } else { + hideFx = showFx = o.fx; + } + } + + // Reset certain styles left over from animation + // and prevent IE's ClearType bug... + function resetStyle( $el, fx ) { + $el.css( "display", "" ); + if ( !$.support.opacity && fx.opacity ) { + $el[ 0 ].style.removeAttribute( "filter" ); + } + } + + // Show a tab... + var showTab = showFx + ? function( clicked, $show ) { + $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" ); + $show.hide().removeClass( "ui-tabs-hide" ) // avoid flicker that way + .animate( showFx, showFx.duration || "normal", function() { + resetStyle( $show, showFx ); + self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) ); + }); + } + : function( clicked, $show ) { + $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" ); + $show.removeClass( "ui-tabs-hide" ); + self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) ); + }; + + // Hide a tab, $show is optional... + var hideTab = hideFx + ? function( clicked, $hide ) { + $hide.animate( hideFx, hideFx.duration || "normal", function() { + self.lis.removeClass( "ui-tabs-selected ui-state-active" ); + $hide.addClass( "ui-tabs-hide" ); + resetStyle( $hide, hideFx ); + self.element.dequeue( "tabs" ); + }); + } + : function( clicked, $hide, $show ) { + self.lis.removeClass( "ui-tabs-selected ui-state-active" ); + $hide.addClass( "ui-tabs-hide" ); + self.element.dequeue( "tabs" ); + }; + + // attach tab event handler, unbind to avoid duplicates from former tabifying... + this.anchors.bind( o.event + ".tabs", function() { + var el = this, + $li = $(el).closest( "li" ), + $hide = self.panels.filter( ":not(.ui-tabs-hide)" ), + $show = self.element.find( self._sanitizeSelector( el.hash ) ); + + // If tab is already selected and not collapsible or tab disabled or + // or is already loading or click callback returns false stop here. + // Check if click handler returns false last so that it is not executed + // for a disabled or loading tab! + if ( ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) || + $li.hasClass( "ui-state-disabled" ) || + $li.hasClass( "ui-state-processing" ) || + self.panels.filter( ":animated" ).length || + self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) { + this.blur(); + return false; + } + + o.selected = self.anchors.index( this ); + + self.abort(); + + // if tab may be closed + if ( o.collapsible ) { + if ( $li.hasClass( "ui-tabs-selected" ) ) { + o.selected = -1; + + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + self.element.queue( "tabs", function() { + hideTab( el, $hide ); + }).dequeue( "tabs" ); + + this.blur(); + return false; + } else if ( !$hide.length ) { + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + self.element.queue( "tabs", function() { + showTab( el, $show ); + }); + + // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171 + self.load( self.anchors.index( this ) ); + + this.blur(); + return false; + } + } + + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + // show new tab + if ( $show.length ) { + if ( $hide.length ) { + self.element.queue( "tabs", function() { + hideTab( el, $hide ); + }); + } + self.element.queue( "tabs", function() { + showTab( el, $show ); + }); + + self.load( self.anchors.index( this ) ); + } else { + throw "jQuery UI Tabs: Mismatching fragment identifier."; + } + + // Prevent IE from keeping other link focussed when using the back button + // and remove dotted border from clicked link. This is controlled via CSS + // in modern browsers; blur() removes focus from address bar in Firefox + // which can become a usability and annoying problem with tabs('rotate'). + if ( $.browser.msie ) { + this.blur(); + } + }); + + // disable click in any case + this.anchors.bind( "click.tabs", function(){ + return false; + }); + }, + + _getIndex: function( index ) { + // meta-function to give users option to provide a href string instead of a numerical index. + // also sanitizes numerical indexes to valid values. + if ( typeof index == "string" ) { + index = this.anchors.index( this.anchors.filter( "[href$=" + index + "]" ) ); + } + + return index; + }, + + destroy: function() { + var o = 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 href = $.data( this, "href.tabs" ); + if ( href ) { + this.href = href; + } + var $this = $( this ).unbind( ".tabs" ); + $.each( [ "href", "load", "cache" ], function( i, prefix ) { + $this.removeData( prefix + ".tabs" ); + }); + }); + + this.lis.unbind( ".tabs" ).add( this.panels ).each(function() { + if ( $.data( this, "destroy.tabs" ) ) { + $( this ).remove(); + } else { + $( 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( " " ) ); + } + }); + + if ( o.cookie ) { + this._cookie( null, o.cookie ); + } + + return this; + }, + + add: function( url, label, index ) { + if ( index === undefined ) { + index = this.anchors.length; + } + + var self = this, + o = this.options, + $li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ), + id = !url.indexOf( "#" ) ? url.replace( "#", "" ) : this._tabId( $( "a", $li )[ 0 ] ); + + $li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true ); + + // try to find an existing element before creating a new one + var $panel = self.element.find( "#" + id ); + if ( !$panel.length ) { + $panel = $( o.panelTemplate ) + .attr( "id", id ) + .data( "destroy.tabs", true ); + } + $panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" ); + + if ( index >= this.lis.length ) { + $li.appendTo( this.list ); + $panel.appendTo( this.list[ 0 ].parentNode ); + } else { + $li.insertBefore( this.lis[ index ] ); + $panel.insertBefore( this.panels[ index ] ); + } + + o.disabled = $.map( o.disabled, function( n, i ) { + return n >= index ? ++n : n; + }); + + this._tabify(); + + if ( this.anchors.length == 1 ) { + o.selected = 0; + $li.addClass( "ui-tabs-selected ui-state-active" ); + $panel.removeClass( "ui-tabs-hide" ); + this.element.queue( "tabs", function() { + self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) ); + }); + + this.load( 0 ); + } + + this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + remove: function( index ) { + index = this._getIndex( index ); + var o = this.options, + $li = this.lis.eq( index ).remove(), + $panel = this.panels.eq( index ).remove(); + + // If selected tab was removed focus tab to the right or + // in case the last tab was removed the tab to the left. + if ( $li.hasClass( "ui-tabs-selected" ) && this.anchors.length > 1) { + this.select( index + ( index + 1 < this.anchors.length ? 1 : -1 ) ); + } + + o.disabled = $.map( + $.grep( o.disabled, function(n, i) { + return n != index; + }), + function( n, i ) { + return n >= index ? --n : n; + }); + + this._tabify(); + + this._trigger( "remove", null, this._ui( $li.find( "a" )[ 0 ], $panel[ 0 ] ) ); + return this; + }, + + enable: function( index ) { + index = this._getIndex( index ); + var o = this.options; + if ( $.inArray( index, o.disabled ) == -1 ) { + return; + } + + this.lis.eq( index ).removeClass( "ui-state-disabled" ); + o.disabled = $.grep( o.disabled, function( n, i ) { + return n != index; + }); + + this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + disable: function( index ) { + index = this._getIndex( index ); + var self = this, o = this.options; + // cannot disable already selected tab + if ( index != o.selected ) { + this.lis.eq( index ).addClass( "ui-state-disabled" ); + + o.disabled.push( index ); + o.disabled.sort(); + + this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + } + + return this; + }, + + select: function( index ) { + index = this._getIndex( index ); + if ( index == -1 ) { + if ( this.options.collapsible && this.options.selected != -1 ) { + index = this.options.selected; + } else { + return this; + } + } + this.anchors.eq( index ).trigger( this.options.event + ".tabs" ); + return this; + }, + + load: function( index ) { + index = this._getIndex( index ); + var self = this, + o = this.options, + a = this.anchors.eq( index )[ 0 ], + url = $.data( a, "load.tabs" ); + + this.abort(); + + // not remote or from cache + if ( !url || this.element.queue( "tabs" ).length !== 0 && $.data( a, "cache.tabs" ) ) { + this.element.dequeue( "tabs" ); + return; + } + + // load remote from here on + this.lis.eq( index ).addClass( "ui-state-processing" ); + + if ( o.spinner ) { + var span = $( "span", a ); + span.data( "label.tabs", span.html() ).html( o.spinner ); + } + + this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, { + url: url, + success: function( r, s ) { + self.element.find( self._sanitizeSelector( a.hash ) ).html( r ); + + // take care of tab labels + self._cleanup(); + + if ( o.cache ) { + $.data( a, "cache.tabs", true ); + } + + self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) ); + try { + o.ajaxOptions.success( r, s ); + } + catch ( e ) {} + }, + error: function( xhr, s, e ) { + // take care of tab labels + self._cleanup(); + + self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) ); + try { + // Passing index avoid a race condition when this method is + // called after the user has selected another tab. + // Pass the anchor that initiated this request allows + // loadError to manipulate the tab content panel via $(a.hash) + o.ajaxOptions.error( xhr, s, index, a ); + } + catch ( e ) {} + } + } ) ); + + // last, so that load event is fired before show... + self.element.dequeue( "tabs" ); + + return this; + }, + + abort: function() { + // stop possibly running animations + this.element.queue( [] ); + this.panels.stop( false, true ); + + // "tabs" queue must not contain more than two elements, + // which are the callbacks for the latest clicked tab... + this.element.queue( "tabs", this.element.queue( "tabs" ).splice( -2, 2 ) ); + + // terminate pending requests from other tabs + if ( this.xhr ) { + this.xhr.abort(); + delete this.xhr; + } + + // take care of tab labels + this._cleanup(); + return this; + }, + + url: function( index, url ) { + this.anchors.eq( index ).removeData( "cache.tabs" ).data( "load.tabs", url ); + return this; + }, + + length: function() { + return this.anchors.length; + } +}); + +$.extend( $.ui.tabs, { + version: "1.8.7" +}); + +/* + * Tabs Extensions + */ + +/* + * Rotate + */ +$.extend( $.ui.tabs.prototype, { + rotation: null, + rotate: function( ms, continuing ) { + var self = this, + o = this.options; + + var rotate = self._rotate || ( self._rotate = function( e ) { + clearTimeout( self.rotation ); + self.rotation = setTimeout(function() { + var t = o.selected; + self.select( ++t < self.anchors.length ? t : 0 ); + }, ms ); + + if ( e ) { + e.stopPropagation(); + } + }); + + var stop = self._unrotate || ( self._unrotate = !continuing + ? function(e) { + if (e.clientX) { // in case of a true click + self.rotate(null); + } + } + : function( e ) { + t = o.selected; + rotate(); + }); + + // start rotation + if ( ms ) { + this.element.bind( "tabsshow", rotate ); + this.anchors.bind( o.event + ".tabs", stop ); + rotate(); + // stop rotation + } else { + clearTimeout( self.rotation ); + this.element.unbind( "tabsshow", rotate ); + this.anchors.unbind( o.event + ".tabs", stop ); + delete this._rotate; + delete this._unrotate; + } + + return this; + } +}); + +})( jQuery ); diff --git a/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.sortable.js b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.sortable.js new file mode 100644 index 0000000..4134efd --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.sortable.js @@ -0,0 +1,1071 @@ +/* + * jQuery UI Sortable 1.8.7 + * + * Copyright 2010, 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/Sortables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + widgetEventPrefix: "sort", + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are floating + this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + }, + + destroy: function() { + this.element + .removeClass("ui-sortable ui-sortable-disabled") + .removeData("sortable") + .unbind(".sortable"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData("sortable-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget() + [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, self = this, nodes = $(event.target).parents().each(function() { + if($.data(this, 'sortable-item') == self) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, 'sortable-item') == self) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options, self = this; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper 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'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + if(itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var self = this; + var cur = self.placeholder.offset(); + + self.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + self._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + var self = this; + + if(this.dragging) { + + this._mouseUp(); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, self._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, self._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var self = this; + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], 'sortable'); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(sortable-item)"); + + for (var i=0; i < this.items.length; i++) { + + for (var j=0; j < list.length; j++) { + if(list[j] == this.items[i].item[0]) + this.items.splice(i,1); + }; + + }; + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var self = this; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], 'sortable'); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data('sortable-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + + var self = that || this, o = self.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(self.currentItem[0].nodeName)) + .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)); + + //Append it after the actual current item + self.currentItem.after(self.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(self, self.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.ui.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else if(this.currentContainer != this.containers[innermostIndex]) { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top']; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var self = this, counter = this.counter; + + window.setTimeout(function() { + if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + },0); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = [], self = this; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem[0].parentNode) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element + if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + for (var i = this.containers.length - 1; i >= 0; i--){ + if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + } + }; + }; + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(inst) { + var self = inst || this; + return { + helper: self.helper, + placeholder: self.placeholder || $([]), + position: self.position, + originalPosition: self.originalPosition, + offset: self.positionAbs, + item: self.currentItem, + sender: inst ? inst.element : null + }; + } + +}); + +$.extend($.ui.sortable, { + version: "1.8.7" +}); + +})(jQuery); diff --git a/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.widget.js b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.widget.js new file mode 100644 index 0000000..a19e82a --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/jquery.ui.widget.js @@ -0,0 +1,262 @@ +/*! + * jQuery UI Widget 1.8.7 + * + * Copyright 2010, 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/Widget + */ +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + $( elem ).triggerHandler( "remove" ); + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + $( this ).triggerHandler( "remove" ); + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var callback = this.options[ type ]; + + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + data = data || {}; + + // copy original event properties over to the new event + // this would happen if we could call $.event.fix instead of $.Event + // but we don't have a way to force an event to be fixed multiple times + if ( event.originalEvent ) { + for ( var i = $.event.props.length, prop; i; ) { + prop = $.event.props[ --i ]; + event[ prop ] = event.originalEvent[ prop ]; + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); diff --git a/docroot/sites/all/modules/ckeditor/includes/jqueryUI/sort.js b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/sort.js new file mode 100644 index 0000000..b2bd722 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/includes/jqueryUI/sort.js @@ -0,0 +1,151 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +jQuery(document).ready(function() { + function Tools(event, ui) { + //outer loop for rows + var tools = "[\n"; + rows = jQuery("#groupLayout div.sortableListDiv").length; + jQuery.each(jQuery("#groupLayout div.sortableListDiv"), function(rowIndex, rowValue) { + if (jQuery("li",rowValue).length > 0) { + tools = tools + " ["; + } + //inner loop for toolbar buttons + jQuery.each(jQuery("li",rowValue), function(buttonIndex, buttonValue) { + if (jQuery(buttonValue).hasClass('spacer')) { + tools = tools + ",'-'"; + } + else if (jQuery(buttonValue).hasClass('group')) { + tools = tools + "],\n ["; + } + else { + tools = tools + ",'" + jQuery(buttonValue).attr('id') + "'" ; + } + }); + + if (jQuery("li" ,rowValue).length > 0) { + if (rowIndex < (rows -1)) { + tools = tools + "],\n '/',\n"; + } + else { + tools = tools + "]\n"; + } + } + }); + tools = tools + "]"; + tools = tools.replace(/\[,/g, '['); + tools = tools.replace(/\[],/g, ''); + jQuery("#edit-toolbar").attr('value', tools); + } + + Drupal.ckeditorToolbaInit = function() { + Drupal.ckeditorToolbarUsedRender(); + Drupal.ckeditorToolbarAllRender(); + + var firefox = navigator.userAgent.toLowerCase().match(/firefox/); + + jQuery(".sortableList").sortable({ + connectWith: ".sortableList", + items: "div.sortableListDiv", + sort: function(event, ui) { + if (firefox){ + ui.helper.css({'top' : ui.position.top - 35 + 'px'}); + } + }, + stop: function(event, ui) { + Tools(event, ui); + } + }).disableSelection(); + + jQuery(".sortableRow").sortable({ + connectWith: ".sortableRow", + items: "li.sortableItem", + sort: function(event, ui) { + if (firefox){ + ui.helper.css({'top' : ui.position.top - 35 + 'px'}); + } + }, + stop: function(event, ui) { + Tools(event, ui); + } + }).disableSelection(); + + jQuery("li.sortableItem").mouseover(function(){ + jQuery(".sortableList").sortable("disable"); + }); + jQuery("li.sortableItem").mouseout(function(){ + jQuery(".sortableList").sortable("enable"); + }); + } + + Drupal.ckeditorToolbarReload = function() { + jQuery(".sortableList").sortable('destroy'); + jQuery(".sortableRow").sortable('destroy'); + jQuery("li.sortableItem").unbind(); + Drupal.ckeditorToolbaInit(); + } + + Drupal.ckeditorToolbarUsedRender = function() { + var toolbar = jQuery('#edit-toolbar').val(); + toolbar = eval(toolbar); + var html = '
          '; + var group = false; + + for (var row in toolbar) { + if (typeof toolbar[row] == 'string' && toolbar[row] == '/') { + group = false; + html += '
          '; + } + else { + if (group == false){ + group = true; + } + else { + html += '
        • group
        • '; + } + for (var button in toolbar[row]) { + if (toolbar[row][button] == '-') { + html += '
        • spacer
        • '; + } + else if (Drupal.settings.cke_toolbar_buttons_all[toolbar[row][button]]) { + html += '
        • ' + Drupal.settings.cke_toolbar_buttons_all[toolbar[row][button]]['title'] + '
        • '; + } + } + } + } + html += '
        '; + jQuery('#groupLayout').empty().append(html); + } + + Drupal.ckeditorToolbarAllRender = function() { + var toolbarUsed = jQuery('#edit-toolbar').val(); + var toolbarAll = Drupal.settings.cke_toolbar_buttons_all; + + var htmlArray = new Array(); + var html = ''; + + for (var i in toolbarAll) { + if (new RegExp("\'[\s]*" + toolbarAll[i].name + "[\s]*\'").test(toolbarUsed) == false) { + if (toolbarAll[i].name == false) continue; + if (typeof htmlArray[toolbarAll[i].row] == 'undefined') htmlArray[toolbarAll[i].row] = ''; + htmlArray[toolbarAll[i].row] += '
      • ' + toolbarAll[i].title + '
      • '; + } + } + + if (typeof htmlArray[5] == 'undefined') htmlArray[5] = ''; + htmlArray[5] += '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • ' + toolbarAll['__group'].title + '
      • '; + + if (typeof htmlArray[6] == 'undefined') htmlArray[6] = ''; + htmlArray[6] += '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • ' + toolbarAll['__spacer'].title + '
      • '; + + if (typeof htmlArray[7] == 'undefined') htmlArray[7] = ''; + + for (var j in htmlArray){ + html += '
          ' + htmlArray[j] + '
        '; + } + jQuery('#allButtons').empty().append(html); + } + + Drupal.ckeditorToolbaInit(); +}); \ No newline at end of file diff --git a/docroot/sites/all/modules/ckeditor/plugins/counter/plugin.js b/docroot/sites/all/modules/ckeditor/plugins/counter/plugin.js new file mode 100644 index 0000000..32c2572 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/plugins/counter/plugin.js @@ -0,0 +1,60 @@ +/** + * @file Plugin to count symbols, symbols without blanks and words + */ + +(function() +{ + var emptyHtml = ' '; + + CKEDITOR.plugins.add( 'counter', + { + init : function( editor ) + { + var spaceId = 'cke_counter_' + editor.name; + var spaceElement; + var getSpaceElement = function() + { + if ( !spaceElement ) + spaceElement = CKEDITOR.document.getById( spaceId ); + return spaceElement; + }; + + editor.on( 'themeSpace', function( event ) + { + if ( event.data.space == 'bottom' ) + { + event.data.html += + 'Counter' + + '
        ' + emptyHtml + '
        '; + } + }); + + function count( ev ) + { + var space = getSpaceElement(); + var text = ev.editor.getData(); + // decode HTML entities; it also removes HTML tags, but works only if jQuery is available + text = jQuery('
        ').html(text).text(); + // remove all redundant blank symbols + text = text.replace(new RegExp('\\s+', 'g'), ' '); + // remove all blank symbols at the start and at the end + text = text.replace(new RegExp('(^\\s+)|(\\s+$)', 'g'), ''); + var symbols = text.length; + var words = text.split(' ').length; + //remove all blank symbols + text = text.replace(new RegExp('\\s+', 'g'), ''); + var symbols_wo_blanks = text.length; + + space.setHtml( '' + symbols + ' / ' + symbols_wo_blanks + ' symbols; ' + words + ' words' ); + } + + editor.on( 'dataReady', count ); + editor.on( 'blur', count ); + editor.on( 'focus', count ); + // Almost useless + //editor.on( 'saveSnapshot', count ); + // Requires too much resources + //editor.on( 'key', count ); + } + }); +})(); diff --git a/docroot/sites/all/modules/ckeditor/plugins/drupalbreaks/images/drupalbreak.png b/docroot/sites/all/modules/ckeditor/plugins/drupalbreaks/images/drupalbreak.png new file mode 100644 index 0000000000000000000000000000000000000000..97dfea4913a42c4fd5610bbd8960d0554c8a3c96 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh<3?#J|q#XfLjKx9jP7LeL$-D$|I0Jk_TqS@E z28JID4Ek%d4+2??B|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gg{;GcwGY1JcS~ z;_2(kew&e(lhJDR!<1N{kdmj1V+hCfJPE{9O Z7-sHc-ySJA`djQ v4jede;?#*l2M!!Mafl in document. So, look + // for an image with class "cke_drupal_break" (the fake element). + var images = editor.document.getElementsByTag( 'img' ); + for ( var i = 0, len = images.count() ; i < len ; i++ ) + { + var img = images.getItem( i ); + if ( img.hasClass( 'cke_drupal_break' ) ) + { + if ( confirm( Drupal.t( 'The document already contains a teaser break. Do you want to proceed by removing it first?' ) ) ) + { + img.remove(); + break; + } + else + return; + } + } + + insertComment( 'break' ); + } + } ); + + editor.ui.addButton( 'DrupalPageBreak', + { + label : Drupal.t( 'Insert Page Break' ), + icon : this.path + 'images/drupalpagebreak.png', + command : 'drupalpagebreak' + }); + + editor.addCommand( 'drupalpagebreak', + { + exec : function() + { + insertComment( 'pagebreak' ); + } + } ); + + // This function effectively inserts the comment into the editor. + function insertComment( text ) + { + // Create the fake element that will be inserted into the document. + // The trick is declaring it as an
        , so it will behave like a + // block element (and in effect it behaves much like an
        ). + if ( !CKEDITOR.dom.comment.prototype.getAttribute ) { + CKEDITOR.dom.comment.prototype.getAttribute = function() { + return ''; + }; + CKEDITOR.dom.comment.prototype.attributes = { + align : '' + }; + } + var fakeElement = editor.createFakeElement( new CKEDITOR.dom.comment( text ), 'cke_drupal_' + text, 'hr' ); + + // This is the trick part. We can't use editor.insertElement() + // because we need to put the comment directly at level. + // We need to do range manipulation for that. + + // Get a DOM range from the current selection. + var range = editor.getSelection().getRanges()[0], + elementsPath = new CKEDITOR.dom.elementPath( range.getCommonAncestor( true ) ), + element = ( elementsPath.block && elementsPath.block.getParent() ) || elementsPath.blockLimit, + hasMoved; + + // If we're not in go moving the position to after the + // elements until reaching it. This may happen when inside tables, + // lists, blockquotes, etc. + while ( element && element.getName() != 'body' ) + { + range.moveToPosition( element, CKEDITOR.POSITION_AFTER_END ); + hasMoved = 1; + element = element.getParent(); + } + + // Split the current block. + if ( !hasMoved ) + range.splitBlock( 'p' ); + + // Insert the fake element into the document. + range.insertNode( fakeElement ); + + // Now, we move the selection to the best possible place following + // our fake element. + var next = fakeElement; + while ( ( next = next.getNext() ) && !range.moveToElementEditStart( next ) ) + {} + + range.select(); + } + }, + + afterInit : function( editor ) + { + // Adds the comment processing rules to the data filter, so comments + // are replaced by fake elements. + editor.dataProcessor.dataFilter.addRules( + { + comment : function( value ) + { + if ( !CKEDITOR.htmlParser.comment.prototype.getAttribute ) { + CKEDITOR.htmlParser.comment.prototype.getAttribute = function() { + return ''; + }; + CKEDITOR.htmlParser.comment.prototype.attributes = { + align : '' + }; + } + + if ( value == 'break' || value == 'pagebreak' ) + return editor.createFakeParserElement( new CKEDITOR.htmlParser.comment( value ), 'cke_drupal_' + value, 'hr' ); + + return value; + } + }); + } + }); +} )(); diff --git a/docroot/sites/all/modules/ckeditor/plugins/imce/images/icon.png b/docroot/sites/all/modules/ckeditor/plugins/imce/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ab168a1aeff4c41cf9b3324bfe6318a7de9f9171 GIT binary patch literal 523 zcmV+m0`&cfP)Px#z)(z7MF0Q*dDl&G#s8S$YO;MYirrWG=8I#y|7pb8q2zd!VX4SZPKnk!H-SPsam*y zMaP;`GrpD6u3W8nFQINKj$R;{XC|d_E4P3&xPmsRbuBQU{B_6wYr^m9>B0EkV84q@ zS-z<*od4_DWA5H?hsESt%_Tgj9ha< literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/plugins/imce/plugin.js b/docroot/sites/all/modules/ckeditor/plugins/imce/plugin.js new file mode 100644 index 0000000..a0b04e4 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/plugins/imce/plugin.js @@ -0,0 +1,67 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @file Plugin for inserting files from imce without image dialog + */ +( function() { + CKEDITOR.plugins.add( 'imce', + { + init: function( editor ) + { + //adding button + editor.ui.addButton( 'IMCE', + { + label: 'IMCE', + command: 'IMCEWindow', + icon: this.path + 'images/icon.png' + }); + + //opening imce window + editor.addCommand( 'IMCEWindow', { + exec : function () { + var width = editor.config.filebrowserWindowWidth || '80%', + height = editor.config.filebrowserWindowHeight || '70%'; + + editor.popup(Drupal.settings.basePath + 'index.php?q=imce\x26app=ckeditor|sendto@ckeditor_setFile|&CKEditorFuncNum=' + editor._.filebrowserFnIMCE, width, height); + } + }); + + //add editor function + editor._.filebrowserFnIMCE = CKEDITOR.tools.addFunction( setFile, editor ) + + //function which receive imce response + window.ckeditor_setFile = function (file, win) { + var cfunc = win.location.href.split('&'); + for (var x in cfunc) { + if (cfunc[x].match(/^CKEditorFuncNum=\d+$/)) { + cfunc = cfunc[x].split('='); + break; + } + } + CKEDITOR.tools.callFunction(cfunc[1], file); + win.close(); + }; + + } + } ); + function setFile(file) { + var sel = this.getSelection(), + text = sel.getSelectedText(); + if (file.width != 0 && file.height != 0) { + if (text) { + this.insertHtml('' + text + ''); + } else { + this.insertHtml('' + file.name + ''); + } + } else { + if (text) { + this.insertHtml('' + text + ''); + } else { + this.insertHtml('' + file.name + ''); + } + } + } +} )(); diff --git a/docroot/sites/all/modules/ckeditor/plugins/media/images/icon.gif b/docroot/sites/all/modules/ckeditor/plugins/media/images/icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..bf9b501c3dd5a10dcbc33ce2491afe1ea55fb737 GIT binary patch literal 126 zcmZ?wbhEHb6krfwSj52a|NsAk55FHcaG;@~fdR|~l0cyNlZBC;ft5iA!~v;gV0Mn! zb;sM_)DNZ&KjMOxwKKS-').append( element.eq(0).clone() ).html(); + }, + + addImageAttributes: function (imgElement, fid, view_mode, additional) { + imgElement.addClass('media-image'); + + this.forceAttributesIntoClass(imgElement, fid, view_mode, additional); + }, + + /** + * Due to problems handling wrapping divs in ckeditor, this is needed. + * + * Going forward, if we don't care about supporting other editors + * we can use the fakeobjects plugin to ckeditor to provide cleaner + * transparency between what Drupal will output
        + * instead of just , for now though, we're going to remove all the stuff surrounding the images. + * + * @param String formattedMedia + * Element containing the image + * + * @return HTML of tag inside formattedMedia + */ + stripDivs: function (formattedMedia) { + // Check to see if the image tag has divs to strip + var stripped = null; + if ($(formattedMedia).is('img')) { + stripped = this.outerHTML($(formattedMedia)); + } else { + stripped = this.outerHTML($('img', $(formattedMedia))); + } + // This will fail if we pass the img tag without anything wrapping it, like we do when re-enabling ckeditor + return stripped; + }, + + /** + * Attach function, called when a rich text editor loads. + * This finds all [[tags]] and replaces them with the html + * that needs to show in the editor. + * + */ + attach: function (content, settings, instanceId) { + var matches = content.match(/\[\[.*?\]\]/g); + this.initializeTagMap(); + var tagmap = Drupal.settings.tagmap; + if (matches) { + var inlineTag = ""; + for (i = 0; i < matches.length; i++) { + inlineTag = matches[i]; + if (tagmap[inlineTag]) { + // This probably needs some work... + // We need to somehow get the fid propogated here. + // We really want to + var tagContent = tagmap[inlineTag]; + var mediaMarkup = this.stripDivs(tagContent); // THis is
        .. + + var _tag = inlineTag; + _tag = _tag.replace('[[',''); + _tag = _tag.replace(']]',''); + mediaObj = JSON.parse(_tag); + + var imgElement = $(mediaMarkup); + this.addImageAttributes(imgElement, mediaObj.fid, mediaObj.view_mode); + var toInsert = this.outerHTML(imgElement); + content = content.replace(inlineTag, toInsert); + } + else { + debug.debug("Could not find content for " + inlineTag); + } + } + } + return content; + }, + + /** + * Detach function, called when a rich text editor detaches + */ + detach: function (content, settings, instanceId) { + var content = $('
        ' + content + '
        '); + $('img.media-image',content).each(function (elem) { + var tag = Drupal.settings.ckeditor.plugins['media'].createTag($(this)); + $(this).replaceWith(tag); + var newContent = content.html(); + var tagContent = $('
        ').append($(this)).html(); + Drupal.settings.tagmap[tag] = tagContent; + }); + return content.html(); + }, + + /** + * @param jQuery imgNode + * Image node to create tag from + */ + createTag: function (imgNode) { + // Currently this is the itself + // Collect all attribs to be stashed into tagContent + var mediaAttributes = {}; + var imgElement = imgNode[0]; + var sorter = []; + + // @todo: this does not work in IE, width and height are always 0. + for (i=0; i< imgElement.attributes.length; i++) { + var attr = imgElement.attributes[i]; + if (attr.specified == true) { + if (attr.name !== 'class') { + sorter.push(attr); + } + else { + // Exctract expando properties from the class field. + var attributes = this.getAttributesFromClass(attr.value); + for (var name in attributes) { + if (attributes.hasOwnProperty(name)) { + var value = attributes[name]; + if (value.type && value.type === 'attr') { + sorter.push(value); + } + } + } + } + } + } + + sorter.sort(this.sortAttributes); + + for (var prop in sorter) { + mediaAttributes[sorter[prop].name] = sorter[prop].value; + } + + // The following 5 ifs are dedicated to IE7 + // If the style is null, it is because IE7 can't read values from itself + if (jQuery.browser.msie && jQuery.browser.version == '7.0') { + if (mediaAttributes.style === "null") { + var imgHeight = imgNode.css('height'); + var imgWidth = imgNode.css('width'); + mediaAttributes.style = { + height: imgHeight, + width: imgWidth + } + if (!mediaAttributes['width']) { + mediaAttributes['width'] = imgWidth; + } + if (!mediaAttributes['height']) { + mediaAttributes['height'] = imgHeight; + } + } + // If the attribute width is zero, get the CSS width + if (Number(mediaAttributes['width']) === 0) { + mediaAttributes['width'] = imgNode.css('width'); + } + // IE7 does support 'auto' as a value of the width attribute. It will not + // display the image if this value is allowed to pass through + if (mediaAttributes['width'] === 'auto') { + delete mediaAttributes['width']; + } + // If the attribute height is zero, get the CSS height + if (Number(mediaAttributes['height']) === 0) { + mediaAttributes['height'] = imgNode.css('height'); + } + // IE7 does support 'auto' as a value of the height attribute. It will not + // display the image if this value is allowed to pass through + if (mediaAttributes['height'] === 'auto') { + delete mediaAttributes['height']; + } + } + + // Remove elements from attribs using the blacklist + for (var blackList in Drupal.settings.media.blacklist) { + delete mediaAttributes[Drupal.settings.media.blacklist[blackList]]; + } + tagContent = { + "type": 'media', + // @todo: This will be selected from the format form + "view_mode": attributes['view_mode'].value, + "fid" : attributes['fid'].value, + "attributes": mediaAttributes + }; + return '[[' + JSON.stringify(tagContent) + ']]'; + }, + + /** + * Forces custom attributes into the class field of the specified image. + * + * Due to a bug in some versions of Firefox + * (http://forums.mozillazine.org/viewtopic.php?f=9&t=1991855), the + * custom attributes used to share information about the image are + * being stripped as the image markup is set into the rich text + * editor. Here we encode these attributes into the class field so + * the data survives. + * + * @param imgElement + * The image + * @fid + * The file id. + * @param view_mode + * The view mode. + * @param additional + * Additional attributes to add to the image. + */ + forceAttributesIntoClass: function (imgElement, fid, view_mode, additional) { + var wysiwyg = imgElement.attr('wysiwyg'); + if (wysiwyg) { + imgElement.addClass('attr__wysiwyg__' + wysiwyg); + } + var format = imgElement.attr('format'); + if (format) { + imgElement.addClass('attr__format__' + format); + } + var typeOf = imgElement.attr('typeof'); + if (typeOf) { + imgElement.addClass('attr__typeof__' + typeOf); + } + if (fid) { + imgElement.addClass('img__fid__' + fid); + } + if (view_mode) { + imgElement.addClass('img__view_mode__' + view_mode); + } + if (additional) { + for (var name in additional) { + if (additional.hasOwnProperty(name)) { + if (name !== 'alt') { + imgElement.addClass('attr__' + name + '__' + additional[name]); + } + } + } + } + }, + + /** + * Retrieves encoded attributes from the specified class string. + * + * @param classString + * A string containing the value of the class attribute. + * @return + * An array containing the attribute names as keys, and an object + * with the name, value, and attribute type (either 'attr' or + * 'img', depending on whether it is an image attribute or should + * be it the attributes section) + */ + getAttributesFromClass: function (classString) { + var actualClasses = []; + var otherAttributes = []; + var classes = classString.split(' '); + var regexp = new RegExp('^(attr|img)__([^\S]*)__([^\S]*)$'); + for (var index = 0; index < classes.length; index++) { + var matches = classes[index].match(regexp); + if (matches && matches.length === 4) { + otherAttributes[matches[2]] = { + name: matches[2], + value: matches[3], + type: matches[1] + }; + } + else { + actualClasses.push(classes[index]); + } + } + if (actualClasses.length > 0) { + otherAttributes['class'] = { + name: 'class', + value: actualClasses.join(' '), + type: 'attr' + }; + } + return otherAttributes; + }, + + sortAttributes: function (a, b) { + var nameA = a.name.toLowerCase(); + var nameB = b.name.toLowerCase(); + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + return 0; + } + }; + +})(jQuery); diff --git a/docroot/sites/all/modules/ckeditor/plugins/media/plugin.js b/docroot/sites/all/modules/ckeditor/plugins/media/plugin.js new file mode 100644 index 0000000..bd754e0 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/plugins/media/plugin.js @@ -0,0 +1,58 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @file Plugin for inserting images from Drupal media module + */ +( function() { + CKEDITOR.plugins.add( 'media', + { + // Wrap Drupal plugin in a proxy plugin. + init: function(editor) + { + var pluginCommand = { + exec: function (editor) { + var data = { + format: 'html', + node: null, + content: '' + }; + var selection = editor.getSelection(); + + if (selection) { + data.node = selection.getSelectedElement(); + if (data.node) { + data.node = data.node.$; + } + if (selection.getType() == CKEDITOR.SELECTION_TEXT) { + if (CKEDITOR.env.ie) { + data.content = selection.getNative().createRange().text; + } + else { + data.content = selection.getNative().toString(); + } + } + else if (data.node) { + // content is supposed to contain the "outerHTML". + data.content = data.node.parentNode.innerHTML; + } + } + Drupal.settings.ckeditor.plugins['media'].invoke(data, Drupal.settings.ckeditor.plugins['media'], editor.name); + } + }; + editor.addCommand( 'media', pluginCommand ); + + editor.ui.addButton( 'Media', + { + label: 'Add media', + command: 'media', + icon: this.path + 'images/icon.gif' + }); + } + }); + +} )(); + + diff --git a/docroot/sites/all/modules/ckeditor/plugins/mediaembed/images/icon.png b/docroot/sites/all/modules/ckeditor/plugins/mediaembed/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b052b7a0914619e8da00d89ff40387a3ebd43af9 GIT binary patch literal 560 zcmV-00?+-4P)Px#;ZRIeMX=V9EG#TOt;;L9O02A`W@cuTu!R5r|75uTHf9-ss$i3olk3=oT3T9j zb8}nEPLkqOP*6}czJ6c4*h_jaN=izuym@PDYkPZpR)0TbjZSR1?3~|j(B`>a$8T`E z=6TmvrKP3M&4h`pennt5g@uK0!T+nvtwh64IXOAc*q2YYwWht9u+xu>xnud@XKB$v zqvLy0izkk{X>z*kiHV7E#Q$i--CT%CqTqKtZy%YNnKLspl;C1*#rU(-l%3#ni@RiI zzW-~FR(!hKHfk8P)SHI5UzFilpW}CUz3q^GKOA(BlmR+){WDLj3y=*x0V_ ygOlex$#caUHac=gcj@?!_+i8hVN-QoSCubDtQ5ZITC@xR0000rO5Qci(iX%d5J{FNC&`uj>)6`QPmE__w5nny-kHjrfsy zdgFNH=IfZNy-|ze^Ub_cs_L)7^;Vj~VX^Zlr05iz>}H+i_4)idZrp^E`S0@evWQXs z`t=S#jP>p3@Adn9lGN+s-ldk3{PF84lHz)Nfn%l2_VxGq`1v=Y=Gxrg?CtQv!o>w{ ztN;K1A^8LV00000EC2ui0FeMY000L6K%a0(EE-fBW&+q?GcYcC{goSQ^K8A{mjCzQTkdcyTk8~?L z2nahXlXC)}paMTQ9RVUD0SFyAKcS#`0v!lFJqR+aa+Pr%9ySNR2R0cyXQFyIJQvCr zE5@FoKPwe66%_;3*dna1bvzC;;4>QIGY&j)x@xaD8owH~J3Su1Hs_ypD3}5J`~d_z z7o5F;CgQ^f5+QVySg0cei4!phw0b2+Ko1);Fn|DoK@$fK<9f7slP=A@9qu|TxR6Zc zg$ciU)Df^_-v9|C5>QBxV1$JK38~J(0o9^HiW(*wG%#Vp0#l_XYNQA-QJ@vE#-jLWEF^U}78`Sutq7g@y-$uw%=zDVe6juM7ct?1S55!UP8aU>>M^uMLU- z14i^UKp}&N-@h|Z_s z1Ff{d%YHskFaa$J_)u2?M$$3?UnAJ%h6sx-Wr7DZRP}=hC)A(=3d(j?Z5&A8z8U(D=<9pfG8*|fTjr3Fu=fy zYor&=FA5Yu=YRp&P}vT`1Xn--bg`%g4+Bsjgak5twF3o@8sMw6GI-!a0${GuL6i;D zKuo76d}@IN9w_DifM5q2#O5bmRG>jfY4R> zn!)_)M+wB4K?X=WmM>%?0|fx2CIrfW!e;Y^2@GKb7!p8{4sbpcNFYd}VZ#n2=(4Ja z0vd@?7rWdLvjVsv1rI=h875%D3ap|Pvx)%=R`|O%&;?)$aKLdiFbo95rcXLVW4qQc zfFW@I>klhff!WURfDstVFmAY%lp2r%PPpPEQA$b$M&hGyq#y+qIKv7=(5_aAzySc5 z-vZ5`s~-sOK4x%0)a>LZs#OjS6EL6wBp^aG5Wr#ELLe%oq=OoK0FV?RKniNP6b>S% z2Qzpi7T*Aa31pH58sL}xTqvkBUJL;mPyld(qr)9yCk}n=3k6#F0|MMYn-g#z8U#Rt zx|yH^4&hk`#)g9(RNw;%QHl;u@B%pSKpc-e!2_t6NdRC(i$(JnuXshLf>v{fn}ov- zR@n*y_;FhS0B9VN(*UQS^C1$z#tBY9f=?x-1|g`x9MPwN0vO~31jtT1`^f@fjfR>3 ziHqT}W;#&l-2^Jil#7x8Aqgn~Q=Wp(NDf3C88`?D`1XJc zyg&vZ=qCVXz%<*yv`6zm+Ts*u(+p5#4s~?awh#c+1bw0f6F{9)&bbh#Jmx7TAQc=i zBMb>3#2_EgY9_gQBd-Ea9rr*0UBrsUGdhWpba-e12mo0;grWsK7{OyUYk?9-paza< zKnUc315vUu20BZDR>hIV$_DfeIGBJhfWa$s2nr7uFu)!AzzrEp;06kDObK)#fgaGH z2cWe;1N0h)7J$eG(A6P0Y@h%e;EE()6_hhPLkm?rv8`;l0A&Sn$WOcg6RoNLh030Y zfB|_xnR3WM-uee!>#FfQW;tvp_RHTrbh5ty4saO-OyB~)*1!l3@P8A`;6^OC!4NLQ zgCk7gK1{g67{1c)*Po*d^cU)c;>_5n8s ztcC>a7!7-&0O!bXgDV^Q3+SjnK6u%dWlhIUSNVLjwza2mO>8x+ z+6YK!wzqBUN3U7}nHKd+V_joI58&XO+Y1cT9qe!$yjk0HvyKmb@N~Z{(wAQM zi61_Ig!h}?30Sy98t!P0dpr&P{0&;$|vpbEw zK{vhXwoZDnQ61$g6Zs52k@^~%jAvDw_yIwpO1RlvM^*3n%P|%+nfcO6!Kc{(t)%;x z{my3tnA*sAkG7-P3}%TpUV4y^`Wb5eax~aj%vX1o-GMyhgd5??L=X&(Qx9V%8$oR> z=8w{=9QAO&-px7Qv5{-72Bsgl!@$>Yc7soRxflQV9ws>Qmw$#0GavZQe?Et!FZ~Qh R;riImzV^4zeIo<`06Q^WzG?sf literal 0 HcmV?d00001 diff --git a/docroot/sites/all/modules/ckeditor/plugins/mediaembed/plugin.js b/docroot/sites/all/modules/ckeditor/plugins/mediaembed/plugin.js new file mode 100644 index 0000000..f0211b3 --- /dev/null +++ b/docroot/sites/all/modules/ckeditor/plugins/mediaembed/plugin.js @@ -0,0 +1,147 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @file Plugin for inserting Drupal embeded media + */ +( function() { + CKEDITOR.plugins.add( 'mediaembed', + { + requires : [ 'fakeobjects', 'htmlwriter' ], + init: function( editor ) + { + editor.addCss( + 'img.cke_mediaembed' + + '{' + + 'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/placeholder.gif' ) + ');' + + 'background-position: center center;' + + 'background-repeat: no-repeat;' + + 'border: 1px solid #a9a9a9;' + + 'width: 80px;' + + 'height: 80px;' + + '}' + ); + var me = this; + CKEDITOR.dialog.add( 'MediaEmbedDialog', function( editor ) { + return { + title : Drupal.t('Embed Media Dialog'), + minWidth : 400, + minHeight : 200, + contents : [ + { + id : 'mediaTab', + label : Drupal.t('Embed media code'), + title : Drupal.t('Embed media code'), + elements : + [ + { + id : 'embed', + type : 'textarea', + rows : 9, + label : Drupal.t('Paste embed code here') + } + ] + } + ], + onOk : function() { + var editor = this.getParentEditor(); + var content = this.getValueOf( 'mediaTab', 'embed' ); + if ( content.length>0 ) { + var realElement = CKEDITOR.dom.element.createFromHtml('
        '); + realElement.setHtml(content); + var fakeElement = editor.createFakeElement( realElement , 'cke_mediaembed', 'div', true); + var matches = content.match(/width=(["']?)(\d+)\1/i); + if (matches && matches.length == 3) { + fakeElement.setStyle('width', cssifyLength(matches[2])); + } + matches = content.match(/height=([\"\']?)(\d+)\1/i); + if (matches && matches.length == 3) { + fakeElement.setStyle('height', cssifyLength(matches[2])); + } + editor.insertElement(fakeElement); + } + } + }; + }); + + editor.addCommand( 'MediaEmbed', new CKEDITOR.dialogCommand( 'MediaEmbedDialog' ) ); + + editor.ui.addButton( 'MediaEmbed', + { + label: 'Embed Media', + command: 'MediaEmbed', + icon: this.path + 'images/icon.png' + } ); + }, + afterInit : function( editor ) + { + var dataProcessor = editor.dataProcessor, + dataFilter = dataProcessor && dataProcessor.dataFilter, + htmlFilter = dataProcessor && dataProcessor.htmlFilter; + + if ( htmlFilter ) + { + htmlFilter.addRules({ + elements : + { + 'div' : function ( element ) { + if( element.attributes['class'] == 'media_embed' ) { + for (var x in element.children) { + if (typeof(element.children[x].attributes) != 'undefined') { + if (typeof(element.children[x].attributes.width) != undefined) { + element.children[x].attributes.width = element.attributes.width; + } + if (typeof(element.children[x].attributes.height) != undefined) { + element.children[x].attributes.height = element.attributes.height; + } + } + } + } + } + } + }); + } + if ( dataFilter ) + { + dataFilter.addRules( + { + elements : + { + 'div' : function( element ) + { + var attributes = element.attributes, + classId = attributes.classid && String( attributes.classid ).toLowerCase(); + + if (element.attributes[ 'class' ] == 'media_embed') { + var fakeElement = editor.createFakeParserElement(element, 'cke_mediaembed', 'div', true); + var fakeStyle = fakeElement.attributes.style || ''; + if (typeof(element.children[0].attributes) != 'undefined') { + var height = element.children[0].attributes.height, + width = element.children[0].attributes.width; + } + if ( typeof width != 'undefined' ) + fakeStyle = fakeElement.attributes.style = fakeStyle + 'width:' + cssifyLength( width ) + ';'; + + if ( typeof height != 'undefined' ) + fakeStyle = fakeElement.attributes.style = fakeStyle + 'height:' + cssifyLength( height ) + ';'; + + return fakeElement; + } + return element; + } + } + }, + 5); + } + } + } ); + var numberRegex = /^\d+(?:\.\d+)?$/; + function cssifyLength( length ) + { + if ( numberRegex.test( length ) ) + return length + 'px'; + return length; + } +} )(); diff --git a/docroot/sites/all/modules/feeds.taxonomy_node_get_terms_fail_959984_82.patch b/docroot/sites/all/modules/feeds.taxonomy_node_get_terms_fail_959984_82.patch new file mode 100644 index 0000000..75910cf --- /dev/null +++ b/docroot/sites/all/modules/feeds.taxonomy_node_get_terms_fail_959984_82.patch @@ -0,0 +1,232 @@ +diff --git a/feeds.info b/feeds.info +index e7b27f7..22b8456 100644 +--- a/feeds.info ++++ b/feeds.info +@@ -23,6 +23,7 @@ files[] = tests/feeds_processor_term.test + files[] = tests/feeds_processor_user.test + files[] = tests/feeds_scheduler.test + files[] = tests/feeds_mapper_link.test ++files[] = tests/feeds_mapper_taxonomy.test + files[] = tests/parser_csv.test + files[] = views/feeds_views_handler_argument_importer_id.inc + files[] = views/feeds_views_handler_field_importer_name.inc +diff --git a/mappers/taxonomy.inc b/mappers/taxonomy.inc +index 90e4ef8..201dff6 100644 +--- a/mappers/taxonomy.inc ++++ b/mappers/taxonomy.inc +@@ -27,7 +27,7 @@ function taxonomy_feeds_parser_sources_alter(&$sources, $content_type) { + */ + function taxonomy_feeds_get_source(FeedsSource $source, FeedsParserResult $result, $key) { + if ($node = node_load($source->feed_nid)) { +- $terms = taxonomy_node_get_terms($node); ++ $terms = taxonomy_feeds_node_get_terms($node); + $vocabularies = taxonomy_vocabulary_load_multiple(array(), array('machine_name' => str_replace('parent:taxonomy:', '', $key))); + $vocabulary = array_shift($vocabularies); + $result = array(); +@@ -106,6 +106,49 @@ function taxonomy_feeds_set_target($source, $entity, $target, $terms) { + } + + /** ++ * Find all terms associated with the given node, within one vocabulary. ++ */ ++function taxonomy_feeds_node_get_terms($node, $key = 'tid') { ++ $terms = &drupal_static(__FUNCTION__); ++ ++ if (!isset($terms[$node->nid][$key])) { ++ // Get tids from all taxonomy_term_reference fields. ++ $tids = array(); ++ $fields = field_info_fields(); ++ foreach ($fields as $field_name => $field) { ++ if ($field['type'] == 'taxonomy_term_reference' && field_info_instance('node', $field_name, $node->type)) { ++ if (($items = field_get_items('node', $node, $field_name)) && is_array($items)) { ++ $tids = array_merge($tids, array_map('_taxonomy_extract_tid', $items)); ++ } ++ } ++ } ++ ++ // Load terms and cache them in static var. ++ $curr_terms = taxonomy_term_load_multiple($tids); ++ $terms[$node->nid][$key] = array(); ++ foreach ($curr_terms as $term) { ++ $terms[$node->nid][$key][$term->$key] = $term; ++ } ++ } ++ return $terms[$node->nid][$key]; ++} ++ ++/** ++ * Helper function used in taxonomy_feeds_node_get_terms(). Extracts ++ * tid from array item returned by field_get_items(). ++ * ++ * @param $item tid information in a form of single element array (key == 'tid', value == tid we're looking for) ++ * ++ * @return tid extracted from $item. ++ * ++ * @see taxonomy_feeds_node_get_terms() ++ * @see field_get_items() ++ */ ++function _taxonomy_extract_tid($item) { ++ return $item['tid']; ++} ++ ++/** + * Checks whether a term identified by name and vocabulary exists. Creates a + * new term if it does not exist. + * +@@ -140,4 +183,4 @@ function taxonomy_term_lookup_term($name, $vid) { + ->condition('vid', $vid) + ->execute() + ->fetchObject(); +-} ++} +\ No newline at end of file +diff --git a/tests/feeds_mapper_taxonomy.test b/tests/feeds_mapper_taxonomy.test +index adc37cd..4ee4277 100644 +--- a/tests/feeds_mapper_taxonomy.test ++++ b/tests/feeds_mapper_taxonomy.test +@@ -20,14 +20,67 @@ class FeedsMapperTaxonomyTestCase extends FeedsMapperTestCase { + function setUp() { + parent::setUp(); + +- // Add a new taxonomy vocabulary, add to article content type. ++ // Add Tags vocabulary + $edit = array( + 'name' => 'Tags', +- 'tags' => TRUE, +- 'nodes[article]' => TRUE, +- 'nodes[page]' => TRUE, ++ 'machine_name' => 'tags', + ); +- $this->drupalPost('admin/content/taxonomy/add/vocabulary', $edit, 'Save'); ++ $this->drupalPost('admin/structure/taxonomy/add', $edit, 'Save'); ++ ++ $edit = array( ++ 'name' => 'term1', ++ ); ++ $this->drupalPost('admin/structure/taxonomy/tags/add', $edit, t('Save')); ++ $this->assertText('Created new term term1.'); ++ ++ // Create term reference field. ++ $field = array( ++ 'field_name' => 'field_tags', ++ 'type' => 'taxonomy_term_reference', ++ 'cardinality' => FIELD_CARDINALITY_UNLIMITED, ++ 'settings' => array( ++ 'allowed_values' => array( ++ array( ++ 'vocabulary' => 'tags', ++ 'parent' => 0, ++ ), ++ ), ++ ), ++ ); ++ field_create_field($field); ++ ++ // Add term reference field to feed item bundle. ++ $this->instance = array( ++ 'field_name' => 'field_tags', ++ 'bundle' => 'article', ++ 'entity_type' => 'node', ++ 'widget' => array( ++ 'type' => 'options_select', ++ ), ++ 'display' => array( ++ 'default' => array( ++ 'type' => 'taxonomy_term_reference_link', ++ ), ++ ), ++ ); ++ field_create_instance($this->instance); ++ ++ // Add term reference field to feed node bundle. ++ $this->instance = array( ++ 'field_name' => 'field_tags', ++ 'bundle' => 'page', ++ 'entity_type' => 'node', ++ 'widget' => array( ++ 'type' => 'options_select', ++ ), ++ 'display' => array( ++ 'default' => array( ++ 'type' => 'taxonomy_term_reference_link', ++ ), ++ ), ++ ); ++ field_create_instance($this->instance); ++ + // Create an importer configuration with basic mapping. + $this->createImporterConfiguration('Syndication', 'syndication'); + $this->addMappings('syndication', +@@ -65,38 +118,48 @@ class FeedsMapperTaxonomyTestCase extends FeedsMapperTestCase { + * Test inheriting taxonomy from the feed node. + */ + function testInheritTaxonomy() { ++ ++ // Adjust importer settings ++ $this->setSettings('syndication', NULL, array('import_period' => FEEDS_SCHEDULE_NEVER)); ++ $this->setSettings('syndication', NULL, array('import_on_create' => FALSE)); ++ $this->assertText('Do not import on submission'); ++ + // Map feed node's taxonomy to feed item node's taxonomy. + $this->addMappings('syndication', + array( + array( +- 'source' => 'parent:taxonomy:1', +- 'target' => 'taxonomy:1', ++ 'source' => 'parent:taxonomy:tags', ++ 'target' => 'field_tags', ++ 'unique' => FALSE, + ), + ) + ); +- // Turn off import on create, create feed node, tag, import. +- $edit = array( +- 'import_on_create' => FALSE, +- ); +- $this->drupalPost('admin/structure/feeds/syndication/settings', $edit, 'Save'); +- $this->assertText('Do not import on submission'); +- $nid = $this->createFeedNode(); +- $terms = array('testterm1', 'testterm2', 'testterm3'); ++ ++ // Create feed node and add term term1. ++ $langcode = LANGUAGE_NONE; ++ $nid = $this->createFeedNode('syndication', NULL, 'Syndication'); ++ $term = taxonomy_get_term_by_name('term1'); ++ $term = reset($term); + $edit = array( +- 'taxonomy[tags][1]' => implode(',', $terms), ++ 'field_tags' . '[' . $langcode . '][]' => $term->tid, + ); + $this->drupalPost("node/$nid/edit", $edit, t('Save')); ++ $this->assertTaxonomyTerm($term->name); ++ ++ // Import nodes. + $this->drupalPost("node/$nid/import", array(), 'Import'); +- $count = db_query("SELECT COUNT(*) FROM {term_node}")->fetchField(); +- $this->assertEqual(33, $count, 'Found correct number of tags for all feed nodes and feed items.'); +- foreach ($terms as $term) { +- $this->assertTaxonomyTerm($term); +- } ++ $this->assertText('Created 10 nodes.'); ++ ++ $count = db_query("SELECT COUNT(*) FROM {taxonomy_index}")->fetchField(); ++ ++ // There should be one term for each node imported plus the term on the feed node. ++ $this->assertEqual(11, $count, 'Found correct number of tags for all feed nodes and feed items.'); + } + + /** + * Test aggregating RSS categories to taxonomy. + */ ++ /* + function testRSSCategoriesToTaxonomy() { + // Add mapping to tags vocabulary. + $this->addMappings('syndication', +@@ -201,6 +264,7 @@ class FeedsMapperTaxonomyTestCase extends FeedsMapperTestCase { + $this->assertEqual(29, db_query("SELECT count(*) FROM {term_data}")->fetchField(), "Found correct number of terms."); + $this->assertEqual(39, db_query("SELECT count(*) FROM {term_node}")->fetchField(), "Found correct number of term-node relations."); + } ++ */ + + /** + * Helper, finds node style taxonomy term markup in DOM.